author | convert-repo |
Fri, 06 Jul 2018 03:31:58 +0000 | |
changeset 18262 | 18e456b91b31 |
parent 18248 | 0e0b4a81b2a4 |
child 18264 | 4bf515143c81 |
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 |
||
18246 | 3798 |
canOpenChangeBrowser |
3799 |
^ self aspectFor:#canOpenChangeBrowser ifAbsent:[ false asValue ]. |
|
3800 |
||
3801 |
"Created: / 30-06-2018 / 18:29:53 / Claus Gittinger" |
|
3802 |
! |
|
3803 |
||
3892 | 3804 |
currentDirectories |
6725 | 3805 |
" returns a holder on a Collection of all currently selected directories |
3806 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3807 |
" |
3808 |
||
3809 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3810 |
! |
|
3811 |
||
6725 | 3812 |
currentDirectoriesValue |
3813 |
" returns a Collection of all currently selected directories |
|
3814 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3815 |
" |
|
3816 |
||
3817 |
^ self currentDirectories value |
|
3818 |
! |
|
3819 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3820 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3821 |
"return the single current directory or 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| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3824 |
|
6725 | 3825 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3826 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3827 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3828 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3829 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3830 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3831 |
|
13856 | 3832 |
currentDirectoryDisplayed |
3833 |
"Return a directory as Filename that is currently displayed in the browser" |
|
3834 |
||
3835 |
^self subclassResponsibility |
|
3836 |
||
3837 |
"Created: / 14-01-2013 / 11:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3838 |
! |
|
3839 |
||
3892 | 3840 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3841 |
"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
|
3842 |
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
|
3843 |
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
|
3844 |
|
6589 | 3845 |
^ self aspectFor:#currentFileNameHolder |
3846 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3847 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3848 |
|
4692 | 3849 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3850 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3851 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3852 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3853 |
currentSel asValue |
6589 | 3854 |
] |
3855 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3856 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3857 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3858 |
newFilenames := Set new. |
6589 | 3859 |
filenames do:[:eachFilename| |
3860 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3861 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3862 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3863 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3864 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3865 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3866 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3867 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3868 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3869 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3870 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3871 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3872 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3873 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3874 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3875 |
! |
3876 |
||
5528 | 3877 |
defaultFileEncoding |
3878 |
^ #'iso8859-1' "/ #'utf-8' |
|
3879 |
! |
|
3880 |
||
3892 | 3881 |
enableDirectoryUp |
3882 |
||
15259 | 3883 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[ValueHolder with:false] |
3892 | 3884 |
! |
3885 |
||
6456 | 3886 |
enableGotoDefaultDirectory |
15259 | 3887 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ ValueHolder with:true ]. |
4593 | 3888 |
! |
3889 |
||
8168 | 3890 |
enableGotoDesktop |
14308 | 3891 |
"/ backward compatibility |
3892 |
^ self enableGotoDesktopDirectory. |
|
8168 | 3893 |
! |
3894 |
||
9572 | 3895 |
enableGotoDesktopDirectory |
15259 | 3896 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ ValueHolder with:true ]. |
9572 | 3897 |
|
3898 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3899 |
! |
|
3900 |
||
6434 | 3901 |
enableGotoSmalltalkDirectory |
6456 | 3902 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3903 |
! |
3904 |
||
17187 | 3905 |
enableGotoSmalltalkWorkspaceDirectory |
3906 |
^ self aspectFor:#enableGotoSmalltalkWorkspaceDirectory ifAbsent:[ true asValue ]. |
|
3907 |
! |
|
3908 |
||
9677 | 3909 |
enableGotoTempDirectory |
3910 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3911 |
||
3912 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3913 |
! |
|
3914 |
||
3892 | 3915 |
enableHome |
3916 |
||
3917 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3918 |
! |
|
3919 |
||
9596 | 3920 |
enableMakeCurrentDirectory |
3921 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3922 |
||
3923 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3924 |
! |
|
3925 |
||
3892 | 3926 |
enableViewNoteBookApplication |
3927 |
||
3928 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3929 |
! |
|
3930 |
||
5528 | 3931 |
fileEncoding |
3932 |
^ self fileEncodingHolder value |
|
3933 |
! |
|
3934 |
||
3935 |
fileEncoding:newEncoding |
|
5533 | 3936 |
self fileEncodingHolder value:newEncoding. |
3937 |
||
3938 |
self |
|
3939 |
applicationNamed:#FileApplicationNoteBook |
|
3940 |
ifPresentDo:[:nb | |
|
3941 |
|appl| |
|
3942 |
||
3943 |
appl := nb selectedApplication. |
|
5535 | 3944 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3945 |
appl fileEncoding:newEncoding |
3946 |
] |
|
3947 |
]. |
|
5528 | 3948 |
! |
3949 |
||
5737 | 3950 |
fileEncodingHolder |
3951 |
^ self |
|
3952 |
aspectFor:#fileEncodingHolder |
|
3953 |
ifAbsent:[ |
|
3954 |
self |
|
3955 |
applicationNamed:#FileApplicationNoteBook |
|
3956 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3957 |
] |
|
3958 |
! |
|
3959 |
||
17485 | 3960 |
fileEntryFieldHolder |
3961 |
^ self subclassResponsibility. |
|
3962 |
||
3963 |
"Created: / 31-03-2017 / 11:36:49 / stefan" |
|
3964 |
! |
|
3965 |
||
5961 | 3966 |
firstSelectedFileName |
3967 |
|files| |
|
3968 |
||
7560 | 3969 |
files := self currentSelectedObjects. |
5961 | 3970 |
files notEmpty ifTrue:[ |
3971 |
^ files first |
|
3972 |
]. |
|
3973 |
^ nil |
|
7560 | 3974 |
|
3975 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3976 |
! |
3977 |
||
6456 | 3978 |
gotoDefaultDirectoryIsVisible |
9596 | 3979 |
^ true. |
3980 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3981 |
||
3982 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3983 |
! |
3984 |
||
9572 | 3985 |
gotoDesktopDirectoryIsVisible |
3986 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3987 |
||
3988 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3989 |
||
3990 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3991 |
! |
|
3992 |
||
4618 | 3993 |
hasFileSelection |
3994 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3995 |
! |
|
3996 |
||
9490 | 3997 |
hasNotTwoDirectoriesSelectedHolder |
3998 |
^ self |
|
3999 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
4000 |
ifAbsent:[ |
|
4001 |
BlockValue |
|
4002 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
4003 |
argument:self currentFileNameHolder |
|
4004 |
]. |
|
4005 |
||
4006 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
4007 |
! |
|
4008 |
||
5830 | 4009 |
hasNotTwoFilesSelectedHolder |
9490 | 4010 |
^ self |
4011 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 4012 |
ifAbsent:[ |
4013 |
BlockValue |
|
4014 |
with:[:m | self hasTwoFilesSelected not] |
|
4015 |
argument:self currentFileNameHolder |
|
4016 |
]. |
|
9490 | 4017 |
|
4018 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 4019 |
! |
4020 |
||
3892 | 4021 |
hasSelection |
17923 | 4022 |
"aspect holding true, if a file is selected" |
3892 | 4023 |
|
4024 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
4025 |
! |
|
4026 |
||
9490 | 4027 |
hasTwoDirectoriesSelectedHolder |
4028 |
^ self |
|
4029 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
4030 |
ifAbsent:[ |
|
4031 |
BlockValue |
|
4032 |
with:[:m | self hasTwoDirectoriesSelected] |
|
4033 |
argument:self currentFileNameHolder |
|
4034 |
]. |
|
4035 |
||
4036 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
4037 |
! |
|
4038 |
||
4414 | 4039 |
hasTwoFilesSelectedHolder |
9490 | 4040 |
^ self |
4041 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4042 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4043 |
BlockValue |
5830 | 4044 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4045 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
4046 |
]. |
9490 | 4047 |
|
4048 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 4049 |
! |
4050 |
||
11053 | 4051 |
inputTabColumnConversion |
4052 |
^ self inputTabColumnConversionHolder value |
|
4053 |
||
4054 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
4055 |
! |
|
4056 |
||
4057 |
inputTabColumnConversionHolder |
|
4058 |
^ self |
|
4059 |
aspectFor:#inputTabColumnConversionHolder |
|
4060 |
ifAbsent:[ |
|
4061 |
self |
|
4062 |
applicationNamed:#FileApplicationNoteBook |
|
4063 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
4064 |
] |
|
4065 |
||
4066 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
4067 |
! |
|
4068 |
||
4069 |
lineEndConvention |
|
15208 | 4070 |
^ self lineEndConventionHolder value asSymbol |
11053 | 4071 |
|
4072 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
4073 |
! |
|
4074 |
||
11591 | 4075 |
lineEndConvention: aSymbol |
15208 | 4076 |
self lineEndConventionHolder value: aSymbol asSymbol |
11591 | 4077 |
|
4078 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
4079 |
! |
|
4080 |
||
11053 | 4081 |
lineEndConventionHolder |
4082 |
^ self |
|
4083 |
aspectFor:#lineEndConventionHolder |
|
4084 |
ifAbsent:[ |
|
4085 |
self |
|
4086 |
applicationNamed:#FileApplicationNoteBook |
|
4087 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
4088 |
] |
|
4089 |
||
4090 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
4091 |
! |
|
4092 |
||
5737 | 4093 |
lockFileEncoding:aBoolean |
4094 |
self lockFileEncodingHolder value:aBoolean. |
|
4095 |
||
4096 |
self |
|
4097 |
applicationNamed:#FileApplicationNoteBook |
|
4098 |
ifPresentDo:[:nb | |
|
4099 |
|appl| |
|
4100 |
||
4101 |
appl := nb selectedApplication. |
|
4102 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
4103 |
appl lockFileEncoding:aBoolean |
|
4104 |
] |
|
4105 |
]. |
|
4106 |
! |
|
4107 |
||
4108 |
lockFileEncodingHolder |
|
4109 |
^ self |
|
4110 |
aspectFor:#lockFileEncodingHolder |
|
4111 |
ifAbsent:[ |
|
4112 |
self |
|
4113 |
applicationNamed:#FileApplicationNoteBook |
|
4114 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
4115 |
] |
|
4116 |
! |
|
4117 |
||
13856 | 4118 |
makeCommandHolder |
4119 |
^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ]. |
|
4120 |
||
4121 |
"Created: / 13-04-2012 / 17:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4122 |
! |
|
4123 |
||
4523 | 4124 |
notify:aString |
11108 | 4125 |
"aString is shown in the lower pane" |
4126 |
||
4523 | 4127 |
self notifyChannel value:aString |
11108 | 4128 |
|
4129 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 4130 |
! |
4131 |
||
3892 | 4132 |
notifyChannel |
4133 |
||
4134 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 4135 |
! |
4136 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4137 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4138 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4139 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4140 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4141 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4142 |
|
4071 | 4143 |
rootHolder |
4144 |
"holder, which keeps the rootHolder of the treeView |
|
4145 |
" |
|
4146 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4147 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4148 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4149 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4150 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4151 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4152 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4153 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
4154 |
self aspectFor:#rootHolder put:aHolder |
3892 | 4155 |
! ! |
4156 |
||
4157 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
4158 |
||
4159 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 4160 |
"returns the model for an aspect; these are stored in a common dictionary" |
4161 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4162 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 4163 |
! |
4164 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4165 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 4166 |
"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
|
4167 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4168 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4169 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4170 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4171 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4172 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4173 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4174 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4175 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4176 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4177 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4178 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4179 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4180 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4181 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4182 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4183 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4184 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4185 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4186 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4187 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4188 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4189 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4190 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4191 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4192 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4193 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4194 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4195 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4196 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4197 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4198 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4199 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4200 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
4201 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4202 |
aspectFor:something put:aValueHolder |
6284 | 4203 |
"stores the model for an aspect; these are stored in a common dictionary" |
4204 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4205 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4206 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
4207 |
|
3892 | 4208 |
aspects |
6284 | 4209 |
"returns the common aspect dictionary" |
4210 |
||
3892 | 4211 |
^ aspects |
4212 |
! |
|
4213 |
||
4214 |
runtimeAspectValueFor:something |
|
4215 |
"returns the default aspect item from the class variable RuntimeAspects |
|
4216 |
" |
|
4217 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
4218 |
! |
|
4219 |
||
4201 | 4220 |
saveAspectValues |
16306 | 4221 |
|prefs saveAspects aspectValue| |
4222 |
||
4223 |
prefs := UserPreferences current. |
|
4224 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4225 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4226 |
saveAspects do:[ :aspectKey | |
4201 | 4227 |
aspectValue := (self perform:aspectKey) value. |
16306 | 4228 |
prefs |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4229 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4230 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4231 |
]. |
16306 | 4232 |
prefs beModified. |
4233 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4234 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 4235 |
! |
4236 |
||
3892 | 4237 |
saveRuntimeAspectValues |
4238 |
|savedAspects dictionary value isHolder aspect| |
|
4239 |
||
5941 | 4240 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 4241 |
dictionary := Dictionary new. |
5941 | 4242 |
savedAspects do:[:aspectKey | |
4414 | 4243 |
aspect := self perform:aspectKey. |
4244 |
isHolder := aspect isValueModel. |
|
5941 | 4245 |
isHolder ifTrue:[ |
4246 |
value := aspect value |
|
4247 |
] ifFalse:[ |
|
4248 |
value := aspect |
|
4249 |
]. |
|
4250 |
dictionary at:aspectKey |
|
4251 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
4252 |
]. |
|
4253 |
RuntimeAspects := dictionary. |
|
3892 | 4254 |
! |
4255 |
||
4201 | 4256 |
userPreferencesAspectValueFor:something |
4257 |
"returns the default aspect from the Userpreferences |
|
3892 | 4258 |
" |
4201 | 4259 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4260 |
(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
|
4261 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
4262 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4263 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4264 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
4265 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 4266 |
! ! |
4267 |
||
4011 | 4268 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
4269 |
||
9015 | 4270 |
filter:aString |
4271 |
self filterModel value:aString |
|
4272 |
! |
|
4273 |
||
4018 | 4274 |
filterBackgroundColor |
4275 |
||
4276 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
4277 |
! |
|
4278 |
||
4011 | 4279 |
filterBlockHolder |
4280 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4281 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 4282 |
! |
4283 |
||
4284 |
filterListModel |
|
4285 |
||
4286 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
4287 |
! |
|
4288 |
||
4289 |
filterModel |
|
5941 | 4290 |
|m| |
4291 |
||
4292 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
4293 |
^ m |
|
4011 | 4294 |
! |
4295 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4296 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4297 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4298 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
4299 |
|
4018 | 4300 |
filterValueBox |
4301 |
||
4302 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
4303 |
! |
|
4304 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4305 |
makeFilterBlock |
14497 | 4306 |
"return a two-arg filterblock on the file's path- and base-name. This block should return true for files |
9102 | 4307 |
to be shown" |
4308 |
||
17481 | 4309 |
| filterString filterStrings filters notFilters showHidden filterBlock caseSensitive| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4310 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4311 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4312 |
filterString = '' ifTrue:[filterString := '*']. |
17481 | 4313 |
caseSensitive := "ignoreCaseInPattern ?" Filename isCaseSensitive. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4314 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4315 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 4316 |
filterStrings := filterStrings |
4317 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
4318 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4319 |
filters := filterStrings |
12760 | 4320 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
4321 |
thenCollect: |
|
4322 |
[:eachPattern | |
|
4323 |
|pattern| |
|
4324 |
||
4325 |
pattern := eachPattern withoutSeparators. |
|
15597 | 4326 |
pattern includesMatchCharacters ifFalse:[ |
4327 |
"JV@2012-03-05: Add implict star at the beginning and at the end of pattern, |
|
4328 |
that's how most of the other applications behave - do what most users expect" |
|
17772 | 4329 |
"/ pattern first == $* ifFalse:[pattern := '*' , pattern]. |
4330 |
"/ pattern last == $* ifFalse:[pattern := pattern , '*']. |
|
4331 |
[:name :baseName | baseName asLowercase includesString:pattern caseSensitive:caseSensitive] |
|
4332 |
] ifTrue:[ |
|
4333 |
pattern = '*' ifTrue:[ |
|
4334 |
[:name :baseName | true]. |
|
4335 |
] ifFalse:[ |
|
4336 |
[:name :baseName | pattern match:baseName caseSensitive:caseSensitive] |
|
4337 |
]. |
|
15597 | 4338 |
]. |
12760 | 4339 |
]. |
4340 |
||
4341 |
notFilters := filterStrings |
|
4342 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
4343 |
thenCollect: |
|
4344 |
[:eachPattern | |
|
9296 | 4345 |
|pattern| |
4346 |
||
4347 |
pattern := eachPattern withoutSeparators. |
|
12760 | 4348 |
pattern := (pattern copyFrom:2) withoutSeparators. |
17481 | 4349 |
[:name :baseName | pattern match:baseName caseSensitive:caseSensitive] |
9296 | 4350 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4351 |
|
12760 | 4352 |
|
4353 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4354 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4355 |
] ifFalse:[ |
12760 | 4356 |
filters isEmpty ifTrue:[ |
4357 |
filterBlock := [:name :baseName | |
|
4358 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
4359 |
]. |
|
4360 |
] ifFalse:[ |
|
4361 |
notFilters isEmpty ifTrue:[ |
|
4362 |
filterBlock := [:name :baseName | |
|
4363 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
4364 |
]. |
|
4365 |
] ifFalse:[ |
|
4366 |
filterBlock := [:name :baseName | |
|
4367 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
4368 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
4369 |
]. |
|
4370 |
] |
|
4371 |
] |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4372 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4373 |
|
4011 | 4374 |
showHidden := self showHiddenFiles value. |
4375 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4376 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4377 |
]. |
9296 | 4378 |
^ [:name :baseName | |
4379 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
13856 | 4380 |
|
4381 |
"Modified: / 05-02-2012 / 01:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17481 | 4382 |
"Modified: / 27-03-2017 / 12:52:08 / stefan" |
17772 | 4383 |
"Modified: / 20-11-2017 / 22:02:04 / cg" |
4018 | 4384 |
! |
4385 |
||
4386 |
shownFiles |
|
4387 |
||
4388 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 4389 |
! ! |
4390 |
||
14126 | 4391 |
|
3892 | 4392 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
4393 |
||
4394 |
dirHistory |
|
6369 | 4395 |
"obsolete" |
4396 |
^ self directoryHistory |
|
4397 |
! |
|
4398 |
||
4399 |
directoryHistory |
|
3952 | 4400 |
^ self class directoryHistory |
3892 | 4401 |
! |
4402 |
||
4403 |
enableBack |
|
4404 |
||
15259 | 4405 |
^ self aspectFor:#enableBack ifAbsent:[ValueHolder with:false] |
3892 | 4406 |
! |
4407 |
||
4408 |
enableFileHistory |
|
4409 |
||
15259 | 4410 |
^ self aspectFor:#enableFileHistory ifAbsent:[ValueHolder with:false] |
3892 | 4411 |
! |
4412 |
||
4413 |
enableForward |
|
4414 |
||
15259 | 4415 |
^ self aspectFor:#enableForward ifAbsent:[ValueHolder with:false] |
3892 | 4416 |
! |
4417 |
||
4418 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
4419 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 4420 |
! ! |
4421 |
||
4422 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
4423 |
||
4345 | 4424 |
activityVisibilityChannel |
6284 | 4425 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 4426 |
|
15259 | 4427 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ ValueHolder with:false ]. |
4345 | 4428 |
! |
4429 |
||
15111 | 4430 |
alwaysUseSmalltalkTools |
4431 |
" aspect to prevent os tools to be opened on double click" |
|
4432 |
||
15259 | 4433 |
^ self aspectFor:#alwaysUseSmalltalkTools ifAbsent:[ ValueHolder with:true ]. |
15111 | 4434 |
! |
4435 |
||
6602 | 4436 |
changeSetBrowserItemVisible |
4437 |
^ Screen current ctrlDown. |
|
4438 |
! |
|
4439 |
||
11135 | 4440 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4441 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 4442 |
|
4443 |
"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
|
4444 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4445 |
! |
4446 |
||
13856 | 4447 |
hgMenusAreShown |
4448 |
^ (ConfigurableFeatures includesFeature: #HGSupportEnabled) |
|
4449 |
||
4450 |
"Created: / 14-01-2013 / 11:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4451 |
! |
|
4452 |
||
11135 | 4453 |
mercurialMenusAreShown |
11147 | 4454 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 4455 |
|
4456 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
4457 |
! |
|
4458 |
||
4110 | 4459 |
openAlwaysInTextEditor |
17024 | 4460 |
" aspect for open every file in TextEditor don't use e.g. HtmlEditor for *.html'" |
4110 | 4461 |
|
15111 | 4462 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
4110 | 4463 |
! |
4464 |
||
3892 | 4465 |
openMultipleApplicationsForType |
4466 |
||
4201 | 4467 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
4468 |
open TextEditor " |
|
4469 |
||
3892 | 4470 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
4471 |
! |
|
4472 |
||
11137 | 4473 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4474 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4475 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 4476 |
|
4477 |
"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
|
4478 |
"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
|
4479 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 4480 |
! |
4481 |
||
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
|
4482 |
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
|
4483 |
|
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
|
4484 |
^ 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
|
4485 |
|
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
|
4486 |
"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
|
4487 |
! |
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
|
4488 |
|
4201 | 4489 |
showDirectoryTree |
4490 |
||
4491 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 4492 |
! |
4493 |
||
4554 | 4494 |
showDiskUsageHolder |
4495 |
|holder| |
|
4496 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
4497 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 4498 |
holder addDependent:self. |
4554 | 4499 |
^ holder |
4500 |
! |
|
4501 |
||
3892 | 4502 |
showHiddenFiles |
4503 |
||
9582 | 4504 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
4505 |
||
4506 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 4507 |
! |
4508 |
||
9108 | 4509 |
showHiddenFiles:aHolder |
4510 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
4511 |
! |
|
4512 |
||
4513 |
shownFiles:aHolder |
|
4514 |
self aspectFor:#shownFiles put:aHolder. |
|
4515 |
! |
|
4516 |
||
11135 | 4517 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4518 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 4519 |
|
4520 |
"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
|
4521 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4522 |
! |
4523 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4524 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4525 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
4526 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4527 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
4528 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4529 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4530 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4531 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4532 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4533 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4534 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4535 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4536 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4537 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4538 |
|
4648 | 4539 |
userContextAvailable |
4540 |
||
4541 |
" aspect for show group and user columns in contents view |
|
4542 |
windows provides no user context" |
|
4543 |
||
4544 |
^ OperatingSystem isMSWINDOWSlike not |
|
4545 |
! |
|
4546 |
||
3892 | 4547 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4548 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4549 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4550 |
^ self directoryContentsBrowser viewDescription |
3892 | 4551 |
! |
4552 |
||
4553 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4554 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4555 |
" |
3892 | 4556 |
|
6121 | 4557 |
|directoryContentsBrowser| |
4558 |
||
4559 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4560 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4561 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4562 |
! |
4563 |
||
4564 |
viewDirectoryDescription |
|
4565 |
||
4201 | 4566 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4567 |
on change directory " |
|
4568 |
||
3892 | 4569 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4570 |
! |
|
4571 |
||
4201 | 4572 |
viewDirsInContentsBrowser |
4573 |
||
4574 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4575 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4576 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4577 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4578 |
" |
4201 | 4579 |
! |
4580 |
||
5870 | 4581 |
viewFilesInContentsBrowser |
4582 |
||
4583 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4584 |
! |
|
4585 |
||
3892 | 4586 |
viewFilesInDirectoryTree |
4587 |
||
4201 | 4588 |
" aspect for view files in tree view (not only directories) " |
4589 |
||
3892 | 4590 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4591 |
! |
|
4592 |
||
4593 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4594 |
" aspect for show group information 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 viewGroup |
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 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4600 |
" aspect for show file-type icon 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 viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4603 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4604 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4605 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4606 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4607 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4608 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4609 |
! |
4610 |
||
4611 |
viewNoteBookApplicationHolder |
|
4612 |
||
4613 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4614 |
! |
|
4615 |
||
4616 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4617 |
" aspect for show owner 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 viewOwner |
3892 | 4620 |
! |
4621 |
||
4622 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4623 |
" aspect for show permission information 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 viewPermissions |
3892 | 4626 |
! |
4627 |
||
4628 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4629 |
" aspect for show image previev 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 viewPreview |
3892 | 4632 |
! |
4633 |
||
4634 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4635 |
" aspect for show size 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 viewSize |
3892 | 4638 |
! |
4639 |
||
4974 | 4640 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4641 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4642 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4643 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4644 |
! |
4645 |
||
5312 | 4646 |
viewSizeInKiloBytes |
4647 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4648 |
||
4649 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4650 |
! |
|
4651 |
||
3892 | 4652 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4653 |
" aspect for show time 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 viewTime |
3892 | 4656 |
! |
4657 |
||
4658 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4659 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4660 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4661 |
^ self directoryContentsBrowser viewType |
3892 | 4662 |
! ! |
4663 |
||
4664 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4665 |
||
4666 |
executeCommand:cmd |
|
4667 |
||
4668 |
self executeCommand:cmd inDirectory:nil |
|
4669 |
! |
|
4670 |
||
5880 | 4671 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4672 |
| nameString executionBlock| |
4673 |
||
5880 | 4674 |
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
|
4675 |
nameString := 'Execute: ', cmd. |
3892 | 4676 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4677 |
! |
|
4678 |
||
4679 |
getExecutionBlockForCommand:cmd |
|
4680 |
||
4681 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4682 |
! |
|
4683 |
||
5880 | 4684 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4685 |
| dir| |
|
4686 |
||
4687 |
dir := directoryOrNil. |
|
4688 |
directoryOrNil isNil ifTrue:[ |
|
4689 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4690 |
dir isNil ifTrue:[ |
12493 | 4691 |
Dialog warn:(resources string:'Please select a single directory.'). |
16732 | 4692 |
AbortOperationRequest raise. |
6671 | 4693 |
^ nil |
4694 |
]. |
|
3892 | 4695 |
]. |
4523 | 4696 |
|
4697 |
^ [:stream| |
|
4698 |
stream notNil ifTrue:[ |
|
4414 | 4699 |
OperatingSystem |
4700 |
executeCommand:cmd |
|
4701 |
inputFrom:nil |
|
4702 |
outputTo:stream |
|
4703 |
errorTo:stream |
|
4704 |
inDirectory:dir |
|
16732 | 4705 |
lineWise:true |
16825 | 4706 |
showWindow:false |
4414 | 4707 |
onError:[:status| false]. |
4708 |
] |
|
4523 | 4709 |
]. |
3892 | 4710 |
! |
4711 |
||
4712 |
killAllRunningBackgroundProcesses |
|
4713 |
||
4714 |
self backgroundProcesses do:[ : process | |
|
4523 | 4715 |
self notify:'kill ', process name. |
4414 | 4716 |
process terminate. |
3892 | 4717 |
]. |
4718 |
! |
|
4719 |
||
4720 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4721 |
| stream process appl nameString| |
|
4722 |
||
4723 |
appl := self openCommandResultApplication. |
|
4724 |
stream := appl resultStream. |
|
4725 |
nameString := aString ? 'Execution Result'. |
|
4726 |
appl changeTabTo:nameString. |
|
4523 | 4727 |
|
16102 | 4728 |
process := |
4729 |
[ |
|
4730 |
[aBlock value:stream] |
|
4731 |
ensure:[ |
|
4732 |
self backgroundProcesses remove:process ifAbsent:[]. |
|
4733 |
appl process value:nil. |
|
4734 |
||
4735 |
"/ close automatically, if there was no output. |
|
4571 | 4736 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4737 |
"/ appl doClose. |
|
4738 |
"/ ] |
|
16102 | 4739 |
stream nextPutLine:'Done.'. |
4740 |
self enqueueMessage:#updateCurrentDirectory. |
|
4741 |
] |
|
4742 |
] newProcess. |
|
3892 | 4743 |
process priority:(Processor userBackgroundPriority). |
4744 |
process name:nameString. |
|
4745 |
self backgroundProcesses add:process. |
|
4746 |
appl process value:process. |
|
4747 |
process resume. |
|
4748 |
! ! |
|
4749 |
||
4750 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4751 |
||
4915 | 4752 |
currentFileNameHolderChanged |
4753 |
"/ self currentFileNameHolderChangedForCommon |
|
4754 |
! |
|
4755 |
||
4577 | 4756 |
currentFileNameHolderChangedForCommon |
5476 | 4757 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4758 |
|
7560 | 4759 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4760 |
self class currentSelection:selection. |
4734 | 4761 |
|
13521 | 4762 |
selectionNotEmpty := selection notEmptyOrNil. |
5476 | 4763 |
self hasSelection value:selectionNotEmpty. |
4764 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
18246 | 4765 |
self canOpenChangeBrowser value:(selectionNotEmpty). |
4734 | 4766 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4767 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4768 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4769 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4770 |
self currentDirectories value:newDirectories. |
4771 |
size := newDirectories size. |
|
4774 | 4772 |
rootInTreeView := self |
4773 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4774 |
ifPresentDo:[:appl | appl rootHolder]. |
4775 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4776 |
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
|
4777 |
|
4347 | 4778 |
newDirectories notEmpty ifTrue:[ |
6369 | 4779 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4780 |
]. |
5074 | 4781 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
14308 | 4782 |
"/ self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4783 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4784 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4785 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4786 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4787 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4788 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4789 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4790 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4791 |
self enableForward value:self canForward. |
4734 | 4792 |
self enableBack value:self canBackward. |
6095 | 4793 |
|
13856 | 4794 |
self updateCanMake. |
7560 | 4795 |
|
9677 | 4796 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
13856 | 4797 |
"Modified: / 17-12-2013 / 08:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
18246 | 4798 |
"Modified: / 30-06-2018 / 18:30:44 / Claus Gittinger" |
4011 | 4799 |
! |
4800 |
||
4801 |
filterModelChanged |
|
4802 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4803 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4804 |
! |
4805 |
||
3892 | 4806 |
update:something with:aParameter from:changedObject |
4807 |
||
4808 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4809 |
and the things that have to be done if it runs standalone " |
|
4810 |
||
4811 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4812 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4813 |
^ self |
3892 | 4814 |
]. |
3989 | 4815 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4816 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4817 |
^ self |
3989 | 4818 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4819 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4820 |
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
|
4821 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4822 |
]. |
4011 | 4823 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4824 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4825 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4826 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4827 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4828 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4829 |
^ self |
4004 | 4830 |
]. |
4781 | 4831 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4832 |
self notify:nil. |
4781 | 4833 |
^ self |
4834 |
]. |
|
3989 | 4835 |
|
3892 | 4836 |
super update:something with:aParameter from:changedObject |
5543 | 4837 |
! |
4838 |
||
6095 | 4839 |
updateCanMake |
4840 |
|dir can| |
|
4841 |
||
4842 |
can := false. |
|
4843 |
dir := self currentDirectory. |
|
4844 |
dir notNil ifTrue:[ |
|
13856 | 4845 |
"/ Check for make |
6095 | 4846 |
can := (dir asFilename construct:'Makefile') exists. |
13856 | 4847 |
can ifFalse:[ |
4848 |
can := (dir asFilename construct:'makefile') exists. |
|
4849 |
]. |
|
6095 | 4850 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4851 |
can ifFalse:[ |
|
13856 | 4852 |
can := (self currentDirectory asFilename construct:'bc.mak') exists. |
6095 | 4853 |
] |
4854 |
]. |
|
13856 | 4855 |
can ifTrue:[ |
4856 |
self makeCommandHolder value: 'make'. |
|
4857 |
self canMake value: true. |
|
4858 |
^ self |
|
4859 |
]. |
|
4860 |
||
4861 |
"/Check for Apache ant |
|
4862 |
(OperatingSystem canExecuteCommand: 'ant') ifTrue:[ |
|
4863 |
can := (dir asFilename construct:'build.xml') exists. |
|
4864 |
can ifTrue:[ |
|
4865 |
self makeCommandHolder value: 'ant'. |
|
4866 |
self canMake value: true. |
|
4867 |
^ self |
|
4868 |
]. |
|
4869 |
]. |
|
4870 |
||
4871 |
"/Add more here... |
|
4872 |
||
6095 | 4873 |
]. |
4874 |
self canMake value:can. |
|
13856 | 4875 |
|
4876 |
"Modified: / 17-12-2013 / 08:13:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6095 | 4877 |
! |
4878 |
||
5543 | 4879 |
updateListAfterDelete:colOfFiles |
17871 | 4880 |
self updateCurrentDirectoryWithReread |
3892 | 4881 |
! ! |
4882 |
||
4883 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4884 |
||
4885 |
canPaste |
|
4886 |
||
15259 | 4887 |
^ self aspectFor:#canPaste ifAbsent:[ ValueHolder with:false ]. |
3892 | 4888 |
! |
4889 |
||
4890 |
clipboard |
|
4891 |
||
4892 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4893 |
! |
|
4894 |
||
4895 |
copyFilesToClipBoard:colOfFiles |
|
4896 |
self putInClipBoard:colOfFiles as:#copy. |
|
4897 |
! |
|
4898 |
||
4899 |
cutFilesToClipBoard:colOfFiles |
|
4900 |
"defete current selected files/directories |
|
4901 |
" |
|
4902 |
self putInClipBoard:colOfFiles as:#cut. |
|
4903 |
! |
|
4904 |
||
4905 |
emptyClipBoard |
|
4906 |
||
4907 |
self clipboard files:nil. |
|
4908 |
self canPaste value:false. |
|
4909 |
! |
|
4910 |
||
4911 |
putInClipBoard:colOfFiles as:aSymbol |
|
4912 |
| stream clp| |
|
4913 |
||
4914 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4915 |
clp := self clipboard. |
|
4916 |
clp files:nil. |
|
4917 |
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
|
4918 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4919 |
stream := String writeStream. |
3892 | 4920 |
stream nextPutAll:aSymbol asString. |
4921 |
stream nextPutAll:' <'. |
|
4922 |
stream nextPutAll:colOfFiles first asString. |
|
4923 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4924 |
stream nextPutAll:' ...'. |
3892 | 4925 |
]. |
4926 |
stream nextPutAll:'> to clipboard'. |
|
4927 |
||
4523 | 4928 |
self notify:stream contents. |
3892 | 4929 |
clp files:colOfFiles. |
4930 |
self canPaste value:true. |
|
4931 |
! ! |
|
4932 |
||
4933 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4934 |
||
4935 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4936 |
|filenameDirString filenameDir| |
3892 | 4937 |
|
4938 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4939 |
|
3892 | 4940 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4941 |
filenameDir isNil ifTrue:[^ false ]. |
13232 | 4942 |
filenameDir isWritableDirectory ifFalse:[^ false]. |
6284 | 4943 |
|
3892 | 4944 |
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
|
4945 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4946 |
dropedObjects do:[:aDropObject | |
6284 | 4947 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4948 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4949 |
"/ |
|
4950 |
"/ dropFileName := aDropObject theObject. |
|
4951 |
"/ dropFileNameString := dropFileName asString. |
|
4952 |
"/ dropFileName isDirectory ifTrue:[ |
|
4953 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4954 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4955 |
"/ ^ false |
|
4956 |
"/ ] |
|
4957 |
"/ ] ifFalse:[ |
|
4958 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4959 |
"/ (filenameDirString = dropFileName directory asString |
|
4960 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4961 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4962 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4963 |
"/ ^ false |
|
4964 |
"/ ] |
|
4965 |
"/ ] |
|
4966 |
]. |
|
4967 |
self notify:nil. |
|
4968 |
^ true |
|
4969 |
! |
|
4970 |
||
4971 |
canDropObject:aDropObject into:aDirectory |
|
4972 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4973 |
||
4974 |
dropFileName := aDropObject theObject. |
|
4975 |
dropFileNameString := dropFileName asString. |
|
4976 |
dropFileName isDirectory ifTrue:[ |
|
4977 |
filenameDirString := aDirectory asString. |
|
4978 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4979 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4980 |
^ false |
|
4414 | 4981 |
] |
6284 | 4982 |
] ifFalse:[ |
4983 |
physicalPathName := dropFileName physicalPathName. |
|
4984 |
(aDirectory = dropFileName directory |
|
4985 |
or:[ aDropObject isFileInArchive not |
|
4986 |
and:[physicalPathName notNil |
|
4987 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4988 |
self notify:'Cannot drop a file into same directory'. |
|
4989 |
^ false |
|
4990 |
] |
|
4991 |
]. |
|
4992 |
^ true. |
|
3892 | 4993 |
! |
4994 |
||
7406 | 4995 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
17865 | 4996 |
^ aCollectionOfDropObjects contains:#isFileObject |
7406 | 4997 |
|
4998 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4999 |
! |
|
5000 |
||
17202 | 5001 |
doStartDrag:arg1 in:arg2 |
5002 |
^ self class doStartDrag:arg1 in:arg2 |
|
6479 | 5003 |
! |
5004 |
||
7408 | 5005 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 5006 |
|fileEntryFieldHolder destDir dropObject fn d| |
5007 |
||
5008 |
fileEntryFieldHolder := self masterApplication notNil |
|
5009 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
5010 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
5011 |
||
5012 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5013 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5014 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5015 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5016 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5017 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5018 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5019 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5020 |
]. |
7990 | 5021 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5022 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5023 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
5024 |
]. |
6479 | 5025 |
|
5026 |
destDir := self currentDirectory. |
|
5027 |
destDir isNil ifTrue:[^ self]. |
|
5028 |
||
8601 | 5029 |
self withWaitCursorDo:[ |
5030 |
aCollectionOfDropObjects do:[:dropObject | |
|
5031 |
|fn| |
|
5032 |
||
5033 |
dropObject isFileObject ifTrue:[ |
|
5034 |
fn := dropObject theObject asFilename. |
|
5035 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
5036 |
fn recursiveCopyTo:destDir |
8601 | 5037 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
5038 |
fn copyTo:(destDir / fn baseName ) |
8601 | 5039 |
] |
6479 | 5040 |
] |
8601 | 5041 |
]. |
5042 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5043 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5044 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5045 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5046 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
5047 |
]. |
7408 | 5048 |
|
5049 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 5050 |
! ! |
5051 |
||
5052 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
5053 |
||
5054 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 5055 |
"copy to" |
5056 |
||
7635 | 5057 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
5058 |
||
5059 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
5060 |
! |
|
5061 |
||
5062 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
5063 |
"copy to" |
|
5064 |
||
5065 |
|copyOperation msg| |
|
5066 |
||
5067 |
repairCorruptedFiles ifTrue:[ |
|
5068 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
5069 |
] ifFalse:[ |
|
5070 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
5071 |
]. |
|
5072 |
copyOperation result ifTrue:[ |
|
6190 | 5073 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 5074 |
] ifFalse:[ |
7635 | 5075 |
msg := copyOperation errorString. |
6190 | 5076 |
]. |
5077 |
self notify:msg. |
|
7635 | 5078 |
^ copyOperation result |
5079 |
||
5080 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 5081 |
! |
5082 |
||
5083 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 5084 |
|copy result| |
3892 | 5085 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5086 |
self withActivityIndicationDo:[ |
5961 | 5087 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 5088 |
copy result ifTrue:[ |
5089 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
5090 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5091 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5092 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5093 |
self updateCurrentDirectory. |
3892 | 5094 |
]. |
6374 | 5095 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5096 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5097 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 5098 |
! |
5099 |
||
15569 | 5100 |
copyFromToRepairingCorruptedFiles |
5101 |
"ask for source and destination and copy the entered file. |
|
5102 |
Especially useful for raw devices to copy corrupted disks/files |
|
5103 |
" |
|
5104 |
||
5105 |
|source destination| |
|
5106 |
||
5107 |
source := Dialog |
|
5108 |
requestDirectoryName:(resources string:'Copy from:') |
|
5109 |
default:(LastMoveDestination ? self currentDirectory) |
|
5110 |
ok:(resources string:'Continue') |
|
5111 |
abort:nil. |
|
5112 |
||
5113 |
source isEmptyOrNil ifTrue:[^ self]. |
|
5114 |
source := source asFilename. |
|
5115 |
||
5116 |
destination := Dialog |
|
5117 |
requestDirectoryName:(resources string:'Copy "%1" to:' with:source) |
|
5118 |
default:(LastMoveDestination ? self currentDirectory) |
|
5119 |
ok:(resources string:'Copy') |
|
5120 |
abort:nil. |
|
5121 |
||
5122 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
5123 |
destination := destination asFilename. |
|
5124 |
||
5125 |
self copyFile:source to:destination repairCorruptedFiles:true. |
|
5126 |
! |
|
5127 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5128 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
12850 | 5129 |
|size msg answer file| |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5130 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5131 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5132 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5133 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5134 |
"/ 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
|
5135 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5136 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5137 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5138 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5139 |
"/ 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
|
5140 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5141 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5142 |
"/ 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
|
5143 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5144 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5145 |
"/ 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
|
5146 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5147 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5148 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5149 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5150 |
stringWithCRs:'Copy or move\\%1:\ %2\to:\ %3 ?' |
17762 | 5151 |
with:(resources string: |
5152 |
(file type == #regular |
|
5153 |
ifTrue:'file' |
|
5154 |
ifFalse:[ |
|
5155 |
file isDirectory |
|
5156 |
ifTrue:'directory' |
|
5157 |
ifFalse:'object'])) |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5158 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5159 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5160 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5161 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5162 |
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
|
5163 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5164 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 5165 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5166 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5167 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5168 |
request:msg |
8127 | 5169 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
5170 |
image:(WarningBox iconBitmap) |
8127 | 5171 |
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
|
5172 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5173 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5174 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5175 |
^ answer. |
17762 | 5176 |
|
5177 |
"Modified: / 17-11-2017 / 13:16:42 / cg" |
|
3892 | 5178 |
! |
5179 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5180 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 5181 |
"copy or move aColOfSourceFiles to aDirectory. |
5182 |
Asks the used if a move or a copy is wanted. |
|
5183 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
5184 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5185 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5186 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5187 |
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
|
5188 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5189 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5190 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5191 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5192 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5193 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5194 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5195 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5196 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5197 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5198 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5199 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 5200 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5201 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5202 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5203 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5204 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5205 |
|
4745 | 5206 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5207 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5208 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5209 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 5210 |
^ true. |
3892 | 5211 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
5212 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
5213 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 5214 |
^ true. |
3892 | 5215 |
]. |
4745 | 5216 |
^ false. |
3892 | 5217 |
! |
5218 |
||
6107 | 5219 |
copySelectionTo |
5220 |
"copy the selected file(s) to another directory" |
|
5221 |
||
13704 | 5222 |
self copySelectionToRepairingCorruptedFiles:false. |
5223 |
self updateCurrentDirectoryWithReread. |
|
7635 | 5224 |
|
5225 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
5226 |
! |
|
5227 |
||
5228 |
copySelectionToRepairingCorruptedFiles |
|
5229 |
"copy the selected file(s) to another directory" |
|
5230 |
||
13704 | 5231 |
self copySelectionToRepairingCorruptedFiles:true. |
5232 |
self updateCurrentDirectoryWithReread. |
|
7635 | 5233 |
|
5234 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
5235 |
! |
|
5236 |
||
5237 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
5238 |
"copy the selected file(s) to another directory" |
|
5239 |
||
6299 | 5240 |
|selectedFiles msg destination directory| |
5241 |
||
7560 | 5242 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 5243 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
5244 |
||
5245 |
msg := (selectedFiles size > 1) |
|
14588 | 5246 |
ifTrue:[ 'Copy Selected Items to Directory:' ] |
5247 |
ifFalse:[ 'Copy "%1" to Directory:' ]. |
|
6299 | 5248 |
|
5249 |
destination := Dialog |
|
14588 | 5250 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first baseName) |
7635 | 5251 |
default:(LastMoveDestination ? self currentDirectory) |
5252 |
ok:(resources string:'Copy') |
|
5253 |
abort:nil. |
|
5254 |
||
6299 | 5255 |
destination isEmptyOrNil ifTrue:[^ self]. |
5256 |
destination := destination asFilename. |
|
5257 |
||
5258 |
destination isDirectory ifFalse:[ |
|
5259 |
selectedFiles size == 1 ifTrue:[ |
|
5260 |
directory := destination directory. |
|
5261 |
directory isDirectory ifTrue:[ |
|
5262 |
LastMoveDestination := directory. |
|
7635 | 5263 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 5264 |
^ self. |
5265 |
] |
|
5266 |
] |
|
5267 |
]. |
|
5268 |
||
5269 |
LastMoveDestination := destination. |
|
7635 | 5270 |
repairingCorruptedFiles ifTrue:[ |
5271 |
selectedFiles do:[:eachFile | |
|
5272 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
5273 |
]. |
|
5274 |
^ self. |
|
5275 |
] ifFalse:[ |
|
5276 |
self copyFiles:selectedFiles to:destination |
|
5277 |
] |
|
5278 |
||
5279 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 5280 |
! |
5281 |
||
3892 | 5282 |
deleteFile:aFile |
6373 | 5283 |
"delete the selected files/directories" |
3892 | 5284 |
|
5285 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
5286 |
! |
|
5287 |
||
5288 |
deleteFiles:colOfFiles |
|
6373 | 5289 |
"delete some files/directories" |
5290 |
||
5081 | 5291 |
^ self deleteFiles:colOfFiles confirm:true. |
5292 |
! |
|
5293 |
||
5294 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 5295 |
"delete some files/directories" |
5296 |
||
5673 | 5297 |
|delete result| |
3892 | 5298 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5299 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5300 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5301 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5302 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5303 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5304 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5305 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5306 |
]. |
5673 | 5307 |
result notNil ifTrue:[ |
5308 |
result ifFalse:[ |
|
5309 |
self notify:delete errorString. |
|
5753 | 5310 |
] ifTrue:[ |
5311 |
self updateListAfterDelete:colOfFiles. |
|
5312 |
] |
|
4394 | 5313 |
]. |
5673 | 5314 |
]. |
5315 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5316 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
5317 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 5318 |
! |
5319 |
||
6169 | 5320 |
eraseFiles:colOfFiles |
6373 | 5321 |
"erase (clear and delete) some files/directories" |
5322 |
||
6169 | 5323 |
^ self eraseFiles:colOfFiles confirm:true. |
5324 |
! |
|
5325 |
||
5326 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 5327 |
"erase (clear and delete) some files/directories" |
5328 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5329 |
|deleteOperation result fileSize| |
6169 | 5330 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5331 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5332 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 5333 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
5334 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 5335 |
ifTrue:[ |
5336 |
result := deleteOperation result. |
|
5337 |
] ifFalse:[ |
|
5338 |
ProgressIndicator |
|
5339 |
displayProgressNotifications:'Erasing' |
|
5340 |
abortable:true |
|
5341 |
at:nil |
|
5342 |
during:[ |
|
5343 |
result := deleteOperation result. |
|
5344 |
]. |
|
5345 |
]. |
|
5346 |
||
6169 | 5347 |
result notNil ifTrue:[ |
5348 |
result ifFalse:[ |
|
8294 | 5349 |
self notify:deleteOperation errorString. |
6169 | 5350 |
] ifTrue:[ |
5351 |
self updateListAfterDelete:colOfFiles. |
|
5352 |
] |
|
5353 |
]. |
|
5354 |
]. |
|
5355 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5356 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5357 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 5358 |
! |
5359 |
||
3892 | 5360 |
moveFile:aSourceFile to:aDestFile |
6373 | 5361 |
"move a file/directory" |
3892 | 5362 |
|
5363 |
|move| |
|
5364 |
||
5961 | 5365 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 5366 |
move result ifTrue:[ |
15346 | 5367 |
self notify:(resources string: 'move "%1" to "%2"' with:aSourceFile asString with:aDestFile asString). |
3892 | 5368 |
] ifFalse:[ |
4523 | 5369 |
self notify:move errorString. |
3892 | 5370 |
]. |
17871 | 5371 |
self updateCurrentDirectoryWithReread. |
3892 | 5372 |
^ move result |
5373 |
! |
|
5374 |
||
5375 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 5376 |
"move some files to aDirectory" |
5377 |
||
3892 | 5378 |
|move| |
5379 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5380 |
self withActivityIndicationDo:[ |
5961 | 5381 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5382 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5383 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
5384 |
]. |
17871 | 5385 |
self updateCurrentDirectoryWithReread. |
3892 | 5386 |
]. |
6373 | 5387 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5388 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
5389 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 5390 |
! |
5391 |
||
6107 | 5392 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5393 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5394 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5395 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5396 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5397 |
destinationDirectory := Dialog |
14588 | 5398 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items to Directory:') |
5789 | 5399 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 5400 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5401 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5402 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5403 |
|
5789 | 5404 |
LastMoveDestination := destinationDirectory. |
13704 | 5405 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename. |
5406 |
self updateCurrentDirectoryWithReread. |
|
5407 |
||
7560 | 5408 |
|
5409 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5410 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5411 |
|
3892 | 5412 |
newDirectory |
5413 |
"ask for and create a new directory" |
|
5414 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5415 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5416 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5417 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5418 |
directory isNil ifTrue:[ |
18175 | 5419 |
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
|
5420 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5421 |
]. |
4521 | 5422 |
|
5423 |
"/ 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
|
5424 |
selectedFiles := self currentSelectedFiles. |
4521 | 5425 |
selectedFiles size == 1 ifTrue:[ |
5426 |
singleSelectedFile := selectedFiles first. |
|
5427 |
||
5428 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
13714 | 5429 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5430 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
5431 |
||
5432 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
13714 | 5433 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5434 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
5435 |
]. |
|
5436 |
]. |
|
5437 |
]. |
|
5438 |
||
5961 | 5439 |
|
4521 | 5440 |
defaultAnswer notNil ifTrue:[ |
5961 | 5441 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 5442 |
] ifFalse:[ |
5961 | 5443 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 5444 |
]. |
5445 |
createOp result ifFalse:[ ^ self]. |
|
5446 |
newFile := createOp createdFile. |
|
3892 | 5447 |
newFile notNil ifTrue:[ |
17871 | 5448 |
self updateCurrentDirectoryWithReread. |
3892 | 5449 |
] |
17818 | 5450 |
|
5451 |
"Modified: / 29-11-2017 / 12:26:41 / cg" |
|
18175 | 5452 |
"Modified: / 01-06-2018 / 12:49:43 / Claus Gittinger" |
3892 | 5453 |
! |
5454 |
||
5455 |
newFile |
|
5456 |
"ask for and create a new file" |
|
5457 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5458 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5459 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5460 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5461 |
directory isNil ifTrue:[ |
18175 | 5462 |
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
|
5463 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5464 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5465 |
|
3982 | 5466 |
curFile := self firstSelectedFile. |
3892 | 5467 |
curFile notNil ifTrue:[ |
4414 | 5468 |
file := curFile. |
3892 | 5469 |
] ifFalse:[ |
4414 | 5470 |
file := directory. |
3892 | 5471 |
]. |
5961 | 5472 |
create := FileOperation createFileIn:file. |
3892 | 5473 |
create result ifFalse:[ ^ self]. |
5474 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
17818 | 5475 |
|
5476 |
"Modified: / 29-11-2017 / 12:26:51 / cg" |
|
18175 | 5477 |
"Modified: / 01-06-2018 / 12:49:50 / Claus Gittinger" |
3892 | 5478 |
! |
5479 |
||
5480 |
newHardLink |
|
5481 |
"ask for and create a hard link (unix only)" |
|
5482 |
||
6151 | 5483 |
self newLink:#hard. |
5484 |
! |
|
5485 |
||
5486 |
newLink:typeOfLink |
|
3892 | 5487 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
5488 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5489 |
| sel dir create createdFile| |
3892 | 5490 |
|
7560 | 5491 |
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
|
5492 |
(sel size ~= 1) ifTrue:[ |
18175 | 5493 |
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
|
5494 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5495 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5496 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5497 |
|
6151 | 5498 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 5499 |
create result ifFalse:[ ^ self]. |
5500 |
createdFile := create createdFile. |
|
5501 |
createdFile notNil ifTrue:[ |
|
6151 | 5502 |
typeOfLink == #soft ifTrue:[ |
17871 | 5503 |
self updateCurrentDirectoryWithReread. |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5504 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5505 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5506 |
] |
3892 | 5507 |
]. |
7560 | 5508 |
|
17818 | 5509 |
"Modified: / 29-11-2017 / 12:26:58 / cg" |
18175 | 5510 |
"Modified: / 01-06-2018 / 12:49:32 / Claus Gittinger" |
3892 | 5511 |
! |
5512 |
||
5513 |
newSoftLink |
|
5514 |
"ask for and create a soft link (unix only)" |
|
5515 |
||
6151 | 5516 |
self newLink:#soft. |
3892 | 5517 |
! |
5518 |
||
5519 |
pasteFiles |
|
6373 | 5520 |
"paste from clipBoard" |
5521 |
||
5522 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 5523 |
|
5524 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
5525 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 5526 |
|
5527 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
5528 |
||
3892 | 5529 |
buffer := self clipboard copy. |
3982 | 5530 |
directories := self currentSelectedDirectories. |
5880 | 5531 |
directories size ~~ 1 ifTrue:[ |
4414 | 5532 |
|box dirStringCol| |
5880 | 5533 |
|
4414 | 5534 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
5535 |
box := ListSelectionBox new. |
|
6373 | 5536 |
box title:'Paste into which directory ?'. |
4414 | 5537 |
box list:dirStringCol. |
5538 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5539 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5540 |
box destroy. |
3892 | 5541 |
] ifFalse:[ |
5880 | 5542 |
destination := directories anElement. |
3892 | 5543 |
]. |
6373 | 5544 |
|
5545 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 5546 |
buffer files copy do:[:aFile| |
5547 |
aFile directory = destination ifTrue:[ |
|
5548 |
buffer files remove:aFile. |
|
5549 |
]. |
|
5550 |
]. |
|
5551 |
]. |
|
5552 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 5553 |
copiedFiles notEmptyOrNil ifTrue:[ |
5554 |
thisIsAFileMoveOperation ifTrue:[ |
|
5555 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
5556 |
]. |
|
5557 |
||
5558 |
"/ select those pasted files. |
|
5559 |
self updateCurrentDirectory:true. |
|
5560 |
self currentFileNameHolder value:copiedFiles values. |
|
5561 |
] |
|
3892 | 5562 |
! |
5563 |
||
5564 |
renameFile:aFile |
|
5565 |
"rename the selected file(s)" |
|
5566 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5567 |
^ self renameFiles:(Array with:aFile). |
3892 | 5568 |
! |
5569 |
||
4230 | 5570 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 5571 |
"rename filename to newFileString" |
5572 |
||
5573 |
|rename| |
|
5574 |
||
5961 | 5575 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 5576 |
rename result ifTrue:[ |
4230 | 5577 |
aBoolean ifTrue:[ |
5578 |
self updateAndSelect:(rename renamedFiles). |
|
5579 |
]. |
|
3892 | 5580 |
] ifFalse:[ |
4523 | 5581 |
self notify:rename errorString. |
3892 | 5582 |
]. |
5583 |
^ rename result |
|
5584 |
! |
|
5585 |
||
5586 |
renameFiles:aColOfFiles |
|
6373 | 5587 |
"rename some file(s)" |
3892 | 5588 |
|
5589 |
|rename| |
|
5590 |
||
5961 | 5591 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 5592 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5593 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5594 |
^ nil. |
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 |
^ rename |
3892 | 5597 |
! |
5598 |
||
5599 |
renameSelection |
|
5600 |
"rename the selected file(s)" |
|
5601 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5602 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5603 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5604 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5605 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5606 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5607 |
]. |
7560 | 5608 |
|
5609 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5610 |
! ! |
5611 |
||
4080 | 5612 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5613 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5614 |
bookmarksMenu |
3952 | 5615 |
<resource: #programMenu> |
5616 |
||
14941 | 5617 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec. |
5618 |
! |
|
5619 |
||
5620 |
bookmarksMenuForBaseSpec:aBaseMenuSpec |
|
5621 |
<resource: #programMenu> |
|
5622 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5623 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5624 |
|
14941 | 5625 |
menu := aBaseMenuSpec decodeAsLiteralArray. |
7763 | 5626 |
|
5627 |
"/ add the bookmark items ... |
|
5628 |
bookmarks := self class directoryBookmarks. |
|
5629 |
bookmarks notEmptyOrNil ifTrue:[ |
|
14604 | 5630 |
menu addSeparator. |
7763 | 5631 |
bookmarks do:[:dirName | |
12963 | 5632 |
menu addItem:(MenuItem |
5633 |
label:dirName asString |
|
5634 |
itemValue:[ |
|
5635 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5636 |
self setCurrentFileName:dirName. |
|
5637 |
]. |
|
5638 |
]). |
|
7763 | 5639 |
]. |
5640 |
]. |
|
4080 | 5641 |
menu findGuiResourcesIn:self. |
7763 | 5642 |
^ menu |
5643 |
||
11135 | 5644 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5645 |
! |
5646 |
||
5647 |
canBackward |
|
5648 |
^ self directoryHistory canBackward. |
|
5649 |
||
5650 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5651 |
! |
|
5652 |
||
5653 |
canForward |
|
5654 |
^ self directoryHistory canForward. |
|
5655 |
||
5656 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5657 |
! |
|
5658 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5659 |
gotoBookmarksMenu |
7763 | 5660 |
<resource: #programMenu> |
5661 |
||
14941 | 5662 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec2. |
6099 | 5663 |
! |
5664 |
||
3892 | 5665 |
menuDirHistory:backOrForward |
7763 | 5666 |
"initialize the history menu" |
5667 |
||
3892 | 5668 |
<resource: #programMenu > |
5669 |
||
7763 | 5670 |
|hist menu pathList currentSel currentPath| |
5671 |
||
5672 |
hist := self directoryHistory. |
|
5673 |
hist isEmpty ifTrue:[^ nil]. |
|
5674 |
||
3892 | 5675 |
backOrForward == #back ifTrue:[ |
6725 | 5676 |
currentSel := self currentSelectedDirectories. |
4347 | 5677 |
currentSel size == 1 ifTrue:[ |
5678 |
currentPath := currentSel first asString. |
|
5679 |
] ifFalse:[ |
|
5680 |
currentPath := nil. |
|
5681 |
]. |
|
7763 | 5682 |
pathList := hist getBackCollection. |
3892 | 5683 |
] ifFalse:[ |
7763 | 5684 |
pathList := hist getForwardCollection. |
3892 | 5685 |
]. |
4022 | 5686 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5687 |
|
6370 | 5688 |
pathList size > 30 ifTrue:[ |
5689 |
pathList := pathList copyTo:30 |
|
5690 |
]. |
|
7763 | 5691 |
|
5692 |
menu := Menu new. |
|
5693 |
||
3964 | 5694 |
pathList do:[:aPath| |
14593 | 5695 |
menu addItem:(MenuItem |
5696 |
label:aPath |
|
5697 |
itemValue:[ self setCurrentFileName:(aPath asFilename) ] |
|
5698 |
translateLabel:false). |
|
3952 | 5699 |
]. |
7763 | 5700 |
menu findGuiResourcesIn:self. |
3892 | 5701 |
^ menu |
7763 | 5702 |
|
11783 | 5703 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5704 |
! |
5705 |
||
5706 |
menuDirHistoryBack |
|
5707 |
"initialize the directory menu |
|
5708 |
" |
|
5709 |
<resource: #programMenu > |
|
5710 |
||
5711 |
^ self menuDirHistory:#back. |
|
5712 |
! |
|
5713 |
||
5714 |
menuDirHistoryForward |
|
5715 |
"initialize the directory menu |
|
5716 |
" |
|
5717 |
<resource: #programMenu > |
|
5718 |
||
5719 |
^ self menuDirHistory:#forward. |
|
3906 | 5720 |
! |
5721 |
||
5722 |
menuFileHistory |
|
5723 |
"initialize the file history menu |
|
5724 |
" |
|
5725 |
<resource: #programMenu > |
|
5726 |
||
7763 | 5727 |
|menu hist text removeItem| |
3906 | 5728 |
|
5729 |
hist := self fileHistory. |
|
5730 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5731 |
|
7763 | 5732 |
menu := Menu new. |
5733 |
||
5734 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5735 |
aFileItem fileName exists ifTrue:[ |
12963 | 5736 |
menu addItem:(MenuItem |
5737 |
label: aFileItem fileName asString |
|
14593 | 5738 |
itemValue: |
5739 |
[ |
|
5740 |
self setCurrentFileName:(aFileItem fileName). |
|
5741 |
self openApplByFileItem:aFileItem |
|
5742 |
] |
|
5743 |
translateLabel:false). |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5744 |
] ifFalse:[ |
7763 | 5745 |
"/ remove all not existing history entries |
5746 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5747 |
] |
3906 | 5748 |
]. |
7763 | 5749 |
menu addSeparator. |
5750 |
||
4080 | 5751 |
removeItem := MenuItem new. |
5752 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5753 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5754 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5755 |
removeItem label:text. |
11783 | 5756 |
removeItem |
5757 |
itemValue:[ |
|
5758 |
self fileHistory removeAll. |
|
5759 |
self enableFileHistory value:false. |
|
5760 |
]. |
|
3906 | 5761 |
menu addItem:removeItem. |
7763 | 5762 |
menu findGuiResourcesIn:self. |
3906 | 5763 |
^ menu |
7763 | 5764 |
|
11783 | 5765 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5766 |
! |
5767 |
||
4080 | 5768 |
sortMenu |
5769 |
<resource: #programMenu > |
|
5770 |
||
5771 |
|menu| |
|
5772 |
||
7763 | 5773 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5774 |
menu findGuiResourcesIn:self. |
5775 |
^ menu |
|
7763 | 5776 |
|
5777 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5778 |
! |
5779 |
||
5780 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5781 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5782 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5783 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5784 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5785 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5786 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5787 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5788 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5789 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5790 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5791 |
^ spec |
4080 | 5792 |
! |
5793 |
||
5794 |
viewInContentsBrowserMenu |
|
5009 | 5795 |
self |
5796 |
applicationNamed:#DirectoryContentsBrowser |
|
5797 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5798 |
||
5799 |
^ nil. |
|
4080 | 5800 |
! |
5801 |
||
3952 | 5802 |
visitedDirectoriesMenu |
5803 |
<resource: #programMenu > |
|
5804 |
||
5805 |
|menu histCopy text removeItem| |
|
5806 |
||
7763 | 5807 |
histCopy := self directoryHistory. |
5808 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5809 |
||
3952 | 5810 |
menu := Menu new. |
7763 | 5811 |
|
5812 |
histCopy do:[:aFile| |
|
12963 | 5813 |
menu addItem:(MenuItem |
5814 |
label:aFile asString |
|
5815 |
itemValue:[ |
|
5816 |
self setCurrentFileName:(aFile path asFilename). |
|
5817 |
]). |
|
7763 | 5818 |
]. |
5819 |
menu addSeparator. |
|
5820 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5821 |
"/ 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
|
5822 |
text := (resources string:'Clear History'). |
3952 | 5823 |
removeItem := MenuItem new. |
4040 | 5824 |
removeItem translateLabel:true. |
3952 | 5825 |
removeItem label:text. |
11783 | 5826 |
removeItem |
5827 |
itemValue:[ |
|
5828 |
self directoryHistory removeAll. |
|
5829 |
self enableForward value:self canForward. |
|
5830 |
self enableBack value:self canBackward. |
|
5831 |
]. |
|
7763 | 5832 |
|
3952 | 5833 |
menu addItem:removeItem. |
7763 | 5834 |
menu findGuiResourcesIn:self. |
3952 | 5835 |
^ menu |
7763 | 5836 |
|
11783 | 5837 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5838 |
! ! |
5839 |
||
5880 | 5840 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5841 |
||
5842 |
doCompareTwoFiles |
|
5843 |
self openDiffView. |
|
5844 |
! |
|
5845 |
||
5846 |
doGoDirectoryUp |
|
5960 | 5847 |
| upDir directory rootInTreeView| |
5880 | 5848 |
|
5849 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5850 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5851 |
directory := self currentDirectory. |
5852 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5853 |
] ifFalse:[ |
5854 |
rootInTreeView := self |
|
5855 |
applicationNamed:#DirectoryTreeBrowser |
|
5856 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5857 |
directory := rootInTreeView value asFilename. |
5858 |
]. |
|
5859 |
upDir := directory directory. |
|
5959 | 5860 |
self setCurrentFileName:upDir. |
5880 | 5861 |
! |
5862 |
||
5863 |
doGotoDefaultDirectory |
|
5864 |
self gotoFile:(Filename defaultDirectory). |
|
5865 |
! |
|
5866 |
||
8091 | 5867 |
doGotoDesktopDirectory |
5868 |
self gotoFile:(Filename desktopDirectory). |
|
5869 |
! |
|
5870 |
||
18036 | 5871 |
doGotoDocumentsDirectory |
5872 |
self gotoFile:(Filename documentsDirectory). |
|
5873 |
! |
|
5874 |
||
5875 |
doGotoDownloadsDirectory |
|
5876 |
self gotoFile:(Filename downloadsDirectory). |
|
5877 |
! |
|
5878 |
||
5880 | 5879 |
doGotoHomeDirectory |
8091 | 5880 |
self gotoFile:(Filename homeDirectory). |
5880 | 5881 |
! |
5882 |
||
6434 | 5883 |
doGotoSmalltalkDirectory |
5884 |
self gotoFile:(self smalltalkDirectory). |
|
5885 |
! |
|
5886 |
||
17187 | 5887 |
doGotoSmalltalkWorkspaceDirectory |
5888 |
self gotoFile:(UserPreferences current workspaceDirectory). |
|
5889 |
! |
|
5890 |
||
9677 | 5891 |
doGotoTempDirectory |
5892 |
self gotoFile:(self tempDirectory). |
|
5893 |
||
5894 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5895 |
! |
|
5896 |
||
9596 | 5897 |
doMakeCurrentDirectory |
17582 | 5898 |
<resource: #obsolete> |
5899 |
||
5900 |
"/ no longer |
|
5901 |
^ self |
|
5902 |
"/ OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5903 |
"/ self currentFileNameHolderChangedForCommon. |
|
9596 | 5904 |
|
5905 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
17582 | 5906 |
"Modified (format): / 17-07-2017 / 10:09:39 / cg" |
9596 | 5907 |
! |
5908 |
||
5880 | 5909 |
fileGetInfo:longInfo |
5910 |
"get info on selected file - show it in a box" |
|
5911 |
||
5912 |
|string box updater| |
|
5913 |
||
5914 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5915 |
string notNil ifTrue:[ |
|
5916 |
box := InfoBox title:string. |
|
5917 |
updater := [ |
|
5918 |
[true] whileTrue:[ |
|
5919 |
Delay waitForSeconds:2. |
|
5920 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5921 |
string isNil ifTrue:[ ^ self]. |
|
5922 |
box title:string |
|
5923 |
] |
|
5924 |
] fork. |
|
5925 |
box show. |
|
5926 |
updater terminate. |
|
5927 |
box destroy |
|
5928 |
] |
|
6434 | 5929 |
! |
5930 |
||
17686 | 5931 |
showDeltaBetweenTwoImageFiles |
5932 |
|i1 i2 delta| |
|
5933 |
||
5934 |
i1 := Image fromFile:(self selectedFileNames first). |
|
5935 |
i2 := Image fromFile:(self selectedFileNames second). |
|
5936 |
delta := ImageAlgorithms new differenceImageBetween:i1 and:i2. |
|
5937 |
ImageView openOn:delta. |
|
5938 |
||
5939 |
"Created: / 10-09-2017 / 16:59:08 / cg" |
|
5940 |
! |
|
5941 |
||
6434 | 5942 |
smalltalkDirectory |
8590 | 5943 |
|stxPath| |
6434 | 5944 |
|
5945 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5946 |
stxPath isNil ifTrue:[ |
5947 |
^ Filename currentDirectory |
|
5948 |
]. |
|
5949 |
^ stxPath asFilename directory. |
|
9677 | 5950 |
! |
5951 |
||
5952 |
tempDirectory |
|
5953 |
^ Filename tempDirectory. |
|
5954 |
||
5955 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5956 |
! ! |
5957 |
||
11139 | 5958 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5959 |
||
14262 | 5960 |
addDirToJavaSourcePath |
5961 |
"add the current path to java's sourcePath |
|
5962 |
(only available with ST/J System" |
|
5963 |
||
5964 |
Java addToSourcePath:self currentDirectory pathName |
|
5965 |
||
5966 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5967 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
5968 |
! |
|
5969 |
||
11139 | 5970 |
copyFiles |
5971 |
self |
|
5972 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5973 |
! |
|
5974 |
||
5975 |
cutFiles |
|
5976 |
self |
|
5977 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5978 |
! |
|
5979 |
||
5980 |
deleteFiles |
|
5981 |
self |
|
5982 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5983 |
! |
|
5984 |
||
5985 |
eraseFiles |
|
5986 |
self |
|
5987 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
5988 |
! |
|
5989 |
||
14262 | 5990 |
fileAddToJavaSourcePath |
5991 |
"add the current path to java's sourcePath |
|
5992 |
(only available with ST/J System" |
|
5993 |
||
17865 | 5994 |
Java notNil ifTrue:[ |
5995 |
self currentSelectedObjects do:[:each | |
|
5996 |
Java addToSourcePath:(each pathName) |
|
5997 |
]. |
|
14262 | 5998 |
]. |
5999 |
||
6000 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
6001 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
6002 |
! |
|
6003 |
||
11139 | 6004 |
openSettingsDialog |
6005 |
|dialog| |
|
6006 |
||
6007 |
dialog := FileBrowserV2SettingsDialog new. |
|
6008 |
dialog settingsDialog:self. |
|
6009 |
dialog allButOpen. |
|
6010 |
dialog doReload. |
|
6011 |
dialog openWindow |
|
6012 |
! |
|
6013 |
||
6014 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
6015 |
|files dirs| |
|
6016 |
||
6017 |
files := self currentSelectedFiles. |
|
6018 |
files notEmpty ifTrue:[ |
|
6019 |
aBlock value:files. |
|
6020 |
] ifFalse:[ |
|
6021 |
dirs := self currentSelectedDirectories. |
|
6022 |
dirs notEmpty ifTrue:[ |
|
6023 |
aBlock value:dirs. |
|
6024 |
]. |
|
6025 |
]. |
|
6026 |
! ! |
|
6027 |
||
6028 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
6029 |
||
6030 |
openAboutThisApplication |
|
6031 |
"opens an about box for this application." |
|
6032 |
||
6033 |
Dialog aboutClass:self class. |
|
6034 |
! |
|
6035 |
||
6036 |
openHTMLDocument:relativeDocPath |
|
6037 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
6038 |
! ! |
|
6039 |
||
6040 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 6041 |
|
15905 | 6042 |
canCvsAddAndCommit |
6043 |
||
6044 |
|selectedFiles| |
|
6045 |
||
6046 |
selectedFiles := self currentSelectedObjects. |
|
6047 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
6048 |
! |
|
6049 |
||
6050 |
canRemoveCVSContainer |
|
6051 |
^ self currentSelectedFiles |
|
6052 |
contains:[:fileName| |
|
6053 |
|dirOfFile cvsDir| |
|
6054 |
||
6055 |
dirOfFile := self getDirWithoutFileName:fileName. |
|
6056 |
cvsDir := dirOfFile construct:'CVS'. |
|
6057 |
cvsDir isDirectory |
|
6058 |
]. |
|
6059 |
! |
|
6060 |
||
12777 | 6061 |
commitFilesToCVS:files |
6062 |
|numFiles| |
|
6063 |
||
6064 |
(numFiles := files size) > 0 ifTrue:[ |
|
6065 |
self withActivityIndicationDo:[ |
|
6066 |
self cvsCommitFiles:files |
|
6067 |
] |
|
6068 |
] |
|
6069 |
! |
|
6070 |
||
3892 | 6071 |
cvsAddAndCommit |
4849 | 6072 |
self cvsAddAndCommitAsBinary:false |
6073 |
! |
|
6074 |
||
6075 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 6076 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 6077 |
|
6078 |
log := Dialog |
|
11139 | 6079 |
requestText:(resources string:'Enter initial log message:') |
4414 | 6080 |
lines:10 |
6081 |
columns:70 |
|
6082 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
6083 |
log isNil ifTrue:[^ self]. |
3892 | 6084 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6085 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6086 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6087 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6088 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6089 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6090 |
|
8588 | 6091 |
binArg := ''. |
6092 |
asBinary ifTrue:[ |
|
6093 |
binArg := '-kb '. |
|
6094 |
]. |
|
3982 | 6095 |
sel := self currentSelectedFiles. |
11139 | 6096 |
executionBlock := |
6097 |
[:stream | |
|
6098 |
log notNil ifTrue:[ |
|
17416 | 6099 |
sel notEmptyOrNil ifTrue:[ |
11139 | 6100 |
sel do:[:fn | |
6101 |
|nameArg| |
|
6102 |
||
6103 |
nameArg := '"',fn baseName,'"'. |
|
6104 |
||
6105 |
dir := self getDirWithoutFileName:fn. |
|
6106 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
6107 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6108 |
||
6109 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6110 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 6111 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
6112 |
"/ support and need the 'admin -kb' command. |
|
6113 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
6114 |
asBinary ifTrue:[ |
|
6115 |
cmd := ('cvs admin -kb ' , nameArg). |
|
6116 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6117 |
||
6118 |
cmd := ('cvs upd ' , nameArg). |
|
6119 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6120 |
]. |
|
6121 |
] |
|
6122 |
] |
|
6123 |
] |
|
6124 |
]. |
|
4107 | 6125 |
nameString := 'Command> cvs add and commit'. |
3892 | 6126 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 6127 |
|
17416 | 6128 |
"Modified: / 17-02-2017 / 08:25:16 / cg" |
3892 | 6129 |
! |
6130 |
||
4849 | 6131 |
cvsAddBinaryAndCommit |
6132 |
self cvsAddAndCommitAsBinary:true |
|
6133 |
! |
|
6134 |
||
3892 | 6135 |
cvsCommit |
12777 | 6136 |
|selectedFiles| |
3892 | 6137 |
|
3982 | 6138 |
selectedFiles:= self currentSelectedFiles. |
12777 | 6139 |
self cvsCommitFiles:selectedFiles |
6140 |
! |
|
6141 |
||
6142 |
cvsCommitFiles:files |
|
6143 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
6144 |
||
6145 |
nFiles := files size. |
|
6146 |
nFiles == 0 ifTrue:[^ self]. |
|
6147 |
||
6148 |
nFiles == 1 ifTrue:[ |
|
6149 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 6150 |
] ifFalse:[ |
12777 | 6151 |
nFiles > 1 ifTrue:[ |
6152 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 6153 |
] ifFalse:[ |
6627 | 6154 |
msg := resources string:'Enter log message for checkIn' |
4414 | 6155 |
] |
3892 | 6156 |
]. |
6157 |
||
6158 |
log := Dialog |
|
4414 | 6159 |
requestText:msg |
6160 |
lines:10 |
|
6161 |
columns:70 |
|
6162 |
initialAnswer:nil. |
|
3892 | 6163 |
|
4663 | 6164 |
log isNil ifTrue:[^ self]. |
12777 | 6165 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6166 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6167 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 6168 |
"/ save the log message into another tempFile ... |
13121 | 6169 |
s := FileStream newTemporary. |
6170 |
logTmp := s fileName. |
|
12777 | 6171 |
s nextPutAll:log. |
6172 |
s close. |
|
6173 |
||
6174 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6175 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6176 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6177 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
6178 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6179 |
executionBlock := [:stream | |
12777 | 6180 |
[ |
6181 |
files do:[:fn | |
|
6182 |
| dir nameArg cmd | |
|
6183 |
||
6184 |
nameArg := '"',fn baseName,'"'. |
|
6185 |
dir := fn directory. |
|
6186 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
6187 |
stream showCR:fn pathName. |
|
6188 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 6189 |
] |
12777 | 6190 |
] ensure:[ |
6191 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
6192 |
]. |
|
4107 | 6193 |
]. |
6194 |
nameString := 'Command> cvs commit'. |
|
6195 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 6196 |
! |
6197 |
||
14527 | 6198 |
cvsCommitFolder |
6199 |
|dir log logTmp s logArg msg executionBlock nameString | |
|
6200 |
||
6201 |
(dir := self currentDirectory) isNil ifTrue:[ ^ self ]. |
|
6202 |
||
6203 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(dir baseName). |
|
6204 |
log := Dialog |
|
6205 |
requestText:msg |
|
6206 |
lines:10 |
|
6207 |
columns:70 |
|
6208 |
initialAnswer:nil. |
|
6209 |
||
6210 |
log isNil ifTrue:[^ self]. |
|
6211 |
log := log replChar:$" withString:'\"'. |
|
6212 |
||
6213 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6214 |
"/ save the log message into another tempFile ... |
|
6215 |
s := FileStream newTemporary. |
|
6216 |
logTmp := s fileName. |
|
6217 |
s nextPutAll:log. |
|
6218 |
s close. |
|
6219 |
||
6220 |
logArg := '-F "', logTmp pathName, '"'. |
|
6221 |
] ifFalse:[ |
|
6222 |
logArg := '-m ''' , log , ''''. |
|
6223 |
]. |
|
6224 |
||
6225 |
executionBlock := [:stream | |
|
6226 |
[ |
|
6227 |
|cmd| |
|
6228 |
||
6229 |
cmd := 'cvs commit ',logArg. |
|
6230 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6231 |
] ensure:[ |
|
6232 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
6233 |
]. |
|
6234 |
]. |
|
6235 |
||
6236 |
nameString := 'Command> cvs commit'. |
|
6237 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6238 |
! |
|
6239 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6240 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6241 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6242 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6243 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6244 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6245 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6246 |
|
15589 | 6247 |
out := CharacterWriteStream new:100. |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6248 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6249 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6250 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6251 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6252 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6253 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6254 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6255 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
6256 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6257 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
6258 |
|
15211 | 6259 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
6260 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
6261 |
||
6262 |
|toRemove updateRunning executionBlock nameString| |
|
6263 |
||
6264 |
updateRunning := self backgroundProcesses value notEmpty. |
|
6265 |
self killAllRunningBackgroundProcesses. |
|
6266 |
toRemove := OrderedCollection new. |
|
6267 |
||
6268 |
executionBlock := |
|
6269 |
[:stream | |
|
6270 |
|cmd logArg prevDir prevFiles| |
|
6271 |
||
6272 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6273 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
6274 |
] ifFalse:[ |
|
6275 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
6276 |
]. |
|
6277 |
prevFiles := ''. |
|
6278 |
||
6279 |
filesToRemove do:[:fileName | |
|
6280 |
|dir file| |
|
6281 |
||
6282 |
dir := fileName directory. |
|
6283 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
6284 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
6285 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
6286 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6287 |
prevFiles := ''. |
|
6288 |
]. |
|
6289 |
||
17116 | 6290 |
OsError handle:[:ex| |
15211 | 6291 |
"was not able to remove it" |
6292 |
| lastError msg | |
|
6293 |
lastError := OperatingSystem lastErrorString. |
|
6294 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
6295 |
lastError isNil ifFalse:[ |
|
6296 |
msg := msg , '\\(' , lastError , ')' |
|
6297 |
]. |
|
6298 |
Dialog warn:msg withCRs |
|
6299 |
] do:[ |
|
6300 |
(fileName isSymbolicLink) ifFalse:[ |
|
6301 |
fileName remove. |
|
6302 |
file := fileName baseName. |
|
6303 |
cmd := ('cvs remove -f "',file,'"'). |
|
6304 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6305 |
"/ Transcript show:dir; space; showCR:cmd. |
|
6306 |
] |
|
6307 |
]. |
|
6308 |
prevDir := dir. |
|
6309 |
prevFiles := prevFiles,' ',file. |
|
6310 |
]. |
|
6311 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
6312 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
6313 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6314 |
]. |
|
6315 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
|
6316 |
filesToRemove size > 1 ifTrue:[ |
|
6317 |
nameString := nameString, ' ...'. |
|
6318 |
]. |
|
6319 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6320 |
! |
|
3892 | 6321 |
|
6322 |
cvsRemoveFileAndCVSContainer |
|
12493 | 6323 |
|files| |
6324 |
||
6325 |
files := self currentSelectedFiles copy. |
|
6326 |
self removeFilesAndCVSContainers:files |
|
3892 | 6327 |
! |
6328 |
||
9338 | 6329 |
cvsRevisionLog |
6330 |
| cmd sel executionBlock nameString| |
|
6331 |
||
6332 |
sel := self currentSelectedObjects. |
|
6333 |
sel isEmpty ifTrue:[ ^ self ]. |
|
6334 |
||
6335 |
executionBlock := [:stream | |
|
6336 |
sel do:[:fn | |
|
6337 |
| dir nameArg | |
|
6338 |
||
6339 |
nameArg := '"',fn baseName,'"'. |
|
6340 |
dir := fn directory. |
|
6341 |
cmd := 'cvs log ' , nameArg. |
|
6342 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
6343 |
] |
|
6344 |
]. |
|
6345 |
nameString := 'Command> cvs log'. |
|
6346 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
6347 |
! |
|
6348 |
||
8562 | 6349 |
cvsTagSelection |
12856 | 6350 |
|tag tags cmd| |
6351 |
||
6352 |
tag := Dialog |
|
6353 |
request:(resources string:'Tag (possibly multiple, separated by ";"):') |
|
6354 |
initialAnswer:(CVSSourceCodeManager recentTag). |
|
6355 |
tag isEmptyOrNil ifTrue:[^ self ]. |
|
6356 |
||
6357 |
CVSSourceCodeManager recentTag:tag. |
|
8562 | 6358 |
|
6359 |
CVSSourceCodeManager notNil ifTrue:[ |
|
6360 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
6361 |
] ifFalse:[ |
|
6362 |
cmd := 'cvs'. |
|
6363 |
]. |
|
6364 |
||
12856 | 6365 |
tags := tag asCollectionOfSubstringsSeparatedByAny:',;'. |
6366 |
tags do:[:eachTag | |
|
6367 |
self executeCommand:('%1 tag -F "%2" %3' |
|
6368 |
bindWith:cmd |
|
12858 | 6369 |
with:(eachTag withoutSeparators) |
12856 | 6370 |
with:(self makeFileNameArgumentString)) |
6371 |
]. |
|
8562 | 6372 |
! |
6373 |
||
3892 | 6374 |
cvsUpdateAll |
6375 |
| cmd | |
|
6376 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6377 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6378 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6379 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6380 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6381 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6382 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6383 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 6384 |
! |
6385 |
||
6386 |
cvsUpdateAllRecursive |
|
6387 |
| cmd | |
|
6388 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6389 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6390 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6391 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6392 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6393 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6394 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 6395 |
! |
6396 |
||
6397 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6398 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6399 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6400 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6401 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6402 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6403 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6404 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6405 |
|
15589 | 6406 |
stream := CharacterWriteStream new. |
8563 | 6407 |
stream |
6408 |
nextPutAll:cmd; |
|
6409 |
nextPutAll:' upd '; |
|
6410 |
nextPutAll:(self makeFileNameArgumentString). |
|
6411 |
||
6412 |
self executeCommand:stream contents. |
|
6413 |
! |
|
6414 |
||
6415 |
makeFileNameArgumentString |
|
6416 |
|stream| |
|
6417 |
||
15589 | 6418 |
stream := CharacterWriteStream new. |
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
6419 |
self currentSelectedFiles do:[: file | |
8563 | 6420 |
stream nextPut:$". |
4414 | 6421 |
stream nextPutAll:file baseName. |
8563 | 6422 |
stream nextPutAll:'" '. |
6423 |
]. |
|
6424 |
^ stream contents. |
|
12493 | 6425 |
! |
6426 |
||
6427 |
removeFilesAndCVSContainers:files |
|
6428 |
|numFiles question aswer| |
|
6429 |
||
6430 |
(numFiles := files size) > 0 ifTrue:[ |
|
6431 |
numFiles > 1 ifTrue:[ |
|
6432 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
6433 |
] ifFalse:[ |
|
6434 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
6435 |
]. |
|
6436 |
||
6437 |
aswer := Dialog |
|
6438 |
confirm:question withCRs |
|
6439 |
yesLabel:(resources string:'Remove') |
|
6440 |
noLabel:(resources string:'Cancel'). |
|
6441 |
||
6442 |
aswer ifTrue:[ |
|
6443 |
self withActivityIndicationDo:[ |
|
6444 |
self cvsRemoveAndRemoveFromCVS:files |
|
6445 |
] |
|
6446 |
] |
|
6447 |
] |
|
3892 | 6448 |
! ! |
6449 |
||
14126 | 6450 |
|
11139 | 6451 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
6452 |
||
6453 |
mercurialAdd |
|
6454 |
|executionBlock sel maxCmdSize| |
|
6455 |
||
6456 |
maxCmdSize := 512. |
|
6457 |
||
6458 |
sel := self currentSelectedObjects. |
|
6459 |
sel isEmptyOrNil ifTrue:[ |
|
6460 |
^ self |
|
6461 |
]. |
|
6462 |
||
6463 |
executionBlock := |
|
6464 |
[:stream | |
|
6465 |
|prevDir cmd| |
|
6466 |
||
6467 |
prevDir := nil. |
|
6468 |
sel do:[:fn | |
|
6469 |
|nameArg dir| |
|
6470 |
||
6471 |
nameArg := '"',fn baseName,'"'. |
|
6472 |
dir := fn directory. |
|
6473 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6474 |
"/ flush |
|
6475 |
cmd notNil ifTrue:[ |
|
6476 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6477 |
cmd := nil. |
|
6478 |
] |
|
6479 |
]. |
|
6480 |
cmd isNil ifTrue:[ |
|
6481 |
cmd := 'hg add'. |
|
6482 |
]. |
|
6483 |
cmd := cmd,' ',nameArg. |
|
6484 |
prevDir := dir. |
|
6485 |
]. |
|
6486 |
cmd notNil ifTrue:[ |
|
6487 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6488 |
cmd := nil. |
|
6489 |
]. |
|
6490 |
stream nextPutLine:'Commit to finish the transaction'. |
|
6491 |
]. |
|
6492 |
||
6493 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
6494 |
||
6495 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
6496 |
! |
|
6497 |
||
6498 |
mercurialCommit |
|
6499 |
|dir executionBlock| |
|
6500 |
||
6501 |
"/ dir := self currentDirectory. |
|
6502 |
dir := self directoryContentsBrowser directory. |
|
6503 |
executionBlock := |
|
6504 |
[:stream | |
|
6505 |
(self getExecutionBlockForCommand:'hg commit' |
|
6506 |
inDirectory:dir) value:stream. |
|
6507 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 6508 |
]. |
11139 | 6509 |
|
6510 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
6511 |
||
6512 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
6513 |
! |
|
6514 |
||
11144 | 6515 |
mercurialInit |
6516 |
|dir executionBlock| |
|
6517 |
||
6518 |
dir := self directoryContentsBrowser directory. |
|
6519 |
||
6520 |
(Dialog confirm:(resources |
|
6521 |
string:'Initialize new Mercurial Repository in %1?' |
|
6522 |
with:dir baseName)) ifFalse:[^ self]. |
|
6523 |
||
6524 |
executionBlock := |
|
6525 |
[:stream | |
|
6526 |
(self getExecutionBlockForCommand:('hg init') |
|
6527 |
inDirectory:dir) value:stream. |
|
6528 |
]. |
|
6529 |
||
6530 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
6531 |
||
6532 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
6533 |
! |
|
6534 |
||
11139 | 6535 |
mercurialPush |
6536 |
|destination dir executionBlock| |
|
6537 |
||
6538 |
destination := Dialog request:'Mercurial Repository' |
|
6539 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
6540 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
6541 |
||
6542 |
LastMercurialRepository := destination. |
|
6543 |
||
6544 |
dir := self directoryContentsBrowser directory. |
|
6545 |
executionBlock := |
|
6546 |
[:stream | |
|
6547 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
6548 |
inDirectory:dir) value:stream. |
|
6549 |
]. |
|
6550 |
||
6551 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
6552 |
||
6553 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
6554 |
! |
|
6555 |
||
6556 |
mercurialStatus |
|
6557 |
|executionBlock sel maxCmdSize| |
|
6558 |
||
6559 |
maxCmdSize := 512. |
|
6560 |
||
6561 |
sel := self currentSelectedObjects. |
|
6562 |
sel isEmptyOrNil ifTrue:[ |
|
6563 |
^ self |
|
6564 |
]. |
|
6565 |
||
6566 |
executionBlock := |
|
6567 |
[:stream | |
|
6568 |
|prevDir cmd| |
|
6569 |
||
6570 |
prevDir := nil. |
|
6571 |
sel do:[:fn | |
|
6572 |
|nameArg dir| |
|
6573 |
||
6574 |
nameArg := '"',fn baseName,'"'. |
|
6575 |
dir := fn directory. |
|
6576 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6577 |
"/ flush |
|
6578 |
cmd notNil ifTrue:[ |
|
6579 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6580 |
cmd := nil. |
|
6581 |
] |
|
6582 |
]. |
|
6583 |
cmd isNil ifTrue:[ |
|
6584 |
cmd := 'hg status'. |
|
6585 |
]. |
|
6586 |
cmd := cmd,' ',nameArg. |
|
6587 |
prevDir := dir. |
|
6588 |
]. |
|
6589 |
cmd notNil ifTrue:[ |
|
6590 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6591 |
cmd := nil. |
|
6592 |
]. |
|
6593 |
]. |
|
6594 |
||
6595 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
6596 |
||
6597 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 6598 |
! ! |
6599 |
||
4849 | 6600 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 6601 |
|
8510 | 6602 |
allFilesInSelectedDirectoriesForWhich:aBlock |
17868 | 6603 |
^ self class allFilesInDirectories:(self currentSelectedDirectories) forWhich:aBlock |
8510 | 6604 |
! |
6605 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6606 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6607 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6608 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6609 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6610 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6611 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6612 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6613 |
"/ 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
|
6614 |
"/ 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
|
6615 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6616 |
conv := OrderedCollection new. |
4722 | 6617 |
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
|
6618 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6619 |
outSuffix = 'png' ifTrue:[ |
4722 | 6620 |
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
|
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 = 'gif' ifTrue:[ |
4722 | 6624 |
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
|
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 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 6628 |
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
|
6629 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6630 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6631 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 6632 |
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
|
6633 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6634 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6635 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6636 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6637 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6638 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6639 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6640 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6641 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6642 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6643 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6644 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6645 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6646 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6647 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6648 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6649 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6650 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6651 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6652 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6653 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6654 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6655 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6656 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6657 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6658 |
|
4367 | 6659 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6660 |
self convertImageToSuffix:'gif' |
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 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6664 |
self convertImageToSuffix:'jpg' |
4531 | 6665 |
! |
6666 |
||
6667 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6668 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6669 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6670 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6671 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6672 |
|outFile filesToConvert| |
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 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6675 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6676 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6677 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6678 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6679 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6680 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6681 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6682 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6683 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6684 |
outFile exists ifTrue:[ |
4722 | 6685 |
|answer| |
6686 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6687 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6688 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6689 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6690 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6691 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6692 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6693 |
skip 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 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6696 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6697 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6698 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6699 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6700 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6701 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6702 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6703 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6704 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6705 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6706 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6707 |
self updateAndSelect:nil. |
4367 | 6708 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6709 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6710 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6711 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6712 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6713 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6714 |
"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
|
6715 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6716 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6717 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6718 |
self convertImageToSuffix:'xpm' |
4367 | 6719 |
! |
6720 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6721 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
13121 | 6722 |
|inFile outFile chainOfConversions conversionStream |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6723 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
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 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6726 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6727 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6728 |
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
|
6729 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6730 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6731 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6732 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6733 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6734 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6735 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6736 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6737 |
eachConversionCommand == #readToXPM ifTrue:[ |
13121 | 6738 |
|image tempStreamXPM| |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6739 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6740 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6741 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6742 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6743 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6744 |
]. |
13121 | 6745 |
tempStreamXPM := FileStream newTemporaryWithSuffix:'xpm'. |
6746 |
XPMReader save:image onStream:tempStreamXPM. |
|
6747 |
tempStreamXPM close. |
|
6748 |
inFile := tempStreamXPM fileName. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6749 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6750 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6751 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6752 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6753 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6754 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6755 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6756 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6757 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6758 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6759 |
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
|
6760 |
|
13121 | 6761 |
outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6762 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6763 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6764 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6765 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6766 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6767 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6768 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6769 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6770 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6771 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6772 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6773 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6774 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6775 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6776 |
|
18024 | 6777 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
6778 |
outFile remove. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6779 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6780 |
]. |
18024 | 6781 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6782 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6783 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6784 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6785 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6786 |
] ifCurtailed:[ |
18024 | 6787 |
(inFile ~= fileName) ifTrue:[inFile remove]. |
6788 |
outFile remove. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6789 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6790 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6791 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6792 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6793 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6794 |
|
3892 | 6795 |
createProjectAndOpenProjectBrowser |
6796 |
|nm f s directory| |
|
6797 |
||
6798 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6799 |
directory := self currentDirectory. |
3892 | 6800 |
nm := directory baseName. |
6801 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6802 |
f exists ifTrue:[ |
|
4414 | 6803 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6804 |
^ self. |
|
3892 | 6805 |
]. |
6806 |
s := f writeStream. |
|
6807 |
s nextPutAll:' |
|
6808 |
name ''' , nm , ''' |
|
6809 |
type #classLibrary |
|
6810 |
package #''private:' , nm , ''' |
|
6811 |
prerequisites nil |
|
6812 |
||
6813 |
classes #( ) |
|
6814 |
'. |
|
6815 |
s close. |
|
6816 |
ProjectBrowser openOnFile:f. |
|
6817 |
! |
|
6818 |
||
5880 | 6819 |
doExecuteCommand |
6820 |
"execute an OperatingSystem-command" |
|
6821 |
||
6822 |
| action fileName| |
|
6823 |
||
6824 |
fileName := self firstSelectedFile. |
|
6825 |
action := [:command | |
|
6826 |
self addToCommandHistory:command for:fileName. |
|
6827 |
self executeCommand:command. |
|
6828 |
]. |
|
6829 |
self askForCommandFor:fileName thenDo:action |
|
6830 |
! |
|
6831 |
||
6832 |
doExecuteScript |
|
16941 | 6833 |
"execute a Smalltalk script" |
5880 | 6834 |
|
6835 |
|textHolder dialog template dummyClass dummyInstance| |
|
6836 |
||
6837 |
template := |
|
6838 |
'"/ Smalltalk script: |
|
6839 |
||
16084 | 6840 |
"/ the following variables are accessible: |
5880 | 6841 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
6842 |
"/ selectedFiles (= ...) |
|
6843 |
"/ |
|
6844 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6845 |
"/ |
|
6846 |
"/ Useful operations are: |
|
6847 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6848 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6849 |
"/ directory directory |
|
6850 |
"/ |
|
6851 |
"/ example: move all files which match a aarticular pattern to |
|
6852 |
"/ a separate directory: |
|
6853 |
"/ |
|
6854 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6855 |
"/ |
|
6856 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6857 |
"/ |
|
6858 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6859 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6860 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6861 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6862 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6863 |
"/ newDir := directory construct:prefix. |
|
6864 |
"/ newDir exists ifFalse:[ |
|
6865 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6866 |
"/ newDir makeDirectory. |
|
6867 |
"/ ]. |
|
6868 |
"/ ]. |
|
6869 |
"/ newDir exists ifTrue:[ |
|
6870 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6871 |
"/ newFile := newDir construct:rest. |
|
6872 |
"/ oldFile moveTo:newFile |
|
6873 |
"/ ] |
|
6874 |
"/ ] |
|
6875 |
"/ ] |
|
6876 |
'. |
|
6877 |
||
6878 |
LastScriptBlockString isNil ifTrue:[ |
|
6879 |
LastScriptBlockString := template. |
|
6880 |
]. |
|
6881 |
||
6882 |
textHolder := ValueHolder new. |
|
6883 |
dialog := Dialog |
|
6884 |
forRequestText:(resources string:'Enter script') |
|
6885 |
editViewClass:CodeView |
|
6886 |
lines:25 |
|
6887 |
columns:70 |
|
6888 |
initialAnswer:LastScriptBlockString |
|
6889 |
model:textHolder. |
|
6890 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6891 |
dialog open. |
|
6892 |
dialog accepted ifFalse:[^ self]. |
|
6893 |
||
6894 |
LastScriptBlockString := textHolder value. |
|
6895 |
||
6896 |
Class classConventionViolationConfirmationQuerySignal |
|
6897 |
answer:true |
|
6898 |
do:[ |
|
6899 |
dummyClass := Object class |
|
6900 |
name:#Dummy |
|
6901 |
inEnvironment:nil |
|
6902 |
subclassOf:Object |
|
6903 |
instanceVariableNames:'directory selectedFiles' |
|
6904 |
variable:false |
|
6905 |
words:true |
|
6906 |
pointers:true |
|
6907 |
classVariableNames:'' |
|
6908 |
poolDictionaries:'' |
|
6909 |
category:#dummyCategory |
|
6910 |
comment:nil |
|
6911 |
changed:true. |
|
6912 |
]. |
|
6913 |
||
6914 |
dummyInstance := dummyClass basicNew. |
|
6915 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6916 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6917 |
||
6918 |
Compiler |
|
6919 |
evaluate:textHolder value |
|
6920 |
in:nil |
|
6921 |
receiver:dummyInstance |
|
6922 |
notifying:nil |
|
6923 |
logged:false |
|
6924 |
ifFail:[] |
|
6925 |
compile:true. |
|
6926 |
||
6927 |
"/ fileName := self firstSelectedFile. |
|
6928 |
"/ action := [:command | |
|
6929 |
"/ self addToCommandHistory:command for:fileName. |
|
6930 |
"/ self executeCommand:command. |
|
6931 |
"/ ]. |
|
6932 |
"/ self askForCommandFor:fileName thenDo:action |
|
6933 |
! |
|
6934 |
||
4230 | 6935 |
doMake |
7938 | 6936 |
|dir cmd| |
4230 | 6937 |
|
13856 | 6938 |
cmd := self makeCommandHolder value. |
6939 |
||
6940 |
"Make" |
|
6941 |
cmd = 'make' ifTrue:[ |
|
6942 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6943 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6944 |
dir notNil ifTrue:[ |
|
6945 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
6946 |
cmd := 'bmake.bat'. |
|
6947 |
] |
|
7938 | 6948 |
] |
13856 | 6949 |
]. |
6950 |
self executeCommand:cmd. |
|
6951 |
^self. |
|
6952 |
]. |
|
6953 |
||
6954 |
"Apache ant" |
|
6955 |
cmd = 'ant' ifTrue:[ |
|
6956 |
self executeCommand:cmd. |
|
6957 |
^self. |
|
6958 |
]. |
|
6959 |
||
6960 |
"Add more here..." |
|
6961 |
||
6962 |
"Modified (comment): / 13-04-2012 / 17:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4230 | 6963 |
! |
6964 |
||
8256 | 6965 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6966 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6967 |
(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
|
6968 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6969 |
|
8256 | 6970 |
|destDir| |
6971 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6972 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6973 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6974 |
]. |
8256 | 6975 |
destDir := self currentDirectory. |
6976 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6977 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6978 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6979 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6980 |
! |
6981 |
||
7829 | 6982 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6983 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6984 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6985 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 6986 |
! |
6987 |
||
12473 | 6988 |
doOpenFinder |
6989 |
self currentDirectory asFilename openFinder |
|
6990 |
||
6991 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
6992 |
! |
|
6993 |
||
12811 | 6994 |
doOpenMonticelloBrowser |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6995 |
MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello']. |
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6996 |
|
12811 | 6997 |
self withWaitCursorDo:[ |
6998 |
self currentSelectedFiles do:[:fn | |
|
6999 |
|version snapshot| |
|
7000 |
||
7001 |
fn suffix asLowercase = 'mcz' ifTrue:[ |
|
7002 |
version := MCMczReader versionFromFile:fn. |
|
7003 |
snapshot := version snapshot. |
|
7004 |
(Tools::ChangeSetBrowser2 |
|
7005 |
on: snapshot asChangeSet |
|
7006 |
label: version info name) |
|
7007 |
beTwoColumn; |
|
7008 |
targetNamespace:nil; |
|
7009 |
targetPackage:nil; |
|
7010 |
open |
|
7011 |
] |
|
7012 |
] |
|
7013 |
] |
|
7014 |
! |
|
7015 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7016 |
doOpenSettings |
8168 | 7017 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7018 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
7019 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7020 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7021 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7022 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7023 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7024 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7025 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7026 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7027 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7028 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7029 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
7030 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7031 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
7032 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7033 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7034 |
|
7104 | 7035 |
editMode:aSymbol |
7036 |
self |
|
7037 |
applicationNamed:#FileApplicationNoteBook |
|
7038 |
ifPresentDo:[:appl | |
|
7039 |
|subApp| |
|
7040 |
||
7041 |
subApp := appl selectedApplication. |
|
7042 |
subApp notNil ifTrue:[ |
|
7043 |
^ subApp perform:aSymbol |
|
7044 |
] |
|
7045 |
]. |
|
7046 |
||
7047 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
7048 |
! |
|
7049 |
||
7050 |
editModeInsert |
|
7051 |
self editMode:#editModeInsert |
|
7052 |
||
7053 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
7054 |
! |
|
7055 |
||
7056 |
editModeInsertAndSelect |
|
7057 |
self editMode:#editModeInsertAndSelect |
|
7058 |
||
7059 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
7060 |
! |
|
7061 |
||
7062 |
editModeOverwrite |
|
7063 |
self editMode:#editModeOverwrite |
|
7064 |
||
7065 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
7066 |
! |
|
7067 |
||
15528 | 7068 |
fetchFileByURL |
7069 |
|url destinationFilename| |
|
7070 |
||
17818 | 7071 |
url := Dialog request:(resources string:'URL to Fetch:') initialAnswer:'http://host/path'. |
15528 | 7072 |
url isEmptyOrNil ifTrue:[^ self]. |
7073 |
url := url asURL. |
|
7074 |
||
17818 | 7075 |
destinationFilename := Dialog request:(resources string:'Download As:') initialAnswer:(UnixFilename named:url path) baseName. |
15528 | 7076 |
destinationFilename isEmptyOrNil ifTrue:[^ self]. |
7077 |
||
7078 |
destinationFilename := self currentDirectory asFilename / destinationFilename. |
|
7079 |
destinationFilename exists ifTrue:[ |
|
7080 |
|answer| |
|
7081 |
||
7082 |
answer := Dialog |
|
7083 |
confirm:(resources string:'Overwrite existing %1 ?' with:destinationFilename baseName allBold) |
|
7084 |
default:false. |
|
7085 |
answer ~~ true ifTrue:[^ self]. |
|
7086 |
]. |
|
7087 |
self withActivityIndicationDo:[ |
|
7088 |
self notify:(resources string:'Fetching %1' with:url). |
|
7089 |
HTTPInterface get:url destinationFile:destinationFilename. |
|
7090 |
self notify:nil. |
|
7091 |
] |
|
7092 |
||
17818 | 7093 |
"Modified: / 29-11-2017 / 12:26:13 / cg" |
15528 | 7094 |
! |
7095 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7096 |
fileContentsAsByteArray |
17769 | 7097 |
|file fileSize| |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7098 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7099 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7100 |
file isNil ifTrue:[^ self ]. |
17769 | 7101 |
|
7102 |
file := file asFilename. |
|
7103 |
||
7104 |
(fileSize := file fileSize) > (1024*1024) ifTrue:[ |
|
7105 |
fileSize > (128*1024*1024) ifTrue:[ |
|
11889 | 7106 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7107 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7108 |
]. |
17769 | 7109 |
(Dialog confirm:(resources |
7110 |
string:'File is big (%1) - proceed?' |
|
7111 |
with:(UnitConverter fileSizeStringFor:fileSize)) |
|
7112 |
) ifFalse:[^ self]. |
|
7113 |
]. |
|
7114 |
file binaryContentsOfEntireFile inspect |
|
7115 |
||
7116 |
"Modified: / 19-11-2017 / 14:58:43 / cg" |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7117 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
7118 |
|
3892 | 7119 |
fileFileIn |
7120 |
"fileIn the selected file(s)" |
|
7121 |
||
7122 |
self fileFileInLazy:false |
|
7123 |
! |
|
7124 |
||
7324 | 7125 |
fileFileIn:aFilename lazy:lazy |
7126 |
"fileIn a file" |
|
7127 |
||
7128 |
self withActivityIndicationDo:[ |
|
7129 |
self notify:('File in:', aFilename asFilename baseName). |
|
7130 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7131 |
self notify:nil. |
|
7132 |
] |
|
7133 |
||
7134 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
7135 |
! |
|
7136 |
||
3892 | 7137 |
fileFileInLazy |
7138 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
7139 |
||
7140 |
self fileFileInLazy:true |
|
7141 |
! |
|
7142 |
||
7143 |
fileFileInLazy:lazy |
|
7144 |
"fileIn the selected file(s)" |
|
7145 |
||
7324 | 7146 |
self currentSelectedFiles do:[:fileName | |
7147 |
self fileIn:fileName lazy:lazy |
|
7148 |
]. |
|
7149 |
||
7150 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 7151 |
! |
7152 |
||
12497 | 7153 |
fileFileInPackage |
7154 |
"assuming the current directory is a package directory, load it" |
|
7155 |
||
7156 |
|packageDir dir path top packageID| |
|
7157 |
||
7158 |
"/ find a reasonable package-id (walk up until we find stx) |
|
7159 |
path := ''. |
|
7160 |
dir := packageDir := self currentDirectory. |
|
7161 |
||
7162 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
7163 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
7164 |
path := dir baseName , '/' , path. |
|
7165 |
dir := dir directory. |
|
7166 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
7167 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 7168 |
"/ should ask the user for a packageID and proceed... |
7169 |
^ self. |
|
7170 |
]. |
|
7171 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
7172 |
packageID := path copyButLast:1. |
12497 | 7173 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
7174 |
! |
|
7175 |
||
3892 | 7176 |
fileFileInToNameSpace |
7177 |
"fileIn the selected file(s)<into a nameSpace" |
|
7178 |
||
7179 |
|ns listOfKnownNameSpaces| |
|
7180 |
||
7181 |
listOfKnownNameSpaces := Set new. |
|
7182 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
7183 |
allNameSpaces |
4414 | 7184 |
do:[:eachNameSpace | |
7185 |
listOfKnownNameSpaces add:eachNameSpace name |
|
7186 |
]. |
|
3892 | 7187 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
7188 |
||
7189 |
ns := Dialog |
|
4414 | 7190 |
request:'During fileIn, new classes are created in nameSpace:' |
7191 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
7192 |
list:listOfKnownNameSpaces. |
|
3892 | 7193 |
ns isEmptyOrNil ifTrue:[^ self]. |
7194 |
||
7195 |
LastEnforcedNameSpace := ns. |
|
7196 |
ns := NameSpace name:ns. |
|
7197 |
||
7198 |
Class nameSpaceQuerySignal |
|
4414 | 7199 |
answer:ns |
7200 |
do:[ |
|
7201 |
self fileFileInLazy:false |
|
7202 |
] |
|
3892 | 7203 |
! |
7204 |
||
7205 |
fileFindAllDuplicates |
|
7206 |
"scan directory and all subdirs for duplicate files" |
|
7207 |
||
7208 |
|fileNames dir infoDir filesBySize |
|
7209 |
result info dirPrefix myName stream textBox maxLength directories| |
|
7210 |
||
7211 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7212 |
self withActivityIndicationDo:[ |
4414 | 7213 |
result := Dictionary new. |
7214 |
myName := self class name asString. |
|
7215 |
directories := self currentSelectedDirectories. |
|
7216 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 7217 |
|
4414 | 7218 |
dir := directories first. |
3892 | 7219 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7220 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7221 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7222 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 7223 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
7224 |
with:ex pathName |
|
7225 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7226 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7227 |
]. |
4765 | 7228 |
fileNames := fileNames |
7229 |
collect:[:fn | dir construct:fn] |
|
7230 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 7231 |
|
7232 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 7233 |
infoDir := Dictionary new. |
7234 |
fileNames do:[:fn | |
|
7235 |
infoDir at:fn put:(fn fileSize) |
|
7236 |
]. |
|
7237 |
||
14497 | 7238 |
"/ for each, get the file's size. |
4414 | 7239 |
"/ in a first pass, look for files of the same size and |
7240 |
"/ compare them ... |
|
3892 | 7241 |
|
7242 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 7243 |
filesBySize := Dictionary new. |
7244 |
infoDir keysAndValuesDo:[:fn :sz | |
|
7245 |
|entry| |
|
7246 |
||
7247 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
7248 |
entry add:fn. |
|
7249 |
]. |
|
7250 |
||
7251 |
"/ any of same size ? |
|
3892 | 7252 |
|
7253 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 7254 |
filesBySize do:[:entry | |
7255 |
|files| |
|
7256 |
||
7257 |
entry size > 1 ifTrue:[ |
|
7258 |
files := entry asArray. |
|
7259 |
1 to:files size-1 do:[:idx1 | |
|
7260 |
idx1+1 to:files size do:[:idx2 | |
|
7261 |
|fn1 fn2| |
|
7262 |
||
7263 |
fn1 := files at:idx1. |
|
7264 |
fn2 := files at:idx2. |
|
3892 | 7265 |
|
7266 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 7267 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
7268 |
"/ compare the files |
|
7269 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 7270 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 7271 |
result at:fn1 put:fn2. |
7272 |
] |
|
7273 |
] |
|
7274 |
] |
|
7275 |
] |
|
7276 |
] |
|
7277 |
]. |
|
3892 | 7278 |
|
7279 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 7280 |
dirPrefix := dir pathName. |
7281 |
result := result associations. |
|
7282 |
result := result collect:[:assoc | |
|
7283 |
|f1 f2| |
|
7284 |
||
7285 |
f1 := assoc key name. |
|
7286 |
f2 := assoc value name. |
|
7287 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
7288 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
7289 |
]. |
|
7290 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
7291 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
7292 |
]. |
|
7293 |
f1 < f2 ifTrue:[ |
|
7294 |
f2 -> f1 |
|
7295 |
] ifFalse:[ |
|
7296 |
f1 -> f2 |
|
7297 |
] |
|
7298 |
]. |
|
7299 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
7300 |
||
7301 |
info := OrderedCollection new. |
|
7302 |
result do:[:assoc | |
|
7303 |
info add:(assoc key , ' same as ' , assoc value) |
|
7304 |
]. |
|
7305 |
info isEmpty ifTrue:[ |
|
11889 | 7306 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 7307 |
^ self. |
4414 | 7308 |
]. |
3892 | 7309 |
]. |
7310 |
||
15589 | 7311 |
stream := CharacterWriteStream new. |
11688 | 7312 |
stream nextPutAllLines:info. |
5542 | 7313 |
|
3892 | 7314 |
textBox := TextBox new. |
7315 |
textBox initialText:(stream contents). |
|
5542 | 7316 |
stream close. |
11889 | 7317 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 7318 |
textBox readOnly:true. |
7319 |
textBox noCancel. |
|
11889 | 7320 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 7321 |
maxLength := 10. |
7322 |
info do:[: el | |
|
4414 | 7323 |
maxLength := maxLength max:(el size). |
3892 | 7324 |
]. |
7325 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 7326 |
textBox maxExtent:Screen current extent. |
7327 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7328 |
|
11688 | 7329 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 7330 |
! |
7331 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7332 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7333 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7334 |
|
10306 | 7335 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7336 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7337 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7338 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7339 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7340 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7341 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7342 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7343 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7344 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7345 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7346 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
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 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7349 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7350 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7351 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7352 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7353 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7354 |
|sz possibleMatches| |
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 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7357 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7358 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7359 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7360 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7361 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7362 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7363 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7364 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7365 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7366 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7367 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7368 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7369 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7370 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7371 |
|
15589 | 7372 |
stream := CharacterWriteStream with:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7373 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7374 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7375 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7376 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
7377 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7378 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7379 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7380 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7381 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7382 |
]. |
10306 | 7383 |
stream nextPutLine:'Files without duplicates:'. |
7384 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
7385 |
do:[:origFile | |
|
7386 |
|sameFiles| |
|
7387 |
||
7388 |
sameFiles := samePerFile at:origFile. |
|
7389 |
sameFiles isEmpty ifTrue:[ |
|
7390 |
stream nextPutLine:origFile baseName. |
|
7391 |
]. |
|
7392 |
]. |
|
7393 |
||
7394 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
7395 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
7396 |
LastMustMatchPattern := mustHaveMatches. |
|
7397 |
||
7398 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
7399 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
7400 |
do:[:origFile | |
|
7401 |
|sameFiles| |
|
7402 |
||
7403 |
sameFiles := samePerFile at:origFile. |
|
7404 |
sameFiles notEmpty ifTrue:[ |
|
7405 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
7406 |
stream nextPutLine:origFile baseName. |
|
7407 |
] |
|
7408 |
]. |
|
7409 |
]. |
|
7410 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7411 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7412 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7413 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7414 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7415 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7416 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7417 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7418 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7419 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7420 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7421 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7422 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
7423 |
|
3892 | 7424 |
fileFindDuplicates |
7425 |
"scan directory for duplicate files" |
|
7426 |
||
17869 | 7427 |
|directories duplicates info |
7428 |
commonDir prefixSize stream titleStream textBox maxLength| |
|
8510 | 7429 |
|
7430 |
directories := self currentSelectedDirectories. |
|
17869 | 7431 |
duplicates := self class fileFindDuplicatesIn:directories. |
7432 |
duplicates isEmpty ifTrue:[ |
|
17868 | 7433 |
Dialog information:'No duplicate files found.'. |
7434 |
^ self. |
|
7435 |
]. |
|
7436 |
||
7437 |
info := OrderedCollection new. |
|
17869 | 7438 |
commonDir := self getBestDirectory. |
7439 |
prefixSize := commonDir asString size. |
|
7440 |
duplicates do:[:assoc | |
|
17871 | 7441 |
|dup orig| |
7442 |
||
7443 |
dup := assoc key. |
|
7444 |
orig := assoc value. |
|
17868 | 7445 |
prefixSize > 1 ifTrue:[ |
17871 | 7446 |
dup := dup pathNameRelativeFrom:commonDir. |
7447 |
orig := orig pathNameRelativeFrom:commonDir. |
|
17869 | 7448 |
"/ fn1 := ('..', (fn1 name copyFrom:(prefixSize + 1))). |
7449 |
"/ fn2 := ('..', (fn2 copyFrom:(prefixSize + 1))). |
|
17868 | 7450 |
]. |
17871 | 7451 |
(dup includes:Character space) ifTrue:[ |
7452 |
dup := '"' , dup , '"' |
|
7453 |
]. |
|
7454 |
(orig includes:Character space) ifTrue:[ |
|
7455 |
orig := '"' , orig , '"' |
|
7456 |
]. |
|
7457 |
info add:(dup , ' duplicate of ' , orig) |
|
17868 | 7458 |
]. |
7459 |
||
15589 | 7460 |
stream := CharacterWriteStream new. |
11688 | 7461 |
stream nextPutAllLines:info. |
7462 |
||
17869 | 7463 |
titleStream := CharacterWriteStream with:'File duplicates in director'. |
3892 | 7464 |
directories size == 1 ifTrue:[ |
12602 | 7465 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 7466 |
] ifFalse:[ |
4535 | 7467 |
titleStream nextPutLine:'ies: '. |
4355 | 7468 |
directories do:[:dir| |
17868 | 7469 |
prefixSize > 1 ifTrue:[ |
4355 | 7470 |
titleStream nextPutAll:'..'. |
17868 | 7471 |
titleStream nextPutLine:((dir asString) copyFrom:(prefixSize + 1)). |
4355 | 7472 |
] ifFalse:[ |
4535 | 7473 |
titleStream nextPutLine:(dir asString). |
4355 | 7474 |
]. |
7475 |
] |
|
3892 | 7476 |
]. |
5543 | 7477 |
|
3892 | 7478 |
textBox := TextBox new. |
7479 |
textBox initialText:(stream contents). |
|
7480 |
textBox title:(titleStream contents). |
|
7481 |
textBox readOnly:true. |
|
7482 |
textBox noCancel. |
|
14715 | 7483 |
stream := WriteStream on:''. |
7484 |
stream nextPutAll:'Duplicates in '. |
|
4170 | 7485 |
directories do:[ :aDirectory | |
4355 | 7486 |
stream nextPutAll:aDirectory baseName. |
7487 |
stream space. |
|
4050 | 7488 |
]. |
4170 | 7489 |
textBox label:stream contents. |
3892 | 7490 |
maxLength := 10. |
7491 |
info do:[: el | |
|
4355 | 7492 |
maxLength := maxLength max:(el size). |
3892 | 7493 |
]. |
5092 | 7494 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
7495 |
textBox maxExtent:Screen current extent. |
|
17869 | 7496 |
textBox addButton:(Button |
7497 |
label:(resources string:'Remove Duplicates') |
|
7498 |
action:[ |
|
7499 |
(Dialog confirm:(resources string:'Remove %1 duplicate files?' with:duplicates size)) ifTrue:[ |
|
7500 |
duplicates do:[:eachAssoc | |
|
17871 | 7501 |
eachAssoc key remove |
17869 | 7502 |
]. |
17871 | 7503 |
]. |
7504 |
textBox close. |
|
7505 |
self updateCurrentDirectoryWithReread. |
|
17869 | 7506 |
]). |
4355 | 7507 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7508 |
|
11688 | 7509 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 7510 |
! |
7511 |
||
7512 |
fileFindFile |
|
5961 | 7513 |
|filename| |
7514 |
||
7515 |
filename := self firstSelectedFileName. |
|
7516 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7517 |
filename := Filename homeDirectory. |
3892 | 7518 |
]. |
4101 | 7519 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 7520 |
! |
7521 |
||
8510 | 7522 |
fileFindSimilarImages |
7523 |
"scan directory for similar image files" |
|
7524 |
||
8512 | 7525 |
|result stream textBox directories imageFiles histogramsV histogramsH |
7526 |
similarV similarH similar alreadyPrinted| |
|
8510 | 7527 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7528 |
self withWaitCursorDo:[ |
8510 | 7529 |
self withActivityIndicationDo:[ |
7530 |
result := Dictionary new. |
|
7531 |
||
7532 |
directories := self currentSelectedDirectories. |
|
7533 |
directories isEmpty ifTrue:[^ self]. |
|
7534 |
||
13714 | 7535 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImageType]. |
8511 | 7536 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
7537 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
7538 |
||
8510 | 7539 |
"/ for each, get the color histogram |
7540 |
histogramsV := Dictionary new. |
|
7541 |
histogramsH := Dictionary new. |
|
7542 |
imageFiles do:[:fn | |
|
7543 |
|hist image| |
|
7544 |
||
7545 |
image := Image fromFile:fn. |
|
7546 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
7547 |
hist := ImageColorHistogram new forImage:image. |
|
7548 |
histogramsV at:fn put:(hist histogramVectorV). |
|
7549 |
histogramsH at:fn put:(hist histogramVectorH). |
|
7550 |
]. |
|
7551 |
||
7552 |
similarH := Dictionary new. |
|
7553 |
similarV := Dictionary new. |
|
7554 |
similar := Dictionary new. |
|
7555 |
||
8512 | 7556 |
(self firstSelectedFile notNil |
7557 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
7558 |
ifFalse:[ imageFiles ]) |
|
7559 |
do:[:eachFile1 | |
|
8510 | 7560 |
|setOfSimilar distancesV distancesH| |
7561 |
||
7562 |
distancesV := OrderedCollection new. |
|
7563 |
distancesH := OrderedCollection new. |
|
7564 |
setOfSimilar := OrderedCollection new. |
|
7565 |
||
7566 |
imageFiles do:[:eachFile2 | |
|
7567 |
|v1 v2 dV dH| |
|
7568 |
||
7569 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
7570 |
v1 := histogramsV at:eachFile1. |
|
7571 |
v2 := histogramsV at:eachFile2. |
|
7572 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7573 |
distancesV add:(eachFile2 -> dV). |
|
7574 |
v1 := histogramsH at:eachFile1. |
|
7575 |
v2 := histogramsH at:eachFile2. |
|
7576 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7577 |
distancesH add:(eachFile2 -> dH). |
|
7578 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 7579 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 7580 |
]. |
7581 |
] |
|
7582 |
]. |
|
7583 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
7584 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
7585 |
similarV at:eachFile1 put:distancesV. |
|
7586 |
similarH at:eachFile1 put:distancesH. |
|
7587 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
7588 |
]. |
|
7589 |
||
7590 |
similar isEmpty ifTrue:[ |
|
7591 |
Dialog information:'No similarities found.'. |
|
7592 |
^ self. |
|
7593 |
]. |
|
7594 |
]. |
|
7595 |
||
15589 | 7596 |
stream := CharacterWriteStream new. |
8512 | 7597 |
alreadyPrinted := Set new. |
7598 |
||
7599 |
imageFiles do:[:eachFile | |
|
7600 |
|eachSet| |
|
7601 |
||
7602 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
7603 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
7604 |
eachSet notNil ifTrue:[ |
|
7605 |
stream nextPutLine:eachFile pathName. |
|
7606 |
eachSet do:[:info | |
|
7607 |
|fn2 dist| |
|
7608 |
||
7609 |
fn2 := info key. |
|
7610 |
dist := info value. |
|
7611 |
stream nextPutAll:' '. |
|
7612 |
stream nextPutAll:fn2 pathName. |
|
7613 |
stream nextPutLine:' (',dist printString,')'. |
|
7614 |
alreadyPrinted add:fn2. |
|
7615 |
]. |
|
7616 |
stream cr. |
|
7617 |
]. |
|
8510 | 7618 |
]. |
7619 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7620 |
]. |
8510 | 7621 |
|
7622 |
textBox := TextBox new. |
|
7623 |
textBox initialText:(stream contents). |
|
7624 |
textBox title:'File similarities:'. |
|
7625 |
textBox readOnly:true. |
|
7626 |
textBox noCancel. |
|
7627 |
||
7628 |
textBox label:'File similarities'. |
|
7629 |
textBox extent:(400@((similar size max:40)* 10)). |
|
7630 |
textBox maxExtent:Screen current extent. |
|
7631 |
textBox openModeless. "/ showAtPointer. |
|
7632 |
||
7633 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
7634 |
! |
|
7635 |
||
4618 | 7636 |
fileHexDump |
17744 | 7637 |
|file item| |
4618 | 7638 |
|
7639 |
file := self firstSelectedFile. |
|
7640 |
file notNil ifTrue:[ |
|
7641 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 7642 |
self |
7643 |
applicationNamed:#FileApplicationNoteBook |
|
7644 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 7645 |
]. |
17744 | 7646 |
|
7647 |
"Modified (format): / 12-11-2017 / 11:19:56 / cg" |
|
4618 | 7648 |
! |
7649 |
||
7324 | 7650 |
fileIn:aFilename |
7651 |
"fileIn a file" |
|
7652 |
||
7653 |
self fileIn:aFilename lazy:false |
|
7654 |
||
7655 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
7656 |
! |
|
7657 |
||
7658 |
fileIn:aFilename lazy:lazy |
|
7659 |
"fileIn a file" |
|
7660 |
||
7661 |
self withActivityIndicationDo:[ |
|
7662 |
self notify:('File in:', aFilename asFilename baseName). |
|
7663 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7664 |
self notify:nil. |
|
7665 |
] |
|
7666 |
||
7667 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
7668 |
! |
|
7669 |
||
4930 | 7670 |
filterSelectedFiles:whichFilter |
7671 |
|selectedFiles numFiles msg filterBlock| |
|
7672 |
||
7560 | 7673 |
selectedFiles := self currentSelectedObjects. |
4930 | 7674 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7675 |
||
7676 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7677 |
numFiles > 1 ifTrue:[ |
|
7678 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7679 |
]. |
|
7680 |
||
7681 |
(Dialog |
|
6352 | 7682 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7683 |
initialAnswer:false |
7684 |
) ifFalse:[ |
|
7685 |
^ self |
|
7686 |
]. |
|
7687 |
||
7688 |
whichFilter == #rot13 ifTrue:[ |
|
7689 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7690 |
]. |
|
7691 |
"/ add more here... |
|
7692 |
||
7693 |
filterBlock isNil ifTrue:[ |
|
7694 |
self information:'No such filter: ' , whichFilter. |
|
7695 |
^ self. |
|
7696 |
]. |
|
7697 |
||
7698 |
selectedFiles do:[:fileName | |
|
7699 |
|s| |
|
7700 |
||
7701 |
self notify:('Processing:', fileName baseName). |
|
7702 |
fileName isDirectory ifFalse:[ |
|
7703 |
[ |
|
7704 |
|inFile outFile in out| |
|
7705 |
||
7706 |
inFile := fileName asFilename. |
|
7707 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7708 |
||
7709 |
[ |
|
7710 |
|charIn charOut| |
|
7711 |
||
7712 |
in := inFile readStream. |
|
7713 |
out := outFile writeStream. |
|
7714 |
[in atEnd] whileFalse:[ |
|
7715 |
charIn := in next. |
|
7716 |
charOut := filterBlock value:charIn. |
|
7717 |
out nextPut:charOut. |
|
7718 |
]. |
|
13683 | 7719 |
out close. out:= nil. |
4930 | 7720 |
outFile renameTo:inFile. |
7721 |
] ensure:[ |
|
7722 |
out notNil ifTrue:[ out close ]. |
|
7723 |
in notNil ifTrue:[ in close ]. |
|
18024 | 7724 |
outFile remove. |
4930 | 7725 |
] |
7726 |
] on:FileStream openErrorSignal do:[:ex| |
|
7727 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7728 |
]. |
|
7729 |
] |
|
7730 |
]. |
|
6190 | 7731 |
self notify:nil. |
7560 | 7732 |
|
7733 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7734 |
! |
7735 |
||
9784 | 7736 |
forEachParsedXmlFileDo:aBlock |
7737 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7738 |
||
7739 |
self withActivityIndicationDo:[ |
|
7740 |
| selectedFiles xmlDocument | |
|
7741 |
||
7742 |
selectedFiles:= self currentSelectedFiles. |
|
7743 |
selectedFiles do:[:fileName | |
|
7744 |
XML::XMLSignal handle:[:ex | |
|
14551 | 7745 |
Dialog |
7746 |
information:('Error while reading XML:\ %1' bindWith:ex description) withCRs |
|
7747 |
title:'XML Error'. |
|
9784 | 7748 |
^ self. |
7749 |
] do:[ |
|
7750 |
|s d magic encoder document| |
|
7751 |
||
7752 |
s := fileName asFilename readStream. |
|
14012 | 7753 |
[ |
7754 |
s binary. |
|
7755 |
magic := (s next:2). |
|
7756 |
magic = #[254 255] ifTrue:[ |
|
7757 |
"/ UTF16BE |
|
7758 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7759 |
] ifFalse:[ |
|
7760 |
magic = #[255 254] ifTrue:[ |
|
7761 |
"/ UTF16LE |
|
7762 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7763 |
]. |
|
7764 |
]. |
|
7765 |
] ensure:[ |
|
7766 |
s close. |
|
7767 |
]. |
|
9784 | 7768 |
document notNil ifTrue:[ |
7769 |
xmlDocument := XML::XMLParser |
|
7770 |
processDocumentString:document |
|
7771 |
beforeScanDo:[:parse| parse validate:false]. |
|
7772 |
] ifFalse:[ |
|
7773 |
xmlDocument := XML::XMLParser |
|
7774 |
processDocumentInFilename:fileName |
|
7775 |
beforeScanDo:[:parse| parse validate:false]. |
|
7776 |
] |
|
7777 |
]. |
|
7778 |
aBlock value:xmlDocument. |
|
7779 |
]. |
|
7780 |
] |
|
7781 |
||
7782 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7783 |
! |
|
7784 |
||
8832 | 7785 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7786 |
|numItems path files| |
|
7787 |
||
7788 |
files := self currentSelectedFiles. |
|
7789 |
||
7790 |
(numItems := files size) > 2 ifTrue:[ |
|
7791 |
(self |
|
7792 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7793 |
with:numItems)) ifFalse:[^ self]. |
|
7794 |
]. |
|
7795 |
||
7796 |
self withActivityIndicationDo:[ |
|
7797 |
files do:[:fileName | |
|
7798 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7799 |
fileName isAbsolute ifTrue:[ |
|
17239 | 7800 |
path := fileName name. |
8832 | 7801 |
] ifFalse:[ |
7802 |
path := fileName pathName. |
|
7803 |
]. |
|
7804 |
aBlock value:path |
|
7805 |
] |
|
7806 |
]. |
|
7807 |
]. |
|
17239 | 7808 |
|
7809 |
"Modified: / 19-01-2017 / 16:57:03 / stefan" |
|
8832 | 7810 |
! |
7811 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7812 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7813 |
"generate detached signature (pkcs7) files from the contents of the selected files. |
16941 | 7814 |
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
|
7815 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7816 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7817 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7818 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7819 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7820 |
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
|
7821 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7822 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7823 |
hash := SHA1Stream hashValueOf:data. |
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 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7826 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7827 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7828 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7829 |
]. |
13677 | 7830 |
self updateCurrentDirectoryWithReread. |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7831 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7832 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7833 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7834 |
|
15211 | 7835 |
generatePatchInstallerForSelectedFiles |
7836 |
"generate an expecco patch, which installs the selected file(s). |
|
7837 |
Opens a dialog asking for the target directory and if the patch should be signed" |
|
7838 |
||
7839 |
|dialog targetDirHolder targetDir |
|
7840 |
generateSignedPatchHolder patchFileNameHolder patchFileName| |
|
7841 |
||
7842 |
targetDirHolder := '.' asValue. |
|
7843 |
generateSignedPatchHolder := true asValue. |
|
7844 |
patchFileNameHolder := '/tmp/00nn_patchFile.st' asValue. |
|
7845 |
||
7846 |
dialog := Dialog new. |
|
7847 |
dialog label:(resources string:'Patch Installer for File(s)'). |
|
7848 |
dialog addTextLabel:'Patchfile Name' adjust:#left. |
|
7849 |
dialog addInputFieldOn:patchFileNameHolder tabable:true. |
|
7850 |
dialog addTextLabel:'Target directory (relative to executable''s directory at execution time)' adjust:#left. |
|
7851 |
dialog addInputFieldOn:targetDirHolder tabable:true. |
|
7852 |
dialog addCheckBox:'Generate Signed Patch' on:generateSignedPatchHolder. |
|
7853 |
dialog addAbortAndOkButtons. |
|
7854 |
dialog open. |
|
7855 |
||
7856 |
dialog accepted ifFalse:[^ self]. |
|
7857 |
||
7858 |
targetDir := targetDirHolder value asFilename. |
|
7859 |
patchFileName := patchFileNameHolder value asFilename. |
|
7860 |
||
7861 |
self withActivityIndicationDo:[ |
|
7862 |
|outStream zipArchive pkcs7SignedData signatureFilename| |
|
7863 |
||
7864 |
self notify:'Generating self extracting st script: ', patchFileName name, '...'. |
|
7865 |
outStream := patchFileName writeStream. |
|
7866 |
outStream nextPutAll:' |
|
7867 |
|patchStream zipArchive| |
|
7868 |
patchStream := Expecco::Browser::CurrentPatchStreamQuery query. |
|
7869 |
patchStream isNil ifTrue:[ self error:''sorry, this patch can only be installed in expecco 2.6.2 and newer (missing CurrentPatchStreamQuery)'']. |
|
7870 |
zipArchive := ZipArchive readingFrom:patchStream. |
|
7871 |
zipArchive members do:[:each | zipArchive extract:each fileName]. |
|
7872 |
patchStream setToEnd. "/ to force fileIn to finish |
|
7873 |
!! |
|
7874 |
||
7875 |
!! !! |
|
7876 |
||
7877 |
'. |
|
7878 |
zipArchive := ZipArchive writingTo:outStream. "/ newFileNamed:(patchFileName). |
|
7879 |
||
7880 |
self currentSelectedFiles do:[:fn | |
|
7881 |
|inStream signatureFilename| |
|
7882 |
||
7883 |
inStream := fn asFilename readStream. |
|
7884 |
zipArchive addFile: (targetDir construct:fn asFilename baseName) name fromStream:inStream. |
|
7885 |
inStream close. |
|
7886 |
]. |
|
7887 |
||
16975 | 7888 |
zipArchive close. |
15211 | 7889 |
|
7890 |
generateSignedPatchHolder value ifTrue:[ |
|
7891 |
self notify:'Generating signed file from: ', patchFileName name, '...'. |
|
7892 |
||
7893 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:patchFileName contentsOfEntireFile. |
|
7894 |
signatureFilename := patchFileName withSuffix:'expeccoPatch'. |
|
7895 |
signatureFilename contents:pkcs7SignedData. |
|
7896 |
]. |
|
7897 |
self notify:nil. |
|
7898 |
] |
|
7899 |
! |
|
13783 | 7900 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7901 |
generateSignaturesForSelectedFiles |
13783 | 7902 |
"generate signed pkcs7 files from the contents of the selected files. |
7903 |
These can be delivered as expeccoPatch files" |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7904 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7905 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7906 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7907 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7908 |
|
8646 | 7909 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7910 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7911 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7912 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7913 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7914 |
]. |
13677 | 7915 |
self updateCurrentDirectoryWithReread. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7916 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7917 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7918 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7919 |
|
9784 | 7920 |
inspectXmlFile |
7921 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7922 |
a plain inspector on the XML tree" |
|
7923 |
||
7924 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7925 |
XML::XMLInspector notNil ifTrue:[ |
|
7926 |
XML::XMLInspector openOn:xmlDocument. |
|
7927 |
] ifFalse:[ |
|
7928 |
"fall back..." |
|
7929 |
xmlDocument inspect. |
|
7930 |
] |
|
7931 |
]. |
|
7932 |
||
7933 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7934 |
! |
|
7935 |
||
3892 | 7936 |
installAllAsAutoloaded |
7937 |
"install all classes found here as autoloaded classes" |
|
7938 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7939 |
self installAllAsAutoloadedRecursive:false |
3892 | 7940 |
! |
7941 |
||
6521 | 7942 |
installAllAsAutoloadedRecursive |
7943 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7944 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7945 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7946 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7947 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7948 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7949 |
"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
|
7950 |
|
6521 | 7951 |
[ |
15507 | 7952 |
LoadInProgressQuery answerNotifyLoadingDo:[ |
7953 |
|installAction| |
|
7954 |
||
7955 |
installAction := |
|
7956 |
[:fn | |
|
7957 |
(fn suffix = 'st') ifTrue:[ |
|
7958 |
self notify:('Install as autoloaded: ', fn baseName). |
|
7959 |
self installAsAutoloaded:fn. |
|
7960 |
] |
|
7961 |
]. |
|
7962 |
||
7963 |
self withActivityIndicationDo:[ |
|
7964 |
self currentSelectedDirectories do:[:dir| |
|
7965 |
aBoolean ifTrue:[ |
|
7966 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
|
7967 |
] ifFalse:[ |
|
7968 |
dir directoryContentsAsFilenamesDo:installAction |
|
15152 | 7969 |
]. |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7970 |
]. |
15507 | 7971 |
self notify:nil. |
7972 |
]. |
|
7973 |
] |
|
6521 | 7974 |
] fork. |
7975 |
! |
|
7976 |
||
3892 | 7977 |
installAsAutoloaded:aFilename |
7978 |
"install aFilename as autoloaded class" |
|
7979 |
||
13292 | 7980 |
Smalltalk installAutoloadedClassFromSourceFile:aFilename |
7981 |
||
7982 |
"Modified: / 01-08-2013 / 16:58:09 / cg" |
|
3892 | 7983 |
! |
7984 |
||
15211 | 7985 |
joinSelectedFiles |
7986 |
|selectedFiles numFiles msg outFileName outFile outStream| |
|
7987 |
||
7988 |
selectedFiles := self currentSelectedObjects. |
|
7989 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
|
7990 |
||
7991 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
7992 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
|
7993 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
|
7994 |
outFile := selectedFiles first directory construct:outFileName. |
|
7995 |
||
7996 |
outStream := outFile writeStream. |
|
7997 |
||
7998 |
selectedFiles do:[:fileName | |
|
7999 |
self notify:('Adding:', fileName baseName). |
|
17997 | 8000 |
fileName readingFileDo:[:inStream | |
8001 |
inStream copyToEndInto:outStream. |
|
8002 |
]. |
|
15211 | 8003 |
]. |
8004 |
outStream close. |
|
8005 |
self notify:nil. |
|
8006 |
||
8007 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
8008 |
! |
|
4558 | 8009 |
|
6292 | 8010 |
loadImageThenDo:aBlock |
3892 | 8011 |
|img path files| |
8012 |
||
3982 | 8013 |
files := self currentSelectedFiles. |
3892 | 8014 |
files isEmpty ifTrue:[ ^ self]. |
8015 |
files do:[:fileName | |
|
4414 | 8016 |
path := fileName. |
8017 |
path isDirectory ifFalse:[ |
|
8018 |
img := Image fromFile:(path pathName). |
|
8019 |
img notNil ifTrue:[ |
|
6292 | 8020 |
aBlock value:img |
4414 | 8021 |
] ifFalse:[ |
15346 | 8022 |
Dialog warn:(resources string:'Unknown image format: "%1"' with:fileName asString) |
4414 | 8023 |
] |
8024 |
] |
|
3892 | 8025 |
]. |
8026 |
! |
|
8027 |
||
13089 | 8028 |
loadSignatureSupport |
8029 |
Expecco::KeyFileGenerator isNil ifTrue:[ |
|
14047 | 8030 |
Smalltalk loadPackage:'exept:expecco/license' |
13089 | 8031 |
]. |
8032 |
! |
|
8033 |
||
3892 | 8034 |
openASN1Browser |
8035 |
||
8036 |
self openTool:OSI::ASN1Browser |
|
8037 |
! |
|
8038 |
||
8039 |
openAppletViewer |
|
8040 |
|numItems files| |
|
8041 |
||
3982 | 8042 |
files := self currentSelectedFiles. |
3892 | 8043 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 8044 |
(self |
8045 |
confirm:(resources string:'open for each of the %1 items ?' |
|
8046 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 8047 |
]. |
8048 |
||
8049 |
Java startupJavaSystem. |
|
8050 |
"/ Java markAllClassesUninitialized. |
|
8051 |
"/ Java initAllStaticFields. |
|
8052 |
"/ Java initAllClasses. |
|
8053 |
||
8054 |
files do:[:fileName | |
|
4414 | 8055 |
|p path| |
8056 |
||
8057 |
path := fileName. |
|
8058 |
path isDirectory ifFalse:[ |
|
8059 |
p := Java |
|
8060 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
8061 |
argumentString:path pathName. |
|
8062 |
p resume. |
|
8063 |
] |
|
3892 | 8064 |
]. |
8065 |
! |
|
8066 |
||
8067 |
openCBrowser |
|
6031 | 8068 |
|dir files| |
5880 | 8069 |
|
8070 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8071 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8072 |
self withActivityIndicationDo:[ |
7560 | 8073 |
files := self currentSelectedObjects. |
6031 | 8074 |
files notEmptyOrNil ifTrue:[ |
8075 |
CBrowser::Browser openOn:files first. |
|
8076 |
] ifFalse:[ |
|
8077 |
CBrowser::Browser openIn:dir. |
|
8078 |
] |
|
3892 | 8079 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8080 |
|
7560 | 8081 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 8082 |
! |
8083 |
||
4230 | 8084 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8085 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8086 |
|
4230 | 8087 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8088 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 8089 |
with:#openOnFile: |
8090 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8091 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
8092 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 8093 |
! |
8094 |
||
3892 | 8095 |
openChangesBrowser |
8096 |
"open a change browser on the selected file(s)" |
|
8097 |
||
18246 | 8098 |
self currentSelectedDirectories notEmptyOrNil ifTrue:[ |
18248 | 8099 |
GitHubSmalltalkPackageReader notNil ifTrue:[ |
8100 |
self currentSelectedDirectories do:[:fn | |
|
8101 |
(fn suffix = 'package') ifTrue:[ |
|
8102 |
ChangeSetBrowser openOn:(GitHubSmalltalkPackageReader readPackageFrom:fn). |
|
8103 |
]. |
|
8104 |
(fn suffix = 'class') ifTrue:[ |
|
8105 |
ChangeSetBrowser openOn:(GitHubSmalltalkClassReader readClassFrom:fn). |
|
8106 |
]. |
|
8107 |
]. |
|
8108 |
^ self. |
|
8109 |
]. |
|
18246 | 8110 |
]. |
8111 |
||
3892 | 8112 |
self openTool:(UserPreferences current changesBrowserClass) |
18246 | 8113 |
|
18248 | 8114 |
"Modified: / 30-06-2018 / 20:33:24 / Claus Gittinger" |
3892 | 8115 |
! |
8116 |
||
8117 |
openDiffView |
|
15215 | 8118 |
"open a diff-view on the two selected files" |
8119 |
||
8120 |
|name1 name2 files title |
|
8121 |
defaultName defaultDir| |
|
6460 | 8122 |
|
8123 |
files := self currentSelectedObjects. |
|
3892 | 8124 |
files isEmpty ifTrue:[ |
6460 | 8125 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 8126 |
^ self. |
3892 | 8127 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8128 |
|
3892 | 8129 |
(files size == 2) ifTrue:[ |
4414 | 8130 |
name1 := files last. |
8131 |
name2 := files first. |
|
3892 | 8132 |
] ifFalse:[ |
4414 | 8133 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 8134 |
LastFileDiffFile exists ifTrue:[ |
8135 |
name1 := LastFileDiffFile. |
|
8136 |
]. |
|
8137 |
"/ | directory | |
|
8138 |
"/ directory := self currentDirectory. |
|
8139 |
"/ directory notNil ifTrue:[ |
|
8140 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
8141 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
8142 |
"/ name1 := lastFile. |
|
8143 |
"/ ] |
|
8144 |
"/ ] |
|
4414 | 8145 |
]. |
8146 |
name2 := files first. |
|
6460 | 8147 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 8148 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 8149 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 8150 |
name1 := DialogBox |
8151 |
requestFileName:title |
|
8152 |
default:defaultName |
|
6460 | 8153 |
ok:(resources string:'OK') |
8154 |
abort:(resources string:'Compare against File List') |
|
4414 | 8155 |
pattern:'*' |
11052 | 8156 |
fromDirectory:defaultDir. |
3892 | 8157 |
]. |
15215 | 8158 |
self openDiffViewOn:name1 and:name2 |
8159 |
||
8160 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
|
8161 |
! |
|
8162 |
||
8163 |
openDiffViewOn:fileArg1 and:fileArg2 |
|
8164 |
"open a diff-view on two files" |
|
8165 |
||
17769 | 8166 |
|file1 file2 file1Size file2Size text1 text2 d err nm l1 sameContents msg| |
15215 | 8167 |
|
8168 |
file1 := fileArg1. |
|
8169 |
file2 := fileArg2. |
|
3892 | 8170 |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8171 |
self withWaitCursorDo:[ |
15215 | 8172 |
(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
|
8173 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
14126 | 8174 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l string]]. |
15215 | 8175 |
file1 := nil. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8176 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8177 |
] ifFalse:[ |
15215 | 8178 |
file1 := file1 asFilename. |
8179 |
LastFileDiffFile := file1. |
|
8180 |
file1 isReadable ifFalse:[ |
|
8181 |
nm := file1. |
|
8182 |
file1 exists ifFalse:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8183 |
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
|
8184 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8185 |
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
|
8186 |
]. |
4414 | 8187 |
]. |
15215 | 8188 |
l1 := file1 pathName |
4414 | 8189 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8190 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8191 |
err isNil ifTrue:[ |
15215 | 8192 |
file2 isReadable ifFalse:[ |
8193 |
nm := file2. |
|
8194 |
file2 exists ifFalse:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8195 |
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
|
8196 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8197 |
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
|
8198 |
]. |
4414 | 8199 |
]. |
8200 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8201 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8202 |
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
|
8203 |
^ self |
6176 | 8204 |
]. |
8205 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8206 |
self withActivityIndicationDo:[ |
17769 | 8207 |
file1Size := file1 isNil ifTrue:[0] ifFalse:[file1 fileSize]. |
8208 |
file2Size := file2 isNil ifTrue:[0] ifFalse:[file2 fileSize]. |
|
8209 |
||
8210 |
((file1Size > (1024*1024*32)) or:[ file2Size > (1024*1024*32) ]) ifTrue:[ |
|
8211 |
file1Size = file2Size ifTrue:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8212 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8213 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8214 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8215 |
during:[ |
15215 | 8216 |
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
|
8217 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8218 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8219 |
self information:'Same contents.' |
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 |
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
|
8222 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8223 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8224 |
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
|
8225 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8226 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8227 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8228 |
|
15215 | 8229 |
file1 notNil ifTrue:[ |
8230 |
file1 isDirectory ifTrue:[ |
|
8231 |
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
|
8232 |
] ifFalse:[ |
15215 | 8233 |
text1 := file1 contents. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8234 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8235 |
]. |
15215 | 8236 |
file2 isDirectory ifTrue:[ |
8237 |
text2 := file2 directoryContents asString. |
|
6460 | 8238 |
] ifFalse:[ |
15215 | 8239 |
text2 := file2 contents. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8240 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8241 |
text1 = text2 ifTrue:[ |
15215 | 8242 |
(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
|
8243 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8244 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8245 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8246 |
]. |
16911 | 8247 |
self information:msg |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8248 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8249 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
8250 |
openOn:text1 label:l1 |
15215 | 8251 |
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
|
8252 |
d topView label:(resources string:'File Differences'). |
6460 | 8253 |
] |
4414 | 8254 |
] |
3892 | 8255 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8256 |
|
17769 | 8257 |
"Modified: / 19-11-2017 / 15:00:47 / cg" |
3892 | 8258 |
! |
8259 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8260 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8261 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8262 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8263 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8264 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8265 |
files := self currentSelectedObjects. |
11108 | 8266 |
files notEmpty ifTrue:[ |
8267 |
name1 := files first asFilename. |
|
8268 |
name1 asFilename isDirectory ifFalse:[ |
|
8269 |
name1 := name1 directory |
|
8270 |
]. |
|
8271 |
]. |
|
8272 |
||
8273 |
(files size == 2) ifTrue:[ |
|
8274 |
name2 := files second. |
|
8275 |
] ifFalse:[ |
|
8276 |
(files size ~= 1) ifTrue:[ |
|
8277 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
8278 |
^ self. |
|
8279 |
]. |
|
8280 |
name2 := Dialog |
|
8281 |
requestDirectoryName:(resources |
|
8282 |
string:'Recursive compare "%1" with folder:' |
|
8283 |
with:name1 asFilename baseName) |
|
8284 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
8285 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
8286 |
LastFileDiffDirectory := name2. |
|
8287 |
]. |
|
8288 |
name2 := name2 asFilename. |
|
8289 |
||
8290 |
name2 asFilename isDirectory ifFalse:[ |
|
8291 |
name2 := name2 directory |
|
8292 |
]. |
|
8293 |
||
8294 |
self |
|
8295 |
applicationNamed:#FileApplicationNoteBook |
|
8296 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8297 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8298 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8299 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
8300 |
|
3892 | 8301 |
openEditor |
8302 |
self openTool:EditTextView |
|
8303 |
! |
|
8304 |
||
4957 | 8305 |
openGV |
8306 |
self openOSCommandWithFiles:'gv' |
|
8307 |
! |
|
8308 |
||
3892 | 8309 |
openHTMLReader |
8310 |
||
8311 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
8312 |
! |
|
8313 |
||
8314 |
openImageEditor |
|
6292 | 8315 |
[ |
8316 |
self loadImageThenDo:[:img | img edit] |
|
8317 |
] fork |
|
3892 | 8318 |
! |
8319 |
||
8320 |
openImageInspector |
|
6292 | 8321 |
[ |
8322 |
self loadImageThenDo:[:img | img inspect] |
|
8323 |
] fork |
|
3892 | 8324 |
! |
8325 |
||
8326 |
openImagePreview |
|
5778 | 8327 |
[ |
8328 |
self |
|
6292 | 8329 |
loadImageThenDo: |
5778 | 8330 |
[:img | |
8331 |
|i top viewer| |
|
8332 |
||
8333 |
top := StandardSystemView new. |
|
8334 |
||
8335 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
8336 |
i := img. |
|
8337 |
top extent:200@200. |
|
8338 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
8339 |
top openAndWait. |
|
8340 |
||
8341 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
8342 |
i := i magnifiedPreservingRatioTo:200@200. |
|
8343 |
]. |
|
8344 |
viewer image:i. |
|
8345 |
]. |
|
3892 | 8346 |
] fork |
8347 |
! |
|
8348 |
||
8349 |
openMP3Player |
|
8350 |
|file| |
|
8351 |
||
3982 | 8352 |
file := self currentSelectedFiles. |
3892 | 8353 |
(file isEmpty) ifTrue:[ |
4414 | 8354 |
^ self. |
3892 | 8355 |
]. |
8356 |
file := file first. |
|
8357 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
8358 |
! |
|
8359 |
||
4957 | 8360 |
openOSCommandWithFiles:command |
8361 |
|files fileNames| |
|
8362 |
||
8363 |
files := self currentSelectedFiles. |
|
8364 |
(files isEmpty) ifTrue:[ |
|
8365 |
^ self. |
|
8366 |
]. |
|
8367 |
||
8368 |
fileNames := files collect:[:each | |
|
8369 |
'"' , each asFilename pathName , '"' |
|
8370 |
]. |
|
8371 |
||
8372 |
[ |
|
8373 |
OperatingSystem |
|
4959 | 8374 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
8375 |
inDirectory:(files first asFilename directory). |
|
4957 | 8376 |
] fork |
8377 |
! |
|
8378 |
||
4820 | 8379 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8380 |
|files fileNames cmd arg| |
4820 | 8381 |
|
8382 |
files := self currentSelectedFiles. |
|
8383 |
(files isEmpty) ifTrue:[ |
|
8384 |
^ self. |
|
8385 |
]. |
|
12972 | 8386 |
cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'. |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8387 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8388 |
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
|
8389 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8390 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8391 |
|
4820 | 8392 |
fileNames := |
8393 |
files |
|
8394 |
collect: |
|
8395 |
[:each | |
|
8396 |
'"' , each asFilename pathName , '"' |
|
8397 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8398 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8399 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8400 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8401 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8402 |
]. |
4820 | 8403 |
|
4950 | 8404 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8405 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 8406 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8407 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
8408 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 8409 |
! |
8410 |
||
4958 | 8411 |
openRP |
8412 |
self openOSCommandWithFiles:'realplay' |
|
8413 |
! |
|
8414 |
||
8426 | 8415 |
openResourceFileEditor |
8416 |
||
8417 |
self |
|
8418 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
8419 |
with: #openOnFile: |
|
8420 |
! |
|
8421 |
||
3892 | 8422 |
openSlideShow |
5880 | 8423 |
|dir| |
8424 |
||
8425 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8426 |
dir isNil ifTrue:[^ self]. |
|
8427 |
||
3892 | 8428 |
CodingExamples_GUI::SlideShow openIn:dir. |
8429 |
! |
|
8430 |
||
8431 |
openSnapshotImageBrowser |
|
4491 | 8432 |
"Sorry, for now, only the old browser can handle snapShotImages." |
8433 |
||
3892 | 8434 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
8435 |
! |
|
8436 |
||
8437 |
openTerminal |
|
5880 | 8438 |
|dir| |
8439 |
||
8440 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 8441 |
|
5300 | 8442 |
TerminalApplication notNil ifTrue:[ |
8443 |
TerminalApplication openIn:dir |
|
8444 |
] ifFalse:[ |
|
8445 |
VT100TerminalView openShellIn:dir. |
|
8446 |
]. |
|
3892 | 8447 |
! |
8448 |
||
8449 |
openTool:aToolClass |
|
8450 |
"open a tool on the selected file(s)" |
|
8451 |
||
8452 |
^ self openTool:aToolClass ignoreDirectories:true |
|
8453 |
! |
|
8454 |
||
8455 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
8456 |
"open a tool on the selected file(s)" |
|
8457 |
||
8458 |
^ self |
|
4414 | 8459 |
openTool:aToolClass |
8460 |
with:#openOn: |
|
8461 |
ignoreDirectories:ignoreDirs |
|
3892 | 8462 |
! |
8463 |
||
8426 | 8464 |
openTool:aToolClass with:aSelector |
8465 |
"open a tool on the selected file(s)" |
|
8466 |
||
8467 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
8468 |
! |
|
8469 |
||
3892 | 8470 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
8471 |
"open a tool on the selected file(s)" |
|
8472 |
||
8832 | 8473 |
|tool| |
3892 | 8474 |
|
8475 |
aToolClass isNil ifTrue:[ |
|
4414 | 8476 |
Dialog warn:'Sorry, that tool seems to be not available'. |
8477 |
^ nil. |
|
3892 | 8478 |
]. |
8832 | 8479 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
8480 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 8481 |
]. |
8482 |
^ tool |
|
8832 | 8483 |
! |
8484 |
||
8485 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8486 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8487 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8488 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8489 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8490 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8491 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8492 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8493 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8494 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8495 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8496 |
]. |
3892 | 8497 |
! |
8498 |
||
6022 | 8499 |
openWorkspace |
8500 |
self |
|
8501 |
openTool:WorkspaceApplication |
|
8502 |
with:#openOnFile: |
|
8503 |
ignoreDirectories:true |
|
8504 |
! |
|
8505 |
||
4950 | 8506 |
openXV |
4957 | 8507 |
self openOSCommandWithFiles:'xv' |
4950 | 8508 |
! |
8509 |
||
3892 | 8510 |
openZipTool |
5880 | 8511 |
|zipTool| |
3892 | 8512 |
|
8513 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 8514 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 8515 |
]. |
8516 |
! |
|
8517 |
||
8518 |
readAbbrevFile |
|
8519 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
8520 |
||
5880 | 8521 |
|directories| |
3892 | 8522 |
|
3982 | 8523 |
directories := self currentSelectedDirectories. |
3892 | 8524 |
directories isEmpty ifTrue:[^ self]. |
8525 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8526 |
self withActivityIndicationDo:[ |
5880 | 8527 |
directories do:[:eachDir | |
8528 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
8529 |
] |
|
5828 | 8530 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8531 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8532 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 8533 |
! |
8534 |
||
6460 | 8535 |
readAndShowResources |
8536 |
self withActivityIndicationDo:[ |
|
8537 |
| selectedFiles| |
|
8538 |
||
8539 |
selectedFiles:= self currentSelectedFiles. |
|
8540 |
selectedFiles do:[:fileName | |
|
8541 |
resources := ResourcePack fromFile:fileName. |
|
8542 |
resources inspect. |
|
8543 |
]. |
|
8544 |
] |
|
8545 |
! |
|
8546 |
||
17831 | 8547 |
removeBakAndSavFiles |
8548 |
"remove all .sav and .bak files (after confirmation)" |
|
8549 |
||
8550 |
|filesToRemove directories| |
|
8551 |
||
8552 |
directories := self currentSelectedDirectories. |
|
8553 |
directories isEmptyOrNil ifTrue:[ |
|
8554 |
directories := Array with:self currentDirectory |
|
8555 |
]. |
|
8556 |
||
8557 |
self withActivityIndicationDo:[ |
|
8558 |
filesToRemove := OrderedCollection new. |
|
8559 |
directories do:[:eachDirectoryToScan | |
|
8560 |
eachDirectoryToScan filesDo:[:fn | |
|
8561 |
(#('sav' 'bak') includes:fn suffix) ifTrue:[ |
|
8562 |
filesToRemove add:fn. |
|
8563 |
] |
|
8564 |
] |
|
8565 |
]. |
|
8566 |
filesToRemove isEmpty ifTrue:[ |
|
8567 |
Dialog information:(resources string:'Nothing to remove'). |
|
8568 |
^ self. |
|
8569 |
]. |
|
8570 |
(Dialog confirm:(resources string:'Remove %1 file(s) ?' with:filesToRemove size)) ifFalse:[ |
|
8571 |
^ self |
|
8572 |
]. |
|
8573 |
filesToRemove do:[:each | |
|
8574 |
each remove |
|
8575 |
]. |
|
17871 | 8576 |
self updateCurrentDirectoryWithReread |
17831 | 8577 |
]. |
8578 |
! |
|
8579 |
||
3892 | 8580 |
singleFileFileIn:fileName lazy:lazy |
8581 |
"fileIn the selected file(s)" |
|
8582 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8583 |
|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
|
8584 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8585 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8586 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8587 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8588 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8589 |
[ |
4345 | 8590 |
(ObjectFileLoader notNil |
5491 | 8591 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 8592 |
AbortOperationRequest catch:[ |
8593 |
|p| |
|
8594 |
||
8595 |
"/ |
|
8596 |
"/ look if already loaded ... then unload first |
|
8597 |
"/ |
|
8598 |
p := fileName pathName. |
|
8599 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
8600 |
(Dialog confirm:(resources |
|
8601 |
string:'%1 is already loaded; load anyway ?' |
|
8602 |
with:p)) ifFalse:[ |
|
8603 |
^ self |
|
8604 |
]. |
|
8605 |
notifyString := 'unloading old ' , p , ' ...'. |
|
8606 |
Transcript showCR:notifyString. |
|
4523 | 8607 |
self notify:notifyString. |
4345 | 8608 |
ObjectFileLoader unloadObjectFile:p. |
8609 |
]. |
|
8610 |
||
8611 |
notifyString := 'loading ' , p , ' ...'. |
|
8612 |
Transcript showCR:notifyString. |
|
4523 | 8613 |
self notify:notifyString. |
12426 | 8614 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
8615 |
notifyString := 'Error: could not load ' , p. |
|
8616 |
Transcript showCR:notifyString. |
|
8617 |
self notify:notifyString. |
|
8618 |
] ifFalse:[ |
|
8619 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
8620 |
]. |
|
4345 | 8621 |
] |
8622 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
8623 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
8624 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8625 |
aStream := fileName readStreamOrNil. |
4345 | 8626 |
aStream notNil ifTrue:[ |
8627 |
aStream fileInBinary. |
|
8628 |
] |
|
8629 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8630 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 8631 |
"/ loading a java class file |
8632 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 8633 |
JavaClassReader loadFile:fileName |
4345 | 8634 |
] |
8635 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
8636 |
"/ loading a sif (smalltalk interchange format) file |
|
8637 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
8638 |
SmalltalkInterchangeFileManager newForFileIn |
|
8639 |
fileName: fileName pathName; |
|
8640 |
fileIn. |
|
8641 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
8642 |
Parcel isNil ifTrue:[ |
|
8643 |
Dialog warn:'Parcel support not loaded.' |
|
8644 |
] ifFalse:[ |
|
8645 |
Parcel loadParcelFrom: fileName pathName |
|
8646 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8647 |
] ifFalse:[ (fileName hasSuffix:'jar') ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8648 |
JavaVM isNil ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8649 |
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
|
8650 |
^ self. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8651 |
] ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8652 |
JavaVM booted ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8653 |
(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
|
8654 |
JavaVM boot. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8655 |
]. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8656 |
JavaVM loadClassesIn: fileName. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8657 |
] |
4345 | 8658 |
] ifFalse:[ |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8659 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8660 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
14360 | 8661 |
(lang isNil and:[(fileName hasSuffix:'js')]) ifTrue:[ |
14362 | 8662 |
Smalltalk loadPackage:'stx:libjavascript'. |
14360 | 8663 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
8664 |
]. |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8665 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8666 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8667 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8668 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8669 |
Error handle:[:ex | |
15675 | 8670 |
self errorNotify:'Error during file in: ', ex description. |
15981 | 8671 |
ex resume. |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8672 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8673 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8674 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8675 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8676 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8677 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8678 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8679 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8680 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8681 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8682 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8683 |
] |
4345 | 8684 |
] |
8685 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8686 |
]]]] |
4345 | 8687 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8688 |
] 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
|
8689 |
|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
|
8690 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8691 |
isRedef := false. |
12684 | 8692 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8693 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8694 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8695 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8696 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8697 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8698 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8699 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8700 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8701 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8702 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8703 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8704 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8705 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8706 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8707 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8708 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8709 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8710 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8711 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8712 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8713 |
sender := ex suspendedContext. |
18036 | 8714 |
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
|
8715 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8716 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8717 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8718 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8719 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8720 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8721 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8722 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8723 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8724 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8725 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8726 |
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
|
8727 |
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
|
8728 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8729 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8730 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8731 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8732 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8733 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8734 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8735 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8736 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8737 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8738 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8739 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8740 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8741 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8742 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8743 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8744 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8745 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8746 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8747 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8748 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8749 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8750 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8751 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8752 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8753 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8754 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8755 |
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
|
8756 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8757 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8758 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8759 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8760 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8761 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8762 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8763 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8764 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8765 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
8766 |
(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
|
8767 |
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
|
8768 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8769 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8770 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8771 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8772 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8773 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8774 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8775 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8776 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8777 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8778 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8779 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8780 |
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
|
8781 |
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
|
8782 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8783 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8784 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8785 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8786 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8787 |
] |
7040 | 8788 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8789 |
"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
|
8790 |
"Modified: / 19-02-2014 / 12:49:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4531 | 8791 |
! |
8792 |
||
4558 | 8793 |
splitFile:infile intoPiecesOfSize:kiloBytes |
8794 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
8795 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
8796 |
||
8797 |
bufferSize := 32*1024. |
|
8798 |
||
8799 |
inStream := infile readStream. |
|
8800 |
||
8801 |
bytesPerSplit := kiloBytes * 1024. |
|
8802 |
||
8803 |
remaining := infile fileSize. |
|
8804 |
splitIndex := 1. |
|
8805 |
[remaining > 0] whileTrue:[ |
|
8806 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8807 |
outStream := outFile asFilename writeStream. |
|
8808 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
8809 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
8810 |
buffer := ByteArray new:bufferSize. |
|
8811 |
n := inStream |
|
8812 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
8813 |
into:buffer |
|
8814 |
startingAt:1. |
|
8815 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
8816 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
8817 |
remaining := remaining - n. |
|
8818 |
]. |
|
8819 |
outStream close. |
|
8820 |
splitIndex := splitIndex + 1. |
|
8821 |
]. |
|
8822 |
inStream close. |
|
8823 |
! |
|
8824 |
||
15906 | 8825 |
splitFile:infile intoPiecesWithNumberOfLines:numberOfLines |
8826 |
|splitIndex line |
|
8827 |
inStream outFile outStream remainingLinesInThisOutfile| |
|
8828 |
||
8829 |
inStream := infile readStream. |
|
8830 |
||
8831 |
splitIndex := 1. |
|
8832 |
[inStream atEnd] whileFalse:[ |
|
8833 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8834 |
outStream := outFile asFilename writeStream. |
|
8835 |
remainingLinesInThisOutfile := numberOfLines. |
|
8836 |
[(remainingLinesInThisOutfile > 0) and:[inStream atEnd not]] whileTrue:[ |
|
8837 |
line := inStream nextLine. |
|
15910 | 8838 |
outStream nextPutLine:line. |
15906 | 8839 |
remainingLinesInThisOutfile := remainingLinesInThisOutfile - 1. |
8840 |
]. |
|
8841 |
outStream close. |
|
8842 |
splitIndex := splitIndex + 1. |
|
8843 |
]. |
|
8844 |
inStream close. |
|
8845 |
! |
|
8846 |
||
4558 | 8847 |
splitSelectedFiles |
6264 | 8848 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8849 |
|
12871 | 8850 |
selectedFiles := self currentSelectedFiles. |
4558 | 8851 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8852 |
||
6265 | 8853 |
msg := (numFiles > 1) |
8854 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8855 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8856 |
|
6352 | 8857 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8858 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8859 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8860 |
kiloBytes isNil ifTrue:[^ self]. |
8861 |
||
8862 |
selectedFiles do:[:fileName | |
|
8863 |
self notify:('Splitting:', fileName baseName). |
|
8864 |
fileName isDirectory ifFalse:[ |
|
8865 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8866 |
] |
|
8867 |
]. |
|
6190 | 8868 |
self notify:nil. |
6265 | 8869 |
|
7560 | 8870 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8871 |
! |
8872 |
||
15906 | 8873 |
splitSelectedFilesByLines |
8874 |
|selectedFiles numFiles msg numLinesString numLines| |
|
8875 |
||
8876 |
selectedFiles := self currentSelectedFiles. |
|
8877 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
8878 |
||
8879 |
msg := (numFiles > 1) |
|
8880 |
ifTrue:'Split each of the %1 files into pieces with number of lines:' |
|
8881 |
ifFalse:'Split %2 into pieces with number of lines:'. |
|
8882 |
||
8883 |
numLinesString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
|
8884 |
numLinesString isEmptyOrNil ifTrue:[^ self]. |
|
8885 |
||
8886 |
numLines := Integer readFrom:numLinesString onError:nil. |
|
8887 |
numLines isNil ifTrue:[^ self]. |
|
8888 |
||
8889 |
selectedFiles do:[:fileName | |
|
8890 |
self notify:('Splitting:', fileName baseName). |
|
8891 |
fileName isDirectory ifFalse:[ |
|
8892 |
self splitFile:fileName intoPiecesWithNumberOfLines:numLines |
|
8893 |
] |
|
8894 |
]. |
|
8895 |
self notify:nil. |
|
8896 |
! |
|
8897 |
||
15211 | 8898 |
truncateSelectedFilesToZeroSize |
8899 |
|selectedFiles numFiles msg| |
|
8900 |
||
8901 |
selectedFiles := self currentSelectedObjects. |
|
8902 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
|
8903 |
||
8904 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
|
8905 |
numFiles > 1 ifTrue:[ |
|
8906 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
|
8907 |
]. |
|
8908 |
||
8909 |
(Dialog |
|
8910 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
|
8911 |
initialAnswer:false |
|
8912 |
) ifFalse:[ |
|
8913 |
^ self |
|
8914 |
]. |
|
8915 |
||
8916 |
selectedFiles do:[:fileName | |
|
8917 |
|s| |
|
8918 |
||
8919 |
self notify:('Truncating:', fileName baseName). |
|
8920 |
fileName isDirectory ifFalse:[ |
|
8921 |
[ |
|
8922 |
s := fileName writeStream. |
|
8923 |
s close. |
|
8924 |
] on:FileStream openErrorSignal do:[:ex| |
|
8925 |
self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold). |
|
8926 |
]. |
|
8927 |
] |
|
8928 |
]. |
|
8929 |
self notify:nil. |
|
8930 |
||
8931 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
8932 |
! ! |
|
3892 | 8933 |
|
4849 | 8934 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8935 |
|
8936 |
anySTFilesPresent |
|
8937 |
^ self anyFilesPresentWithSuffix:'st' |
|
8938 |
! |
|
8939 |
||
8940 |
canCreateNewProject |
|
8941 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
17865 | 8942 |
^ self currentSelectedFiles |
8943 |
contains:[:fileName| |
|
8944 |
| suffix| |
|
8945 |
suffix := fileName suffix asLowercase. |
|
8946 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8947 |
] |
|
3892 | 8948 |
! |
8949 |
||
8950 |
canDoTerminal |
|
8951 |
||
8952 |
^ OperatingSystem isUNIXlike |
|
8953 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8954 |
! |
|
8955 |
||
8956 |
canDoTerminalAndSystemIsDOS |
|
8957 |
||
8958 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8959 |
! |
|
8960 |
||
8961 |
canDoTerminalAndSystemIsUnix |
|
8962 |
||
8963 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8964 |
! |
|
8965 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8966 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8967 |
"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
|
8968 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8969 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8970 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8971 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8972 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8973 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8974 |
|
12811 | 8975 |
canOpenMonticelloBrowser |
8976 |
^ self currentSelectedFiles |
|
8977 |
contains:[:fileName| |
|
8978 |
fileName suffix asLowercase = 'mcz' |
|
8979 |
] |
|
8980 |
! |
|
8981 |
||
3892 | 8982 |
canReadAbbrevFile |
8983 |
||
5960 | 8984 |
|currentDirectory| |
3892 | 8985 |
|
8986 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 8987 |
currentDirectory := self currentDirectory. |
8988 |
^ currentDirectory notNil |
|
8989 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 8990 |
! |
8991 |
||
8992 |
canRemoveFromSourcePath |
|
8993 |
||
8994 |
^ false |
|
8995 |
! |
|
8996 |
||
13089 | 8997 |
cannotGenerateSignatureFiles |
8998 |
^ self canGenerateSignatureFiles not |
|
8999 |
! |
|
9000 |
||
3892 | 9001 |
hasASN1 |
9002 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 9003 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 9004 |
|
9005 |
! |
|
9006 |
||
9007 |
hasASN1AndSelection |
|
9008 |
^ [ self hasSelection value |
|
17416 | 9009 |
and:[self currentSelectedFiles notEmptyOrNil |
4414 | 9010 |
and:[OSI::ASN1Parser notNil |
9011 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
17416 | 9012 |
|
9013 |
"Modified: / 17-02-2017 / 08:25:09 / cg" |
|
3892 | 9014 |
! |
9015 |
||
9016 |
hasCBrowser |
|
9017 |
^ [ CBrowser::Browser notNil ] |
|
9018 |
! |
|
9019 |
||
9020 |
hasJava |
|
9021 |
||
14298 | 9022 |
^ [ JavaVM notNil |
9023 |
and:[JavaClassReader notNil |
|
9024 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 9025 |
! |
9026 |
||
9027 |
hasJavaAndSelection |
|
9028 |
||
12871 | 9029 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 9030 |
and:[JavaClassReader notNil |
9031 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 9032 |
! |
9033 |
||
9034 |
hasMP3Player |
|
9035 |
||
9036 |
^ [ MP3PlayerApplication notNil |
|
4414 | 9037 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 9038 |
! |
9039 |
||
9040 |
hasMP3PlayerAndSelection |
|
9041 |
||
12871 | 9042 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 9043 |
and:[ self hasMP3Player value]] |
3892 | 9044 |
! |
9045 |
||
8426 | 9046 |
hasResourceFileSelected |
12871 | 9047 |
^ (self currentSelectedFiles) |
9048 |
contains:[:fn | |
|
12811 | 9049 |
fn suffix asLowercase = 'rs' |
9050 |
]. |
|
8426 | 9051 |
! |
9052 |
||
3892 | 9053 |
hasSlideShow |
9054 |
||
9055 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
9056 |
! |
|
9057 |
||
9058 |
hasSnapshotSelection |
|
9059 |
||
9060 |
^ [ |
|
4414 | 9061 |
| files | |
8426 | 9062 |
|
4414 | 9063 |
files := self currentSelectedFiles. |
9064 |
((files size == 1) |
|
9065 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 9066 |
] |
9067 |
! |
|
9068 |
||
7869 | 9069 |
hasXml |
9206 | 9070 |
^ [ XML::XMLParser notNil ] |
7869 | 9071 |
! |
9072 |
||
9073 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
9074 |
"/ 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
|
9075 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 9076 |
|
8426 | 9077 |
^ [ |
9078 |
|sel fileName| |
|
7869 | 9079 |
|
9080 |
sel := self currentSelectedFiles. |
|
9081 |
sel size == 1 ifTrue:[ |
|
9082 |
fileName := sel first. |
|
9083 |
fileName notNil ifTrue:[ |
|
15936 | 9084 |
#('xml' 'xsd' 'vdx') includes:fileName suffix asLowercase |
7869 | 9085 |
] ifFalse:[ |
9086 |
false |
|
9087 |
] |
|
9088 |
] ifFalse:[ |
|
9089 |
false |
|
9090 |
] |
|
9091 |
] |
|
9092 |
! |
|
9093 |
||
3892 | 9094 |
hasZipFileSelected |
17982 | 9095 |
|sel fileName suff mime| |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9096 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9097 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9098 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9099 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9100 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9101 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9102 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9103 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9104 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9105 |
|
17982 | 9106 |
mime := fileName mimeTypeOfContents. |
9107 |
"/ prepare for change (iana has obsoleted the x- types) |
|
9108 |
^ (mime = 'application/x-zip-compressed') or:[mime = 'application/zip'] |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9109 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9110 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9111 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9112 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9113 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9114 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9115 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
9116 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 9117 |
! |
9118 |
||
9119 |
javaSupportLoaded |
|
9120 |
||
9121 |
^ false |
|
9122 |
! ! |
|
9123 |
||
14126 | 9124 |
|
9125 |
||
3906 | 9126 |
!AbstractFileBrowser methodsFor:'presentation'! |
9127 |
||
9128 |
getModeString:modeBits |
|
9129 |
"convert file-mode bits into a more user-friendly string. |
|
9130 |
This is wrong here - should be moved into OperatingSystem." |
|
9131 |
||
9132 |
^ self getModeString:modeBits |
|
4414 | 9133 |
with:#( 'owner:' $r $w $x |
9134 |
' group:' $r $w $x |
|
9135 |
' others:' $r $w $x ) |
|
3906 | 9136 |
! |
9137 |
||
9138 |
getModeString:modeBits with:texts |
|
9139 |
"convert file-mode bits into a more user-friendly string. |
|
9140 |
This is wrong here - should be moved into OperatingSystem." |
|
9141 |
||
9142 |
|bits modeString| |
|
9143 |
||
9144 |
bits := modeBits bitAnd:8r777. |
|
9145 |
modeString := ''. |
|
9146 |
||
9147 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
9148 |
with: texts do:[:bitMask :access | |
|
4414 | 9149 |
|ch| |
9150 |
||
9151 |
bitMask isNil ifTrue:[ |
|
9152 |
modeString := modeString , access |
|
9153 |
] ifFalse:[ |
|
9154 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
9155 |
ch := $- |
|
9156 |
] ifFalse:[ |
|
9157 |
ch := access |
|
9158 |
]. |
|
9159 |
modeString := modeString copyWith:ch |
|
9160 |
] |
|
3906 | 9161 |
]. |
9162 |
^ modeString |
|
9163 |
! ! |
|
9164 |
||
5880 | 9165 |
!AbstractFileBrowser methodsFor:'private'! |
9166 |
||
9167 |
theSingleSelectedDirectoryOrHomeDir |
|
9168 |
|dir| |
|
9169 |
||
5888 | 9170 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 9171 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
9172 |
^ dir. |
|
9173 |
! |
|
9174 |
||
9175 |
theSingleSelectedDirectoryOrNil |
|
9176 |
|dirs| |
|
9177 |
||
9178 |
dirs := self currentSelectedDirectories. |
|
9179 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
9180 |
^ dirs anElement. |
|
14577 | 9181 |
! |
9182 |
||
9183 |
theSingleSelectedFileOrNil |
|
9184 |
|dirs| |
|
9185 |
||
9186 |
dirs := self currentSelectedFiles. |
|
9187 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
9188 |
^ dirs anElement. |
|
5880 | 9189 |
! ! |
9190 |
||
3892 | 9191 |
!AbstractFileBrowser methodsFor:'queries'! |
9192 |
||
8256 | 9193 |
cBrowserLoaded |
9194 |
^ CBrowser::Browser notNil |
|
9195 |
! |
|
9196 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9197 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9198 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9199 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9200 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9201 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
9202 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9203 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9204 |
"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
|
9205 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9206 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9207 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
9208 |
|
3906 | 9209 |
getFileInfoStringForFirstSelectedFile:longInfo |
9210 |
"get stat info on selected file - return a string which can be |
|
9211 |
shown in a box" |
|
9212 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
9213 |
|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
|
9214 |
sizeString fileSize tAccess tModification buffer| |
3906 | 9215 |
|
7560 | 9216 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9217 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 9218 |
filename := selFiles first. |
9219 |
||
8364 | 9220 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9221 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9222 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9223 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9224 |
]. |
8364 | 9225 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
9226 |
buffer := Text writeStream. |
4765 | 9227 |
|
9228 |
buffer |
|
9229 |
nextPutAll:'filename: '; |
|
9230 |
nextPutLine:filename asString. |
|
9231 |
||
8364 | 9232 |
OperatingSystem isMSDOSlike ifTrue: [ |
9233 |
(info alternativeName notNil |
|
9234 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
9235 |
buffer nextPutAll:'shortname: '. |
|
9236 |
buffer nextPutLine:info alternativeName. |
|
9237 |
] |
|
9238 |
]. |
|
9239 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9240 |
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
|
9241 |
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
|
9242 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9243 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9244 |
]. |
4765 | 9245 |
buffer |
9246 |
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
|
9247 |
nextPutLine:(info path ? '???'). |
3906 | 9248 |
] 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
|
9249 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9250 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9251 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9252 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9253 |
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
|
9254 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9255 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9256 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9257 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9258 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9259 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
9260 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9261 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9262 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9263 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9264 |
fileSize > 1024 ifTrue:[ |
8172 | 9265 |
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
|
9266 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
9267 |
]. |
4765 | 9268 |
buffer nextPutLine:sizeString. |
3906 | 9269 |
|
9270 |
modeBits := info mode. |
|
9271 |
modeString := self getModeString:modeBits. |
|
4765 | 9272 |
|
9273 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 9274 |
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
|
9275 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 9276 |
]. |
4765 | 9277 |
buffer |
9278 |
cr; |
|
9279 |
nextPutAll:'owner: '; |
|
9280 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
9281 |
||
3906 | 9282 |
longInfo ifTrue:[ |
4765 | 9283 |
buffer |
9284 |
nextPutAll:'group: '; |
|
9285 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
9286 |
||
9287 |
tAccess := info accessTime. |
|
9288 |
buffer |
|
9289 |
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
|
9290 |
nextPutAll:tAccess asDate printString; |
4765 | 9291 |
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
|
9292 |
nextPutLine:tAccess asTime printString. |
4765 | 9293 |
|
9294 |
tModification := info modificationTime. |
|
9295 |
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
|
9296 |
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
|
9297 |
nextPutAll:tModification asDate printString; |
4765 | 9298 |
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
|
9299 |
nextPutLine:tModification asTime printString. |
3906 | 9300 |
]. |
4765 | 9301 |
^ buffer contents |
7560 | 9302 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
9303 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 9304 |
! |
9305 |
||
8510 | 9306 |
hasImageColorHistogram |
9307 |
^ ImageColorHistogram notNil |
|
9308 |
! |
|
9309 |
||
17686 | 9310 |
hasImageHistogram |
9311 |
^ ImageAlgorithms notNil |
|
9312 |
||
9313 |
"Created: / 10-09-2017 / 16:50:34 / cg" |
|
9314 |
! |
|
9315 |
||
10258 | 9316 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
9317 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 9318 |
|
9319 |
"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
|
9320 |
"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
|
9321 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 9322 |
! |
9323 |
||
3892 | 9324 |
initialCommandFor:fileName into:aBox |
9325 |
"set a useful initial command for execute box." |
|
9326 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
9327 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 9328 |
! |
9329 |
||
9330 |
isAbstractFileBrowser |
|
9331 |
||
9332 |
^ true |
|
9333 |
! |
|
9334 |
||
9335 |
systemIsDOS |
|
9336 |
^ OperatingSystem isMSDOSlike |
|
9337 |
! |
|
9338 |
||
12473 | 9339 |
systemIsOSX |
9340 |
^ OperatingSystem isOSXlike |
|
9341 |
! |
|
9342 |
||
3892 | 9343 |
systemIsUnix |
9344 |
^ OperatingSystem isUNIXlike |
|
14980 | 9345 |
! |
9346 |
||
9347 |
systemSupportsVolumes |
|
9348 |
^ OperatingSystem supportsVolumes |
|
3892 | 9349 |
! ! |
9350 |
||
9351 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
9352 |
||
9353 |
allItemsOfCurrentDirectory |
|
5009 | 9354 |
self |
4774 | 9355 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 9356 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
9357 |
||
9358 |
^ nil |
|
3892 | 9359 |
! |
9360 |
||
9361 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 9362 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
9363 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
9364 |
(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
|
9365 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 9366 |
]. |
9367 |
^ false. |
|
9368 |
! |
|
9369 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9370 |
commonPrefixOfSelectedFiles |
4773 | 9371 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9372 |
|
7560 | 9373 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9374 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9375 |
|
17865 | 9376 |
stringCol := selFiles collect:#asString. |
4773 | 9377 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9378 |
stringCol from:2 do:[:el| |
4773 | 9379 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9380 |
]. |
4773 | 9381 |
^ firstPre asFilename |
7560 | 9382 |
|
9383 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9384 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
9385 |
|
12481 | 9386 |
compressTabsOnSave |
9387 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
9388 |
when saving. |
|
9389 |
Default is true" |
|
9390 |
||
9391 |
^ true |
|
9392 |
! |
|
9393 |
||
3892 | 9394 |
currentFilesAreInSameDirectory |
9395 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9396 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 9397 |
! |
9398 |
||
9399 |
currentFilesHasDirectories |
|
9400 |
||
6725 | 9401 |
^ self currentSelectedDirectories notEmpty. |
3892 | 9402 |
! |
9403 |
||
3982 | 9404 |
directoriesForFiles:aFileCol |
11743 | 9405 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 9406 |
! |
9407 |
||
3892 | 9408 |
fileListIsEmpty |
5009 | 9409 |
self |
9410 |
applicationNamed:#DirectoryContentsBrowser |
|
9411 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
9412 |
||
9413 |
^ nil. |
|
3892 | 9414 |
! |
9415 |
||
9416 |
fileListIsNotEmpty |
|
9417 |
||
9418 |
^ self fileListIsEmpty not. |
|
9419 |
! |
|
9420 |
||
9421 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 9422 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 9423 |
|
9424 |
| file1 file2 | |
|
9425 |
||
6284 | 9426 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 9427 |
file1 := aFilename1 asFilename. |
9428 |
file2 := aFilename2 asFilename. |
|
6284 | 9429 |
|
3892 | 9430 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 9431 |
|
3892 | 9432 |
((file1 isDirectory) |
9433 |
and:[(file2 isDirectory) |
|
9434 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 9435 |
^ file1 baseName = file2 baseName |
3892 | 9436 |
]. |
3982 | 9437 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 9438 |
! |
9439 |
||
9440 |
getAllFilesAsStringCollection |
|
5009 | 9441 |
self |
9442 |
applicationNamed:#DirectoryContentsBrowser |
|
9443 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
9444 |
||
9445 |
^ nil |
|
3892 | 9446 |
! |
9447 |
||
9448 |
getBestDirectory |
|
17868 | 9449 |
"from a set of directories, return the common parent directory" |
9450 |
||
9451 |
^ self class getBestDirectoryFrom:(self currentSelectedDirectories) |
|
3892 | 9452 |
! |
9453 |
||
9454 |
getDirWithoutFileName:aFileName |
|
9455 |
||
9456 |
| dir | |
|
9457 |
aFileName isNil ifTrue:[ |
|
4414 | 9458 |
^ aFileName. |
3892 | 9459 |
]. |
9460 |
dir := aFileName asFilename. |
|
9461 |
dir isDirectory ifFalse:[ |
|
4414 | 9462 |
dir := dir directory. |
3892 | 9463 |
]. |
9464 |
^ dir. |
|
9465 |
! |
|
9466 |
||
9467 |
getInfoItem |
|
9468 |
"get filename of a description-file (.dir.info, README etc.); |
|
16778 | 9469 |
This file is automatically shown when a directory is entered. |
3892 | 9470 |
You can add more names below if you like." |
9471 |
||
5880 | 9472 |
|dir| |
9473 |
||
9474 |
dir := self theSingleSelectedDirectoryOrNil. |
|
9475 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 9476 |
|
16778 | 9477 |
#( |
3892 | 9478 |
'.dir.info' |
9479 |
'README' |
|
9480 |
'ReadMe' |
|
9481 |
'Readme' |
|
9482 |
'readme' |
|
9483 |
'read.me' |
|
9484 |
'Read.me' |
|
9485 |
'READ.ME' |
|
9486 |
'README.TXT' |
|
15915 | 9487 |
'README.txt' |
3892 | 9488 |
'readme.txt' |
9489 |
'Readme.txt' |
|
9490 |
'Info.txt' |
|
9491 |
'info.txt' |
|
9492 |
'INFO.TXT' |
|
15915 | 9493 |
'INFO.txt' |
16778 | 9494 |
) do:[:f | |
5883 | 9495 |
|n| |
4414 | 9496 |
|
5880 | 9497 |
n := dir construct:f. |
4414 | 9498 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
9499 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
9500 |
] |
|
3892 | 9501 |
]. |
9502 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9503 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9504 |
|
12497 | 9505 |
hasPackageDirectorySelected |
9506 |
|dir| |
|
9507 |
||
9508 |
dir := self currentDirectory. |
|
9509 |
^ dir notNil |
|
9510 |
and:[ dir exists |
|
9511 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
9512 |
! |
|
9513 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
9514 |
parentDirectoriesOfCurrentFiles |
11743 | 9515 |
^ self currentSelectedObjects |
9516 |
collect:[:file | file directory] as:Set |
|
7560 | 9517 |
|
9518 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 9519 |
! |
9520 |
||
9521 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 9522 |
^ true. "/ the code below is too slow for a menu enabling operation |
9523 |
||
9524 |
"/ |directories| |
|
9525 |
"/ |
|
9526 |
"/ directories := self currentDirectories value. |
|
9527 |
"/ directories do:[:dir| |
|
9528 |
"/ [ |
|
9529 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
9530 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
9531 |
"/ ] |
|
9532 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
9533 |
"/ ]. |
|
9534 |
"/ ^ false. |
|
6586 | 9535 |
! |
9536 |
||
9537 |
recursiveAnySTFilesPresent |
|
9538 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 9539 |
! ! |
9540 |
||
9541 |
!AbstractFileBrowser methodsFor:'selection'! |
|
9542 |
||
9543 |
currentSelectedDirectories |
|
6725 | 9544 |
^ self currentDirectoriesValue. |
3982 | 9545 |
! |
9546 |
||
9547 |
currentSelectedFiles |
|
17865 | 9548 |
^ self currentSelectedObjects reject:#isDirectory. |
7560 | 9549 |
|
9550 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 9551 |
! |
9552 |
||
6460 | 9553 |
currentSelectedObjects |
9554 |
^ self currentFileNameHolder value |
|
9555 |
! |
|
9556 |
||
3982 | 9557 |
firstSelectedFile |
7560 | 9558 |
^ self currentSelectedObjects |
12102 | 9559 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9560 |
ifNone:[]. |
7560 | 9561 |
|
9562 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 9563 |
! |
9564 |
||
9490 | 9565 |
hasOnlyDirectoriesSelected |
9566 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
9567 |
||
9568 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
9569 |
! |
|
9570 |
||
4414 | 9571 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9572 |
|
7560 | 9573 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
9574 |
||
9575 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 9576 |
! |
9577 |
||
9490 | 9578 |
hasTwoDirectoriesSelected |
9579 |
||
9580 |
^ self currentSelectedObjects size == 2 |
|
9581 |
and:[self hasOnlyDirectoriesSelected] |
|
9582 |
||
9583 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
9584 |
! |
|
9585 |
||
4414 | 9586 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9587 |
|
7560 | 9588 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9589 |
and:[self hasOnlyFilesSelected] |
7560 | 9590 |
|
9591 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
14577 | 9592 |
! |
9593 |
||
9594 |
selectNextFile |
|
9595 |
self |
|
9596 |
applicationNamed:#DirectoryContentsBrowser |
|
9597 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectNextFile ]]. |
|
9598 |
! |
|
9599 |
||
9600 |
selectPreviousFile |
|
9601 |
self |
|
9602 |
applicationNamed:#DirectoryContentsBrowser |
|
9603 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectPreviousFile ]]. |
|
3892 | 9604 |
! ! |
9605 |
||
3964 | 9606 |
!AbstractFileBrowser methodsFor:'sorting'! |
9607 |
||
3989 | 9608 |
currentSortOrder |
17790 | 9609 |
^ self |
9610 |
aspectFor:#currentSortOrder |
|
9611 |
ifAbsent:[ |
|
9612 |
(Dictionary new |
|
9613 |
at:#column put:nil; |
|
9614 |
at:#reverse put:false; |
|
9615 |
at:#sortCaseless put:false; |
|
9616 |
yourself |
|
9617 |
) asValue |
|
9618 |
]. |
|
9619 |
||
9620 |
"Modified: / 25-11-2017 / 17:43:00 / cg" |
|
3989 | 9621 |
! |
9622 |
||
9623 |
sortBlockHolder |
|
9624 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 9625 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9626 |
selector:#fileName |
|
9627 |
sortCaseless:self sortCaseless value |
|
9628 |
sortReverse:false) asValue. |
|
3989 | 9629 |
]. |
9630 |
! |
|
9631 |
||
9632 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9633 |
|v| |
4027 | 9634 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9635 |
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
|
9636 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9637 |
^ v. |
3989 | 9638 |
! |
9639 |
||
9640 |
sortCaseless |
|
4201 | 9641 |
" aspect for sort caseless " |
3989 | 9642 |
|
13000 | 9643 |
^ self |
9644 |
aspectFor:#sortCaseless |
|
9645 |
ifAbsent:[ (Filename isCaseSensitive not) asValue ] |
|
3989 | 9646 |
! |
9647 |
||
4074 | 9648 |
sortDirectoriesBeforeFiles |
9649 |
||
4201 | 9650 |
" aspect for sort directories always before files" |
4074 | 9651 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
9652 |
! |
|
9653 |
||
3989 | 9654 |
sortFileListsBy:instanceName |
9655 |
||
9656 |
self sortFileListsBy:instanceName withReverse:true |
|
9657 |
! |
|
9658 |
||
9659 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
9660 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 9661 |
|
9662 |
aSymbol := instanceName asSymbol. |
|
4027 | 9663 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 9664 |
sortCaselessLocal := self sortCaseless value. |
4027 | 9665 |
currentSortOrder := self currentSortOrder value. |
17790 | 9666 |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9667 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9668 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 9669 |
currentSortOrder at:#column put:aSymbol. |
9670 |
currentSortOrder at:#reverse put:false. |
|
9671 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 9672 |
] ifFalse:[ |
4343 | 9673 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
9674 |
"/ sort caseless changed |
|
9675 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
9676 |
] ifFalse:[ |
|
9677 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
9678 |
"/ same column like before - change sort order ifReverse is true |
|
9679 |
aBoolean ifTrue:[ |
|
9680 |
isReverse := currentSortOrder at:#reverse. |
|
9681 |
currentSortOrder at:#reverse put:(isReverse not). |
|
9682 |
]. |
|
9683 |
] ifFalse:[ |
|
9684 |
"/ another column - remark column |
|
9685 |
currentSortOrder at:#column put:aSymbol. |
|
9686 |
] |
|
9687 |
] |
|
3964 | 9688 |
]. |
4027 | 9689 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9690 |
|
5383 | 9691 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9692 |
selector:instanceName |
|
9693 |
sortCaseless:sortCaselessLocal |
|
9694 |
sortReverse:(currentSortOrder at:#reverse). |
|
9695 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9696 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9697 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
17790 | 9698 |
"Modified (format): / 25-11-2017 / 17:43:31 / cg" |
3964 | 9699 |
! ! |
9700 |
||
3892 | 9701 |
!AbstractFileBrowser methodsFor:'startup & release'! |
9702 |
||
16720 | 9703 |
initializeAspects |
9704 |
aspects := IdentityDictionary new. |
|
9705 |
aspects at:#applications put:(IdentityDictionary new). |
|
9706 |
! |
|
9707 |
||
3892 | 9708 |
makeDependent |
4074 | 9709 |
self filterModel addDependent:self. |
4004 | 9710 |
self currentFileNameHolder addDependent:self. |
4074 | 9711 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 9712 |
self sortCaseless addDependent:self. |
4011 | 9713 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
9714 |
self rootHolder addDependent:self. |
3892 | 9715 |
! |
9716 |
||
9717 |
masterApplication:anApplication |
|
9718 |
||
9719 |
masterApplication isNil ifTrue:[ |
|
4414 | 9720 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
9721 |
aspects := anApplication aspects |
|
9722 |
] ifFalse:[ |
|
9723 |
aspects isNil ifTrue:[ |
|
16721 | 9724 |
self initializeAspects. |
4414 | 9725 |
] |
9726 |
]. |
|
9727 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9728 |
"/ self makeDependent. |
3892 | 9729 |
]. |
3952 | 9730 |
^ super masterApplication:anApplication. |
3892 | 9731 |
! |
9732 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9733 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9734 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9735 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9736 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9737 |
|
3892 | 9738 |
postOpenWith:aBuilder |
9739 |
||
9740 |
super postOpenWith:aBuilder. |
|
14655 | 9741 |
"/ now done for all windowGroups by the group itself |
9742 |
"/ self windowGroup showWaitCursorWhenBusyForMillis:100. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9743 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9744 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 9745 |
! ! |
9746 |
||
9747 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
9748 |
||
9749 |
files |
|
9750 |
"return the value of the instance variable 'files' (automatically generated)" |
|
9751 |
||
9752 |
^ files |
|
9753 |
! |
|
9754 |
||
9755 |
files:something |
|
9756 |
"set the value of the instance variable 'files' (automatically generated)" |
|
9757 |
||
9758 |
files := something. |
|
9759 |
! |
|
9760 |
||
9761 |
method |
|
9762 |
"return the value of the instance variable 'method' (automatically generated)" |
|
9763 |
||
9764 |
^ method |
|
9765 |
! |
|
9766 |
||
9767 |
method:something |
|
9768 |
"set the value of the instance variable 'method' (automatically generated)" |
|
9769 |
||
9770 |
method := something. |
|
9771 |
! ! |
|
9772 |
||
9773 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
9774 |
||
9775 |
locked |
|
9776 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
9777 |
||
9778 |
locked isNil ifTrue:[ |
|
4414 | 9779 |
locked := false. |
3892 | 9780 |
]. |
9781 |
^ locked |
|
9782 |
! ! |
|
9783 |
||
9784 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
9785 |
||
9786 |
doIfUnLocked:aBlock |
|
9787 |
||
9788 |
self locked ifFalse:[ |
|
4414 | 9789 |
aBlock value. |
3892 | 9790 |
]. |
9791 |
! |
|
9792 |
||
9793 |
doLocked:aBlock |
|
9794 |
||
9795 |
locked := true. |
|
4004 | 9796 |
aBlock ensure:[ |
4414 | 9797 |
locked := false. |
4004 | 9798 |
] |
3892 | 9799 |
! ! |
9800 |
||
3952 | 9801 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
9802 |
||
6369 | 9803 |
defaultHistorySize |
9804 |
^ 50 |
|
3892 | 9805 |
! ! |
9806 |
||
6371 | 9807 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 9808 |
|
9809 |
new |
|
6371 | 9810 |
^ (super new) initializeHistory. |
6369 | 9811 |
! ! |
9812 |
||
9813 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
9814 |
||
9815 |
historySize |
|
9816 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
9817 |
^ historySize |
|
9818 |
! |
|
9819 |
||
9820 |
historySize:aNumber |
|
9821 |
historySize := aNumber |
|
4032 | 9822 |
! ! |
9823 |
||
3892 | 9824 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
9825 |
||
3952 | 9826 |
addToHistory:aPath |
15803 | 9827 |
| item pathToAdd sep| |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9828 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9829 |
pathToAdd := aPath. |
15803 | 9830 |
(pathToAdd endsWith:(sep := Filename separator)) ifTrue:[ |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9831 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
15803 | 9832 |
pathToAdd := pathToAdd copyButLast:(sep asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9833 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9834 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9835 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9836 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9837 |
self backForwardListAdd:pathToAdd. |
3952 | 9838 |
item isNil ifTrue:[ |
4347 | 9839 |
" not already in history" |
6369 | 9840 |
self size >= self historySize ifTrue:[ |
4347 | 9841 |
self removeLast. |
9842 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9843 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 9844 |
] ifFalse:[ |
4347 | 9845 |
"already been there before; move the entry to |
9846 |
the beginning, so it will fall out later." |
|
9847 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9848 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9849 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9850 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9851 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 9852 |
! |
9853 |
||
4347 | 9854 |
backForwardListAdd:aPath |
9855 |
|pathIndex| |
|
9856 |
||
9857 |
pathIndex := backForwardList indexOf:aPath. |
|
9858 |
pathIndex == 0 ifTrue:[ |
|
9859 |
" a new path comes in remove forward paths " |
|
9860 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
9861 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
9862 |
]. |
|
9863 |
] ifFalse:[ |
|
9864 |
backForwardList remove:aPath. |
|
9865 |
pathIndex <= backForwardIndex ifTrue:[ |
|
9866 |
backForwardIndex := backForwardIndex - 1. |
|
9867 |
] |
|
4022 | 9868 |
]. |
4347 | 9869 |
backForwardList add:aPath afterIndex:backForwardIndex. |
9870 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 9871 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 9872 |
backForwardList removeFirst. |
9873 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 9874 |
]. |
4347 | 9875 |
! |
9876 |
||
9877 |
goBackward |
|
4288 | 9878 |
"return the first path of the backward list; |
9879 |
remove it from the back list and add it ti the forward list." |
|
4022 | 9880 |
|
4347 | 9881 |
|retPath| |
9882 |
||
9883 |
self canBackward ifTrue:[ |
|
9884 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
9885 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 9886 |
]. |
4022 | 9887 |
^ retPath. |
9888 |
! |
|
9889 |
||
9890 |
goForward |
|
4288 | 9891 |
"return the first path of the forward list; |
9892 |
remove it from the list." |
|
4022 | 9893 |
|
4347 | 9894 |
|retPath| |
9895 |
||
9896 |
self canForward ifTrue:[ |
|
9897 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9898 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9899 |
]. |
4022 | 9900 |
^ retPath. |
9901 |
! |
|
9902 |
||
9903 |
resetForwardBackward |
|
9904 |
||
4347 | 9905 |
self initialize |
4022 | 9906 |
! |
9907 |
||
9908 |
setPosition:aPosition for:aPath |
|
9909 |
||
9910 |
self do:[:item| |
|
4414 | 9911 |
item path = aPath ifTrue:[ |
9912 |
item position:aPosition. |
|
9913 |
] |
|
4022 | 9914 |
]. |
3892 | 9915 |
! ! |
9916 |
||
4870 | 9917 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9918 |
|
6371 | 9919 |
initializeHistory |
4032 | 9920 |
|
4347 | 9921 |
backForwardList := OrderedCollection new. |
9922 |
self reverseDo:[:el| |
|
9923 |
backForwardList add:el path. |
|
9924 |
]. |
|
9925 |
backForwardIndex := backForwardList size. |
|
4032 | 9926 |
! ! |
9927 |
||
3892 | 9928 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9929 |
||
4288 | 9930 |
canBackward |
4347 | 9931 |
|
9932 |
^ backForwardIndex > 1 |
|
4288 | 9933 |
! |
9934 |
||
3892 | 9935 |
canForward |
4347 | 9936 |
|
9937 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9938 |
! |
|
9939 |
||
9940 |
getBackCollection |
|
9941 |
||
9942 |
| backCol | |
|
9943 |
||
9944 |
backCol := OrderedCollection new. |
|
9945 |
self canBackward ifTrue:[ |
|
9946 |
| tmpCol | |
|
9947 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9948 |
tmpCol reverseDo:[ :el| |
|
9949 |
backCol add:el. |
|
9950 |
] |
|
9951 |
]. |
|
9952 |
^ backCol |
|
3952 | 9953 |
! |
9954 |
||
9955 |
getForwardCollection |
|
9956 |
||
4347 | 9957 |
| forwCol | |
9958 |
||
9959 |
forwCol := OrderedCollection new. |
|
9960 |
self canForward ifTrue:[ |
|
9961 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9962 |
]. |
|
9963 |
^ forwCol |
|
3952 | 9964 |
! |
9965 |
||
9966 |
getItemFor:aPath |
|
6627 | 9967 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9968 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9969 |
"/ ^ nil. |
|
3952 | 9970 |
! |
9971 |
||
9972 |
getPositionFor:aPath |
|
9973 |
||
9974 |
|item| |
|
9975 |
||
9976 |
item := self getItemFor:aPath. |
|
9977 |
||
9978 |
item notNil ifTrue:[ |
|
4414 | 9979 |
^ item position. |
3952 | 9980 |
]. |
9981 |
^ nil |
|
9982 |
! |
|
9983 |
||
9984 |
includesPath:aPath |
|
6627 | 9985 |
^ self contains:[:item | item path = aPath]. |
9986 |
||
9987 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
9988 |
"/ ^ false. |
|
4347 | 9989 |
! |
9990 |
||
9991 |
nextBackwardItem |
|
9992 |
"return the first path of the backward list" |
|
9993 |
||
9994 |
|retPath| |
|
9995 |
||
9996 |
self canBackward ifTrue:[ |
|
9997 |
retPath := backForwardList at:backForwardIndex. |
|
9998 |
]. |
|
9999 |
^ retPath. |
|
10000 |
! |
|
10001 |
||
10002 |
nextForwardItem |
|
10003 |
"return the first path of the forward list" |
|
10004 |
||
10005 |
|retPath| |
|
10006 |
||
10007 |
self canForward ifTrue:[ |
|
10008 |
retPath := backForwardList at:backForwardIndex + 1. |
|
10009 |
]. |
|
10010 |
^ retPath. |
|
3952 | 10011 |
! ! |
10012 |
||
10013 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
10014 |
||
10015 |
path:aPath |
|
10016 |
||
10017 |
^ self new path:aPath |
|
10018 |
! ! |
|
10019 |
||
10020 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
10021 |
||
6433 | 10022 |
asFilename |
10023 |
^ path asFilename |
|
10024 |
! |
|
10025 |
||
3952 | 10026 |
path |
10027 |
"return the value of the instance variable 'path' (automatically generated)" |
|
10028 |
||
10029 |
^ path |
|
10030 |
! |
|
10031 |
||
10032 |
path:something |
|
10033 |
"set the value of the instance variable 'path' (automatically generated)" |
|
10034 |
||
10035 |
path := something. |
|
10036 |
! |
|
10037 |
||
10038 |
position |
|
10039 |
"return the value of the instance variable 'position' (automatically generated)" |
|
10040 |
||
10041 |
^ position |
|
10042 |
! |
|
10043 |
||
10044 |
position:something |
|
10045 |
"set the value of the instance variable 'position' (automatically generated)" |
|
10046 |
||
10047 |
position := something. |
|
10048 |
! |
|
10049 |
||
10050 |
printString |
|
10051 |
||
10052 |
^ self path asString |
|
3892 | 10053 |
! ! |
10054 |
||
10055 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
10056 |
||
10057 |
withValue:aValue isHolder:aBoolean |
|
10058 |
||
10059 |
| instance | |
|
10060 |
||
10061 |
instance := self basicNew. |
|
10062 |
instance value:aValue. |
|
10063 |
instance isHolder:aBoolean. |
|
10064 |
^ instance |
|
10065 |
! ! |
|
10066 |
||
10067 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
10068 |
||
10069 |
isHolder |
|
10070 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
10071 |
||
10072 |
^ isHolder |
|
10073 |
! |
|
10074 |
||
10075 |
isHolder:something |
|
10076 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
10077 |
||
10078 |
isHolder := something. |
|
10079 |
! |
|
10080 |
||
10081 |
value |
|
10082 |
"return the value of the instance variable 'value' (automatically generated)" |
|
10083 |
||
10084 |
^ value |
|
10085 |
! |
|
10086 |
||
10087 |
value:something |
|
10088 |
"set the value of the instance variable 'value' (automatically generated)" |
|
10089 |
||
10090 |
value := something. |
|
10091 |
! ! |
|
10092 |
||
10093 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
10094 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10095 |
version |
15803 | 10096 |
^ '$Header$' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10097 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
10098 |
|
8832 | 10099 |
version_CVS |
15803 | 10100 |
^ '$Header$' |
3892 | 10101 |
! ! |
12094 | 10102 |