author | Claus Gittinger <cg@exept.de> |
Tue, 28 May 2013 12:34:21 +0200 | |
changeset 12777 | 0221a2b95d8c |
parent 12760 | 4416657efa36 |
child 12807 | ba8c5416aa28 |
child 12811 | ffdf97bbca6e |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3892 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
ApplicationModel subclass:#AbstractFileBrowser |
|
4959 | 15 |
instanceVariableNames:'aspects' |
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
16 |
classVariableNames:'VisitedDirectories RuntimeAspects DirectoryBookmarks |
4959 | 17 |
LastEnforcedNameSpace CommandHistory DefaultCommandPerSuffix |
18 |
CommandHistorySize LastFileDiffFile DefaultFilters RootHolder |
|
10306 | 19 |
LastFileSelection LastMoveDestination LastScriptBlockString |
11139 | 20 |
LastMustMatchPattern LastFileDiffDirectory |
21 |
LastMercurialRepository' |
|
4959 | 22 |
poolDictionaries:'' |
23 |
category:'Interface-Tools-File' |
|
3892 | 24 |
! |
25 |
||
26 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
27 |
||
28 |
" |
|
29 |
The following class instance variables are inherited by this class: |
|
30 |
||
4959 | 31 |
ApplicationModel - ClassResources |
32 |
Model - |
|
33 |
Object - |
|
3892 | 34 |
" |
35 |
! |
|
36 |
||
37 |
Object subclass:#Clipboard |
|
4959 | 38 |
instanceVariableNames:'method files' |
39 |
classVariableNames:'' |
|
40 |
poolDictionaries:'' |
|
41 |
privateIn:AbstractFileBrowser |
|
3892 | 42 |
! |
43 |
||
44 |
Object subclass:#CodeExecutionLock |
|
4959 | 45 |
instanceVariableNames:'locked' |
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
privateIn:AbstractFileBrowser |
|
3892 | 49 |
! |
50 |
||
4366 | 51 |
List subclass:#DirectoryHistory |
4959 | 52 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
6369 | 53 |
backForwardList backForwardIndex historySize' |
4959 | 54 |
classVariableNames:'HistorySize' |
55 |
poolDictionaries:'' |
|
56 |
privateIn:AbstractFileBrowser |
|
3952 | 57 |
! |
58 |
||
59 |
Object subclass:#DirectoryHistoryItem |
|
4959 | 60 |
instanceVariableNames:'path position' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 64 |
! |
65 |
||
66 |
Object subclass:#SaveAspectItem |
|
4959 | 67 |
instanceVariableNames:'value isHolder' |
68 |
classVariableNames:'' |
|
69 |
poolDictionaries:'' |
|
70 |
privateIn:AbstractFileBrowser |
|
3892 | 71 |
! |
72 |
||
5140 | 73 |
!AbstractFileBrowser class methodsFor:'documentation'! |
74 |
||
75 |
copyright |
|
76 |
" |
|
77 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
78 |
All Rights Reserved |
|
79 |
||
80 |
This software is furnished under a license and may be used |
|
81 |
only in accordance with the terms of that license and with the |
|
82 |
inclusion of the above copyright notice. This software may not |
|
83 |
be provided or otherwise made available to, or used by, any |
|
84 |
other person. No title to or ownership of the software is |
|
85 |
hereby transferred. |
|
86 |
" |
|
5967 | 87 |
! |
88 |
||
89 |
documentation |
|
90 |
" |
|
91 |
[Author:] |
|
92 |
Christian Penk |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
93 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
94 |
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
|
95 |
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
|
96 |
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
|
97 |
and as a container is almost incomprehensable... |
5967 | 98 |
" |
5140 | 99 |
! ! |
3892 | 100 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
101 |
!AbstractFileBrowser class methodsFor:'accessing'! |
3952 | 102 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
103 |
currentSelection |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
104 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
105 |
LastFileSelection isNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
106 |
LastFileSelection := #(). |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
107 |
]. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
108 |
^ LastFileSelection |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
109 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
110 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
111 |
currentSelection:aFilenameCol |
6589 | 112 |
aFilenameCol notEmptyOrNil ifTrue:[ |
12102 | 113 |
LastFileSelection := aFilenameCol collect:[:file | (file ? '') asFilename] |
6589 | 114 |
] |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
115 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
116 |
|
3952 | 117 |
directoryHistory |
118 |
||
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
119 |
VisitedDirectories isNil ifTrue:[ |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
120 |
VisitedDirectories := self directoryHistoryClass new. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
121 |
"/ VisitedDirectories inspect. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
122 |
]. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
123 |
^ VisitedDirectories |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
124 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
125 |
"Modified: / 21-11-2012 / 08:45:49 / cg" |
3952 | 126 |
! |
127 |
||
128 |
resetClassVars |
|
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
129 |
VisitedDirectories := nil. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
130 |
LastFileSelection := nil. |
5936 | 131 |
|
132 |
" |
|
133 |
AbstractFileBrowser resetClassVars |
|
134 |
" |
|
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
135 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
136 |
"Modified: / 21-11-2012 / 08:45:53 / cg" |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
137 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
138 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
139 |
rootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
140 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
141 |
^ RootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
142 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
143 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
144 |
rootHolder:aRoot |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
145 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
146 |
RootHolder := aRoot |
3952 | 147 |
! ! |
148 |
||
4915 | 149 |
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
150 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
151 |
addBookmark:aDirectoryPath |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
152 |
"add aDirectoryPath to the list of our known bookmarks. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
153 |
Do not add duplicates." |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
154 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
155 |
|bookmarks| |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
156 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
157 |
bookmarks := self directoryBookmarks. |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
158 |
(bookmarks includes:aDirectoryPath) ifFalse:[ |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
159 |
bookmarks add:aDirectoryPath asFilename. |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
160 |
]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
161 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
162 |
|
8013 | 163 |
bookmarksFrom:aFileNameOrString |
12390 | 164 |
|bookmarks s fileName line| |
8013 | 165 |
|
166 |
fileName := aFileNameOrString asFilename. |
|
167 |
[ |
|
168 |
s := fileName readStream. |
|
169 |
] on:OpenError do:[:ex| |
|
170 |
^ nil. |
|
171 |
]. |
|
172 |
||
173 |
bookmarks := OrderedCollection new. |
|
174 |
[s atEnd] whileFalse:[ |
|
12390 | 175 |
line := s nextLine. |
176 |
(line startsWith:';') ifFalse:[ |
|
177 |
bookmarks add:(Base64Coder decode:line) asString. |
|
178 |
] |
|
8013 | 179 |
]. |
180 |
s close. |
|
181 |
||
182 |
^ bookmarks |
|
183 |
! |
|
184 |
||
4679 | 185 |
defaultBookMarksFileDirectory |
12390 | 186 |
"the directory, where the default bookmarks are stored (as defaultBookMarksFilename)" |
187 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
188 |
^ Filename homeDirectory |
4679 | 189 |
! |
190 |
||
191 |
defaultBookMarksFilename |
|
12390 | 192 |
"the filename, in which the default bookmarks are stored (in defaultBookMarksDirectory)" |
193 |
||
4679 | 194 |
^ '.fileBrowserBookmarks' |
195 |
! |
|
196 |
||
197 |
directoryBookmarks |
|
198 |
DirectoryBookmarks isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
199 |
self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename). |
4679 | 200 |
|
201 |
DirectoryBookmarks isEmptyOrNil ifTrue:[ |
|
202 |
DirectoryBookmarks := OrderedCollection new. |
|
203 |
DirectoryBookmarks add:Filename homeDirectory asAbsoluteFilename. |
|
204 |
DirectoryBookmarks add:Filename currentDirectory asAbsoluteFilename. |
|
205 |
] |
|
206 |
]. |
|
207 |
^ DirectoryBookmarks |
|
208 |
||
209 |
" |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
210 |
DirectoryBookmarks := nil. |
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
211 |
self directoryBookmarks. |
4679 | 212 |
" |
213 |
! |
|
214 |
||
8013 | 215 |
directoryBookmarks: collectionOfFilenames |
216 |
||
217 |
DirectoryBookmarks := collectionOfFilenames. |
|
218 |
self saveBookmarksInDefaultBookmarksFile. |
|
219 |
! |
|
220 |
||
221 |
editBookmarksWithDefault: aFilenameOrNil |
|
222 |
| oldBookmarks newBookmarks | |
|
223 |
||
224 |
oldBookmarks := self directoryBookmarks copy. |
|
225 |
newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil. |
|
226 |
newBookmarks isNil ifTrue:[^ self]. |
|
227 |
self directoryBookmarks: newBookmarks. |
|
9681
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
228 |
|
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
229 |
"Modified: / 13-01-2011 / 12:52:28 / cg" |
8013 | 230 |
! |
231 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
232 |
hasBookmarks |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
233 |
^ self directoryBookmarks notEmptyOrNil |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
234 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
235 |
|
4679 | 236 |
loadBookmarksFrom:aFileNameOrString |
8013 | 237 |
|bookmarks| |
238 |
||
239 |
bookmarks := self bookmarksFrom: aFileNameOrString. |
|
240 |
bookmarks isNil ifTrue:[^ self]. |
|
4679 | 241 |
|
242 |
DirectoryBookmarks := OrderedCollection new. |
|
243 |
bookmarks do:[:eachPath | |
|
244 |
self addBookmark:eachPath asFilename |
|
245 |
]. |
|
246 |
! |
|
247 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
248 |
removeBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
249 |
|bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
250 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
251 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
252 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
253 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
254 |
bookmarks remove:aDirectoryPath ifAbsent:[]. |
4679 | 255 |
! |
256 |
||
257 |
saveBookmarks |
|
258 |
|fn| |
|
259 |
||
260 |
fn := Dialog |
|
9607 | 261 |
requestFileNameForSave:(self resources string:'Save Bookmarks') |
4679 | 262 |
default:(self defaultBookMarksFilename) |
263 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
264 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
265 |
||
266 |
self saveBookmarksIn:fn |
|
9607 | 267 |
|
268 |
"Modified: / 27-10-2010 / 11:27:09 / cg" |
|
4679 | 269 |
! |
270 |
||
8013 | 271 |
saveBookmarks: bookmarks in:aFileNameOrString |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
272 |
"save the bokmarks in aFileNameOrString. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
273 |
Use Base64 coding" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
274 |
|
8013 | 275 |
| bookmarkStream fileName coder| |
4679 | 276 |
|
277 |
fileName := aFileNameOrString asFilename. |
|
278 |
fileName exists ifTrue:[ |
|
279 |
fileName renameTo:(fileName withSuffix:'sav'). |
|
280 |
]. |
|
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
281 |
bookmarkStream := fileName writeStream. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
282 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
283 |
"save each bookmark in one line" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
284 |
coder := (Base64Coder on:bookmarkStream) lineLimit:nil. |
4679 | 285 |
bookmarks do:[:eachPath | |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
286 |
eachPath asFilename pathName acceptVisitor:coder. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
287 |
coder flush. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
288 |
bookmarkStream cr. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
289 |
]. |
12391 | 290 |
bookmarkStream syncData; close. |
5960 | 291 |
! |
292 |
||
8013 | 293 |
saveBookmarksIn:aFileNameOrString |
294 |
"save the bokmarks in aFileNameOrString. |
|
295 |
Use Base64 coding" |
|
296 |
||
297 |
| bookmarks | |
|
298 |
||
299 |
bookmarks := self directoryBookmarks. |
|
300 |
self saveBookmarks: bookmarks in:aFileNameOrString |
|
301 |
! |
|
302 |
||
5960 | 303 |
saveBookmarksInDefaultBookmarksFile |
304 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
305 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
306 |
|
4915 | 307 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
308 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
309 |
directoryHistoryClass |
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
310 |
^ DirectoryHistory |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
311 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
312 |
"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
|
313 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
314 |
|
3892 | 315 |
!AbstractFileBrowser class methodsFor:'defaults'! |
316 |
||
317 |
commandHistory |
|
318 |
||
319 |
CommandHistory isNil ifTrue:[ |
|
4414 | 320 |
CommandHistory := OrderedCollection new. |
3892 | 321 |
]. |
322 |
^ CommandHistory |
|
323 |
! |
|
324 |
||
325 |
commandHistorySize |
|
4190 | 326 |
"max no of entries in the HistoryList " |
6369 | 327 |
|
3892 | 328 |
CommandHistorySize isNil ifTrue:[ |
6369 | 329 |
CommandHistorySize := 150 |
3892 | 330 |
]. |
331 |
^ CommandHistorySize |
|
332 |
! |
|
333 |
||
334 |
defaultFilterList |
|
335 |
||
336 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 337 |
DefaultFilters := #( '*' |
338 |
'*.st' |
|
339 |
'*.[h,c]*' |
|
12760 | 340 |
'*.txt; *.htm*' |
341 |
'*.gif; *.xpm; *.jpg; *.png' |
|
342 |
'~*o; ~*.obj; ~*.dll;' |
|
4414 | 343 |
) |
3892 | 344 |
]. |
345 |
^ DefaultFilters. |
|
12760 | 346 |
|
347 |
" |
|
348 |
DefaultFilters := nil |
|
349 |
" |
|
3892 | 350 |
! |
351 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
352 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
353 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
354 |
|
4523 | 355 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
356 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
357 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
358 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
359 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
360 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
361 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
362 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
363 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
364 |
"/ ]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
365 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
366 |
"/ 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
|
367 |
"/ XXX or from resources. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
368 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
369 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
370 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
371 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
372 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
373 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
374 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
375 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
376 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
377 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
378 |
(actually this should come from a configfile)" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
379 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
380 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
381 |
aBox initialText:'make target' selectFrom:6 to:11. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
382 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
383 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
384 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
385 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
386 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
387 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
388 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
389 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
390 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
391 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
392 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
393 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
394 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
395 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
396 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
397 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
398 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
399 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
400 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
401 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
405 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
406 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
407 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
411 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
412 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
413 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
414 |
(suffix = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
415 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
416 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
423 |
cmd := 'uncompress %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
424 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
425 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
426 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
427 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
428 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
429 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
430 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
431 |
cmd := 'gunzip %1'. |
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 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
434 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
435 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
436 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
cmd := 'netscape %1' |
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 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
441 |
cmd := 'uudecode %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
442 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
445 |
select := 5. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
446 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
447 |
(suffix = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
449 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
450 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
452 |
cmd := 'bitmap %1' |
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 = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
455 |
cmd := 'ghostview %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
456 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
457 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
458 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
459 |
select := 10. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
460 |
]. |
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 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
463 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
464 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
465 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
466 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
467 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
468 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
469 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
470 |
ifAbsent:'<cmd>'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
471 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
472 |
cmd := cmd , ' %1'. |
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 |
|
4523 | 475 |
pathName := path pathName. |
476 |
OperatingSystem isUNIXlike ifTrue:[ |
|
477 |
pathName includesSeparator ifTrue:[ |
|
478 |
pathName := '"' , pathName , '"' |
|
479 |
] |
|
480 |
]. |
|
481 |
||
482 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
483 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
484 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
485 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
486 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
487 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
488 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
489 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
490 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
491 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
492 |
aBox initialText:cmd selectFrom:1 to:select |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
493 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
494 |
] |
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 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
497 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
498 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 499 |
! |
500 |
||
5941 | 501 |
listOfRuntimeValuesToRemember |
502 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
503 |
||
504 |
^ #( |
|
505 |
"/ #filterModel |
|
506 |
#enableFileHistory |
|
507 |
#fileHistory |
|
508 |
#currentSortOrder |
|
509 |
#sortBlockProperty |
|
510 |
) |
|
3892 | 511 |
! |
512 |
||
513 |
resetAspects |
|
514 |
||
515 |
RuntimeAspects := nil. |
|
516 |
||
5941 | 517 |
" |
518 |
self resetAspects |
|
519 |
" |
|
3892 | 520 |
! |
521 |
||
522 |
runtimeAspects |
|
523 |
||
524 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 525 |
RuntimeAspects := Dictionary new. |
3892 | 526 |
]. |
527 |
^ RuntimeAspects |
|
528 |
! |
|
529 |
||
4201 | 530 |
userPreferencesAspectList |
531 |
" list of all aspects that will be saved with save settings |
|
532 |
that aspects will be image consistent if the settings are saved in Launcher |
|
11501 | 533 |
don't forget to add a access methods in UserPreferences if you add a aspect here |
4201 | 534 |
" |
535 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
536 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
537 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
538 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
539 |
showDirectoryTree true |
11501 | 540 |
showHiddenFiles true |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
541 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
542 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
543 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
544 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
545 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
546 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
547 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
548 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
549 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
550 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
551 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
552 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
553 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
554 |
openMultipleApplicationsForType false |
7788 | 555 |
filenameEntryFieldVisibleHolder true |
556 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
557 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
558 |
openAlwaysInTextEditor false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
559 |
sortCaseless false |
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
560 |
useCodeView2InTools true |
4201 | 561 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
562 |
|
11501 | 563 |
"Modified: / 11-05-2012 / 09:22:04 / cg" |
3892 | 564 |
! ! |
565 |
||
5398 | 566 |
!AbstractFileBrowser class methodsFor:'help specs'! |
567 |
||
8261 | 568 |
basicFlyByHelpSpec |
6099 | 569 |
<resource: #help> |
570 |
||
8261 | 571 |
^ super flyByHelpSpec addPairsFrom:#( |
6099 | 572 |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
573 |
#lockFileEncoding |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
574 |
'Do not guess the encoding from the file''s contents.' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
575 |
|
6100 | 576 |
#closeTabButton |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
577 |
'Close this tab' |
6100 | 578 |
|
6099 | 579 |
#addTerminal |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
580 |
'Add a Shell terminal view' |
6099 | 581 |
|
582 |
#make |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
583 |
'Call the make command' |
6099 | 584 |
|
585 |
#searchFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
586 |
'Search a file' |
6099 | 587 |
|
588 |
#directoryUp |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
589 |
'Directory up' |
6099 | 590 |
|
591 |
#directoryBack |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
592 |
'Directory back' |
6099 | 593 |
|
594 |
#directoryForward |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
595 |
'Directory forward' |
6099 | 596 |
|
597 |
#directoryHistory |
|
598 |
'Directory' |
|
599 |
||
600 |
#copyFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
601 |
'Copy the selected file(s)' |
6099 | 602 |
|
603 |
#cutFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
604 |
'Cut the selected file(s)' |
6099 | 605 |
|
606 |
#editFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
607 |
'Edit the selected file' |
6099 | 608 |
|
609 |
#fileHome |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
610 |
'Goto home directory' |
6099 | 611 |
|
8093 | 612 |
#fileDesktop |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
613 |
'Goto desktop directory' |
8093 | 614 |
|
6099 | 615 |
#fileGotoDefault |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
616 |
'Goto default directory (ST/X start directory)' |
6099 | 617 |
|
6454 | 618 |
#fileGotoSmalltalkDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
619 |
'Goto Smalltalk directory (ST/X application)' |
6454 | 620 |
|
6456 | 621 |
#fileGotoDefaultDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
622 |
'Goto current directory' |
6456 | 623 |
|
6099 | 624 |
#pasteFile |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
625 |
'Paste file(s)' |
6099 | 626 |
|
627 |
#deleteFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
628 |
'Delete the selected file(s)' |
6099 | 629 |
|
630 |
#fileIn |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
631 |
'File in' |
6099 | 632 |
|
633 |
#fileHistory |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
634 |
'File history' |
6099 | 635 |
|
636 |
#fileGotoBookmark |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
637 |
'Goto bookmarked directory' |
6099 | 638 |
|
639 |
#hideToolBar |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
640 |
'Hide toolbar' |
6099 | 641 |
|
642 |
#hideFilenameEntryField |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
643 |
'Hide filename & filter fields' |
6099 | 644 |
|
645 |
#openChangeBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
646 |
'Open a Changebrowser on file' |
6099 | 647 |
|
648 |
#showFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
649 |
'Show file details' |
6099 | 650 |
|
651 |
#hideFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
652 |
'Hide file details' |
6099 | 653 |
|
654 |
#toggleDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
655 |
'Show/hide file details' |
6099 | 656 |
|
657 |
#viewDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
658 |
'Show/hide file details' |
6099 | 659 |
|
660 |
#selectDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
661 |
'Select file details to be shown' |
6099 | 662 |
|
8088 | 663 |
#showDifferences |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
664 |
'Show differences between file and editor versions' |
8088 | 665 |
|
666 |
#toggleHexDisplay |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
667 |
'Toggle between hexadecimal and textual representation' |
8088 | 668 |
|
669 |
#findInBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
670 |
'Navigate the browser''s file list to the edited file' |
8088 | 671 |
|
672 |
#saveFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
673 |
'Save the editor''s contents into the file' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
674 |
|
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
675 |
#saveFileAs |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
676 |
'Save the editor''s contents into another file' |
8088 | 677 |
|
678 |
#reloadFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
679 |
'Reload from the file' |
8088 | 680 |
|
681 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
682 |
'Send to the printer' |
8088 | 683 |
|
6099 | 684 |
). |
685 |
||
8261 | 686 |
" |
687 |
self flyByHelpSpec |
|
688 |
" |
|
689 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
690 |
"Modified: / 06-10-2011 / 14:55:27 / cg" |
8261 | 691 |
! |
692 |
||
693 |
flyByHelpSpec |
|
694 |
<resource: #programHelp> |
|
695 |
||
696 |
|spec hist resources| |
|
697 |
||
698 |
spec := self basicFlyByHelpSpec. |
|
699 |
||
700 |
"/ add help items for the history |
|
6099 | 701 |
hist := self directoryHistory. |
702 |
hist notNil ifTrue:[ |
|
703 |
resources := self classResources. |
|
704 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
705 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 706 |
]. |
707 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
708 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 709 |
]. |
710 |
]. |
|
711 |
^ spec. |
|
712 |
||
713 |
" |
|
714 |
self flyByHelpSpec |
|
715 |
" |
|
716 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
717 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
5398 | 718 |
! ! |
719 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
720 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
721 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
722 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
723 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
724 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
725 |
^ Icon deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
726 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
727 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
728 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
729 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
730 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
731 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
732 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
733 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
734 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
735 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
736 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
737 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
738 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
739 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
740 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
741 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
742 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
743 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
744 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
745 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
746 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
747 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
748 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
749 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
750 |
! |
3892 | 751 |
|
6337 | 752 |
disabledCursorIcon |
753 |
"This resource specification was automatically generated |
|
754 |
by the ImageEditor of ST/X." |
|
755 |
||
756 |
"Do not manually edit this!! If it is corrupted, |
|
757 |
the ImageEditor may not be able to read the specification." |
|
758 |
||
759 |
" |
|
760 |
self disabledCursorImage inspect |
|
761 |
ImageEditor openOnClass:self andSelector:#disabledCursorImage |
|
762 |
Icon flushCachedIcons |
|
763 |
" |
|
764 |
||
765 |
<resource: #image> |
|
766 |
||
767 |
^Icon |
|
8473 | 768 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
6337 | 769 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
770 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
771 |
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:' |
|
772 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
773 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
774 |
! |
|
775 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
776 |
disabledCursorImage |
6337 | 777 |
"/ DisabledCursorImage isNil ifTrue:[ |
778 |
"/ DisabledCursorImage := self disabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
779 |
"/ ]. |
|
3892 | 780 |
^ DisabledCursorImage |
781 |
! |
|
782 |
||
6337 | 783 |
enabledCursorIcon |
784 |
"This resource specification was automatically generated |
|
785 |
by the ImageEditor of ST/X." |
|
786 |
||
787 |
"Do not manually edit this!! If it is corrupted, |
|
788 |
the ImageEditor may not be able to read the specification." |
|
789 |
||
790 |
" |
|
791 |
self enabledCursorImage inspect |
|
792 |
ImageEditor openOnClass:self andSelector:#enabledCursorImage |
|
793 |
Icon flushCachedIcons |
|
794 |
" |
|
795 |
||
796 |
<resource: #image> |
|
797 |
||
798 |
^Icon |
|
8473 | 799 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
6337 | 800 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
801 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
802 |
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:' |
|
803 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
804 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
805 |
! |
|
806 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
807 |
enabledCursorImage |
6337 | 808 |
"/ EnabledCursorImage isNil ifTrue:[ |
809 |
"/ EnabledCursorImage := self enabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
810 |
"/ ]. |
|
3892 | 811 |
^ EnabledCursorImage |
6083 | 812 |
! |
813 |
||
3892 | 814 |
fileInIcon |
815 |
<resource: #programImage> |
|
816 |
||
6116 | 817 |
^ ToolbarIconLibrary fileInIcon |
3892 | 818 |
! |
819 |
||
6079 | 820 |
historyBackIcon |
821 |
<resource: #programImage> |
|
822 |
||
823 |
^ ToolbarIconLibrary historyBackIcon |
|
824 |
! |
|
825 |
||
826 |
historyForwardIcon |
|
827 |
<resource: #programImage> |
|
828 |
||
829 |
^ ToolbarIconLibrary historyForwardIcon |
|
830 |
! |
|
831 |
||
3892 | 832 |
homeIcon |
833 |
<resource: #programImage> |
|
834 |
||
6079 | 835 |
^ ToolbarIconLibrary homeIcon |
3892 | 836 |
! |
837 |
||
6074 | 838 |
homeIcon2 |
6079 | 839 |
<resource: #programImage> |
840 |
||
841 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 842 |
! |
843 |
||
844 |
htmlReloadIcon |
|
845 |
<resource: #programImage> |
|
846 |
||
847 |
^ ToolbarIconLibrary reload22x22Icon |
|
848 |
! |
|
849 |
||
3892 | 850 |
leftDownIcon |
851 |
"This resource specification was automatically generated |
|
852 |
by the ImageEditor of ST/X." |
|
853 |
||
854 |
"Do not manually edit this!! If it is corrupted, |
|
855 |
the ImageEditor may not be able to read the specification." |
|
856 |
||
857 |
" |
|
858 |
self leftDownIcon inspect |
|
859 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
860 |
" |
|
861 |
||
862 |
<resource: #image> |
|
863 |
||
864 |
^Icon |
|
4414 | 865 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
866 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3892 | 867 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
868 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
869 |
UUUU@@@@@@@AUUUUUUUUUP@a') ; colorMapFromArray:#[255 255 255 0 0 0 40 40 100 255 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
870 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
871 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
872 |
! |
|
873 |
||
874 |
menuHistoryList9x20Icon |
|
875 |
"This resource specification was automatically generated |
|
876 |
by the ImageEditor of ST/X." |
|
877 |
||
878 |
"Do not manually edit this!! If it is corrupted, |
|
879 |
the ImageEditor may not be able to read the specification." |
|
880 |
||
881 |
" |
|
882 |
self menuHistoryList9x20Icon inspect |
|
883 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
884 |
Icon flushCachedIcons |
|
885 |
" |
|
886 |
||
887 |
<resource: #image> |
|
888 |
||
889 |
^Icon |
|
4414 | 890 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
891 |
ifAbsentPut:[(Depth1Image new) width: 9; height: 20; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 9; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; yourself); yourself] |
|
3892 | 892 |
! |
893 |
||
894 |
menuHistoryListIcon |
|
895 |
"This resource specification was automatically generated |
|
896 |
by the ImageEditor of ST/X." |
|
897 |
||
898 |
"Do not manually edit this!! If it is corrupted, |
|
899 |
the ImageEditor may not be able to read the specification." |
|
900 |
||
901 |
" |
|
902 |
self menuHistoryListIcon inspect |
|
903 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
904 |
" |
|
905 |
||
906 |
<resource: #image> |
|
907 |
||
908 |
^Icon |
|
4414 | 909 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
910 |
ifAbsentPut:[(Depth1Image new) width: 12; height: 12; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 12; height: 12; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@') ; yourself); yourself] |
|
3892 | 911 |
! |
912 |
||
6087 | 913 |
newDirectoryIcon |
6074 | 914 |
<resource: #programImage> |
915 |
||
6087 | 916 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 917 |
! |
918 |
||
6091 | 919 |
removeTabIcon |
920 |
<resource: #programImage> |
|
921 |
||
922 |
^ ToolbarIconLibrary removeTabIcon |
|
923 |
! |
|
924 |
||
3892 | 925 |
vt100Terminal |
926 |
<resource: #programImage> |
|
927 |
||
928 |
^ ToolbarIconLibrary shell20x20Icon |
|
929 |
! ! |
|
930 |
||
5528 | 931 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
932 |
||
933 |
encodingDialogSpec |
|
934 |
"This resource specification was automatically generated |
|
935 |
by the UIPainter of ST/X." |
|
936 |
||
937 |
"Do not manually edit this!! If it is corrupted, |
|
938 |
the UIPainter may not be able to read the specification." |
|
939 |
||
940 |
" |
|
941 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
942 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
943 |
" |
|
944 |
||
945 |
<resource: #canvas> |
|
946 |
||
947 |
^ |
|
948 |
#(FullSpec |
|
949 |
name: encodingDialogSpec |
|
950 |
window: |
|
951 |
(WindowSpec |
|
952 |
label: 'File Encoding' |
|
953 |
name: 'File Encoding' |
|
954 |
min: (Point 10 10) |
|
5626 | 955 |
bounds: (Rectangle 0 0 379 590) |
5528 | 956 |
) |
957 |
component: |
|
958 |
(SpecCollection |
|
959 |
collection: ( |
|
960 |
(LabelSpec |
|
11053 | 961 |
label: 'Select the External (File-) Encoding:' |
6236 | 962 |
name: 'Label1' |
5528 | 963 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
964 |
translateLabel: true |
|
965 |
adjust: left |
|
966 |
) |
|
967 |
(DataSetSpec |
|
968 |
name: 'Table1' |
|
5737 | 969 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 970 |
model: selectedEncoding |
971 |
hasHorizontalScrollBar: true |
|
972 |
hasVerticalScrollBar: true |
|
973 |
dataList: encodingList |
|
974 |
has3Dseparators: true |
|
975 |
columns: |
|
11053 | 976 |
(Array |
5528 | 977 |
|
978 |
(DataSetColumnSpec |
|
979 |
label: 'Encoding' |
|
980 |
labelButtonType: Button |
|
981 |
model: at: |
|
982 |
canSelect: false |
|
983 |
isResizeable: false |
|
984 |
showRowSeparator: false |
|
985 |
showColSeparator: false |
|
986 |
) |
|
987 |
(DataSetColumnSpec |
|
988 |
label: 'Description' |
|
989 |
labelButtonType: Button |
|
990 |
model: at: |
|
991 |
canSelect: false |
|
992 |
isResizeable: false |
|
993 |
showRowSeparator: false |
|
994 |
showColSeparator: false |
|
995 |
) |
|
996 |
) |
|
5626 | 997 |
doubleClickChannel: accept |
5528 | 998 |
) |
999 |
(HorizontalPanelViewSpec |
|
5737 | 1000 |
name: 'ButtonPanel' |
5528 | 1001 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
1002 |
horizontalLayout: fitSpace |
|
1003 |
verticalLayout: center |
|
1004 |
horizontalSpace: 3 |
|
1005 |
verticalSpace: 3 |
|
1006 |
reverseOrderIfOKAtLeft: true |
|
1007 |
component: |
|
1008 |
(SpecCollection |
|
1009 |
collection: ( |
|
1010 |
(ActionButtonSpec |
|
1011 |
label: 'Cancel' |
|
1012 |
name: 'Button2' |
|
1013 |
translateLabel: true |
|
1014 |
model: cancel |
|
5737 | 1015 |
extent: (Point 185 22) |
5528 | 1016 |
) |
1017 |
(ActionButtonSpec |
|
1018 |
label: 'OK' |
|
1019 |
name: 'Button1' |
|
1020 |
translateLabel: true |
|
1021 |
model: accept |
|
1022 |
isDefault: true |
|
5737 | 1023 |
extent: (Point 185 22) |
5528 | 1024 |
) |
1025 |
) |
|
1026 |
||
1027 |
) |
|
1028 |
) |
|
5737 | 1029 |
(CheckBoxSpec |
1030 |
label: 'Lock Encoding' |
|
1031 |
name: 'LockEncodingCheckBox' |
|
1032 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1033 |
activeHelpKey: lockFileEncoding |
|
1034 |
model: lockFileEncoding |
|
1035 |
translateLabel: true |
|
1036 |
) |
|
5528 | 1037 |
) |
1038 |
||
1039 |
) |
|
1040 |
) |
|
11053 | 1041 |
|
1042 |
"Modified: / 06-01-2012 / 15:40:54 / cg" |
|
1043 |
! |
|
1044 |
||
1045 |
lineEndConventionDialogSpec |
|
1046 |
"This resource specification was automatically generated |
|
1047 |
by the UIPainter of ST/X." |
|
1048 |
||
1049 |
"Do not manually edit this!! If it is corrupted, |
|
1050 |
the UIPainter may not be able to read the specification." |
|
1051 |
||
1052 |
" |
|
1053 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec |
|
1054 |
AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec |
|
1055 |
" |
|
1056 |
||
1057 |
<resource: #canvas> |
|
1058 |
||
1059 |
^ |
|
1060 |
#(FullSpec |
|
1061 |
name: lineEndConventionDialogSpec |
|
1062 |
window: |
|
1063 |
(WindowSpec |
|
1064 |
label: 'Line-End Convention' |
|
1065 |
name: 'Line-End Convention' |
|
1066 |
min: (Point 10 10) |
|
1067 |
bounds: (Rectangle 0 0 379 239) |
|
1068 |
) |
|
1069 |
component: |
|
1070 |
(SpecCollection |
|
1071 |
collection: ( |
|
1072 |
(LabelSpec |
|
11286 | 1073 |
label: 'Select the Line-End Convention (used when saving files):' |
11053 | 1074 |
name: 'Label1' |
1075 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1076 |
translateLabel: true |
|
1077 |
adjust: left |
|
1078 |
) |
|
1079 |
(VerticalPanelViewSpec |
|
1080 |
name: 'VerticalPanel1' |
|
1081 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1082 |
horizontalLayout: center |
|
1083 |
verticalLayout: center |
|
1084 |
horizontalSpace: 3 |
|
1085 |
verticalSpace: 3 |
|
1086 |
component: |
|
1087 |
(SpecCollection |
|
1088 |
collection: ( |
|
1089 |
(RadioButtonSpec |
|
1090 |
label: 'NL (Unix)' |
|
1091 |
name: 'RadioButton1' |
|
1092 |
translateLabel: true |
|
1093 |
model: lineEndConvention |
|
1094 |
isTriggerOnDown: true |
|
1095 |
select: nl |
|
1096 |
extent: (Point 136 22) |
|
1097 |
) |
|
1098 |
(RadioButtonSpec |
|
1099 |
label: 'CR-NL (MSDOS)' |
|
1100 |
name: 'RadioButton4' |
|
1101 |
translateLabel: true |
|
1102 |
model: lineEndConvention |
|
1103 |
isTriggerOnDown: true |
|
1104 |
select: crnl |
|
1105 |
extent: (Point 136 22) |
|
1106 |
) |
|
1107 |
(RadioButtonSpec |
|
1108 |
label: 'CR (Mac)' |
|
1109 |
name: 'RadioButton5' |
|
1110 |
translateLabel: true |
|
1111 |
model: lineEndConvention |
|
1112 |
isTriggerOnDown: true |
|
1113 |
select: cr |
|
1114 |
extent: (Point 136 22) |
|
1115 |
) |
|
1116 |
(RadioButtonSpec |
|
1117 |
label: 'EOL' |
|
1118 |
name: 'RadioButton6' |
|
1119 |
translateLabel: true |
|
1120 |
model: lineEndConvention |
|
1121 |
isTriggerOnDown: true |
|
1122 |
select: eol |
|
1123 |
extent: (Point 136 22) |
|
1124 |
) |
|
1125 |
(RadioButtonSpec |
|
1126 |
label: 'EOT' |
|
1127 |
name: 'RadioButton7' |
|
1128 |
translateLabel: true |
|
1129 |
model: lineEndConvention |
|
1130 |
isTriggerOnDown: true |
|
1131 |
select: eot |
|
1132 |
extent: (Point 136 22) |
|
1133 |
) |
|
1134 |
) |
|
1135 |
||
1136 |
) |
|
1137 |
) |
|
1138 |
(HorizontalPanelViewSpec |
|
1139 |
name: 'ButtonPanel' |
|
1140 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1141 |
horizontalLayout: fitSpace |
|
1142 |
verticalLayout: center |
|
1143 |
horizontalSpace: 3 |
|
1144 |
verticalSpace: 3 |
|
1145 |
reverseOrderIfOKAtLeft: true |
|
1146 |
component: |
|
1147 |
(SpecCollection |
|
1148 |
collection: ( |
|
1149 |
(ActionButtonSpec |
|
1150 |
label: 'Cancel' |
|
1151 |
name: 'Button2' |
|
1152 |
translateLabel: true |
|
1153 |
model: cancel |
|
1154 |
extent: (Point 185 22) |
|
1155 |
) |
|
1156 |
(ActionButtonSpec |
|
1157 |
label: 'OK' |
|
1158 |
name: 'Button1' |
|
1159 |
translateLabel: true |
|
1160 |
model: accept |
|
1161 |
isDefault: true |
|
1162 |
extent: (Point 185 22) |
|
1163 |
) |
|
1164 |
) |
|
1165 |
||
1166 |
) |
|
1167 |
) |
|
1168 |
) |
|
1169 |
||
1170 |
) |
|
1171 |
) |
|
11286 | 1172 |
|
1173 |
"Modified: / 28-02-2012 / 11:12:03 / cg" |
|
11053 | 1174 |
! |
1175 |
||
1176 |
tabStopConversionDialogSpec |
|
1177 |
"This resource specification was automatically generated |
|
1178 |
by the UIPainter of ST/X." |
|
1179 |
||
1180 |
"Do not manually edit this!! If it is corrupted, |
|
1181 |
the UIPainter may not be able to read the specification." |
|
1182 |
||
1183 |
" |
|
1184 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec |
|
1185 |
AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec |
|
1186 |
" |
|
1187 |
||
1188 |
<resource: #canvas> |
|
1189 |
||
1190 |
^ |
|
1191 |
#(FullSpec |
|
1192 |
name: 'tabStopConversionDialogSpec' |
|
1193 |
window: |
|
1194 |
(WindowSpec |
|
1195 |
label: 'Tab-Stop Conversion' |
|
1196 |
name: 'Tab-Stop Conversion' |
|
1197 |
min: (Point 10 10) |
|
1198 |
bounds: (Rectangle 0 0 379 239) |
|
1199 |
) |
|
1200 |
component: |
|
1201 |
(SpecCollection |
|
1202 |
collection: ( |
|
1203 |
(LabelSpec |
|
11286 | 1204 |
label: 'Select the Tab-Stop Conversion (used when saving files):' |
11053 | 1205 |
name: 'Label1' |
1206 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1207 |
translateLabel: true |
|
1208 |
adjust: left |
|
1209 |
) |
|
1210 |
(VerticalPanelViewSpec |
|
1211 |
name: 'VerticalPanel1' |
|
1212 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1213 |
horizontalLayout: center |
|
1214 |
verticalLayout: center |
|
1215 |
horizontalSpace: 3 |
|
1216 |
verticalSpace: 3 |
|
1217 |
component: |
|
1218 |
(SpecCollection |
|
1219 |
collection: ( |
|
1220 |
(RadioButtonSpec |
|
1221 |
label: '4' |
|
1222 |
name: 'RadioButton1' |
|
1223 |
translateLabel: true |
|
1224 |
model: tabStops |
|
1225 |
isTriggerOnDown: true |
|
1226 |
select: 4 |
|
1227 |
extent: (Point 136 22) |
|
1228 |
) |
|
1229 |
(RadioButtonSpec |
|
1230 |
label: '8' |
|
1231 |
name: 'RadioButton4' |
|
1232 |
translateLabel: true |
|
1233 |
model: tabStops |
|
1234 |
isTriggerOnDown: true |
|
1235 |
select: 8 |
|
1236 |
extent: (Point 136 22) |
|
1237 |
) |
|
1238 |
) |
|
1239 |
||
1240 |
) |
|
1241 |
) |
|
1242 |
(HorizontalPanelViewSpec |
|
1243 |
name: 'ButtonPanel' |
|
1244 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1245 |
horizontalLayout: fitSpace |
|
1246 |
verticalLayout: center |
|
1247 |
horizontalSpace: 3 |
|
1248 |
verticalSpace: 3 |
|
1249 |
reverseOrderIfOKAtLeft: true |
|
1250 |
component: |
|
1251 |
(SpecCollection |
|
1252 |
collection: ( |
|
1253 |
(ActionButtonSpec |
|
1254 |
label: 'Cancel' |
|
1255 |
name: 'Button2' |
|
1256 |
translateLabel: true |
|
1257 |
model: cancel |
|
1258 |
extent: (Point 185 22) |
|
1259 |
) |
|
1260 |
(ActionButtonSpec |
|
1261 |
label: 'OK' |
|
1262 |
name: 'Button1' |
|
1263 |
translateLabel: true |
|
1264 |
model: accept |
|
1265 |
isDefault: true |
|
1266 |
extent: (Point 185 22) |
|
1267 |
) |
|
1268 |
) |
|
1269 |
||
1270 |
) |
|
1271 |
) |
|
1272 |
) |
|
1273 |
||
1274 |
) |
|
1275 |
) |
|
11286 | 1276 |
|
1277 |
"Modified: / 28-02-2012 / 11:12:38 / cg" |
|
5528 | 1278 |
! ! |
1279 |
||
3892 | 1280 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1281 |
||
1282 |
baseBookmarksMenuSpec |
|
1283 |
"This resource specification was automatically generated |
|
1284 |
by the MenuEditor of ST/X." |
|
1285 |
||
1286 |
"Do not manually edit this!! If it is corrupted, |
|
1287 |
the MenuEditor may not be able to read the specification." |
|
1288 |
||
1289 |
" |
|
1290 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1291 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1292 |
" |
|
1293 |
||
1294 |
<resource: #menu> |
|
1295 |
||
1296 |
^ |
|
6551 | 1297 |
#(Menu |
1298 |
( |
|
1299 |
(MenuItem |
|
1300 |
enabled: currentFilesHasDirectories |
|
1301 |
label: 'Add Bookmark' |
|
1302 |
itemValue: addBookmark |
|
1303 |
translateLabel: true |
|
4414 | 1304 |
) |
6551 | 1305 |
(MenuItem |
1306 |
enabled: hasBookmarksToRemove |
|
1307 |
label: 'Remove Bookmark' |
|
1308 |
itemValue: removeBookmark |
|
1309 |
translateLabel: true |
|
4414 | 1310 |
) |
6551 | 1311 |
(MenuItem |
1312 |
label: 'Save Bookmarks In...' |
|
1313 |
itemValue: saveBookmarks |
|
1314 |
translateLabel: true |
|
4679 | 1315 |
) |
4414 | 1316 |
) |
1317 |
nil |
|
1318 |
nil |
|
3892 | 1319 |
) |
1320 |
! |
|
1321 |
||
6102 | 1322 |
baseBookmarksMenuSpec2 |
1323 |
"This resource specification was automatically generated |
|
1324 |
by the MenuEditor of ST/X." |
|
1325 |
||
1326 |
"Do not manually edit this!! If it is corrupted, |
|
1327 |
the MenuEditor may not be able to read the specification." |
|
1328 |
||
1329 |
" |
|
8013 | 1330 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
1331 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
6102 | 1332 |
" |
1333 |
||
1334 |
<resource: #menu> |
|
1335 |
||
1336 |
^ |
|
8013 | 1337 |
#(Menu |
1338 |
( |
|
1339 |
(MenuItem |
|
1340 |
label: 'Edit Bookmarks' |
|
1341 |
itemValue: editBookmarks |
|
1342 |
translateLabel: true |
|
1343 |
) |
|
1344 |
(MenuItem |
|
1345 |
label: '-' |
|
1346 |
) |
|
1347 |
(MenuItem |
|
1348 |
enabled: currentFilesHasDirectories |
|
1349 |
label: 'Add Bookmark' |
|
1350 |
itemValue: addBookmark |
|
1351 |
translateLabel: true |
|
6102 | 1352 |
) |
1353 |
) |
|
1354 |
nil |
|
1355 |
nil |
|
1356 |
) |
|
1357 |
! |
|
1358 |
||
4110 | 1359 |
browserMenu |
1360 |
"This resource specification was automatically generated |
|
1361 |
by the MenuEditor of ST/X." |
|
1362 |
||
1363 |
"Do not manually edit this!! If it is corrupted, |
|
1364 |
the MenuEditor may not be able to read the specification." |
|
1365 |
||
10923 | 1366 |
|
4110 | 1367 |
" |
1368 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1369 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1370 |
" |
|
1371 |
||
1372 |
<resource: #menu> |
|
1373 |
||
1374 |
^ |
|
5273 | 1375 |
#(Menu |
1376 |
( |
|
1377 |
(MenuItem |
|
7315 | 1378 |
label: 'Spawn Filebrowser' |
5273 | 1379 |
itemValue: doSpawn |
1380 |
translateLabel: true |
|
5962
ed6a7de8cc91
Add accelerators: Ctrl-t for new tab and Ctrl-n for new window
Stefan Vogel <sv@exept.de>
parents:
5961
diff
changeset
|
1381 |
shortcutKey: Ctrln |
4201 | 1382 |
) |
5273 | 1383 |
(MenuItem |
7829 | 1384 |
label: 'Windows Explorer' |
1385 |
itemValue: doOpenExplorer |
|
1386 |
translateLabel: true |
|
8256 | 1387 |
isVisible: systemIsDOS |
1388 |
) |
|
1389 |
(MenuItem |
|
12473 | 1390 |
label: 'Open Finder' |
1391 |
itemValue: doOpenFinder |
|
1392 |
translateLabel: true |
|
1393 |
isVisible: systemIsOSX |
|
1394 |
) |
|
1395 |
(MenuItem |
|
8256 | 1396 |
label: 'C Browser' |
1397 |
itemValue: doOpenCBrowser |
|
1398 |
translateLabel: true |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
1399 |
isVisible: cBrowserMenuItemVisible |
7829 | 1400 |
) |
1401 |
(MenuItem |
|
5273 | 1402 |
label: '-' |
4201 | 1403 |
) |
5273 | 1404 |
(MenuItem |
6335 | 1405 |
label: 'Add Text Editor Page' |
5273 | 1406 |
itemValue: newTextEditor |
1407 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
1408 |
shortcutKey: Ctrlt |
4392 | 1409 |
) |
5273 | 1410 |
(MenuItem |
6335 | 1411 |
label: 'Add Shell Terminal Page' |
5273 | 1412 |
itemValue: doAddTerminal |
1413 |
translateLabel: true |
|
4201 | 1414 |
) |
5273 | 1415 |
(MenuItem |
10923 | 1416 |
label: 'Add Archiver Page' |
1417 |
itemValue: doAddArchiver |
|
1418 |
translateLabel: true |
|
1419 |
) |
|
1420 |
(MenuItem |
|
6335 | 1421 |
label: 'Add Search Page' |
5273 | 1422 |
itemValue: doOpenSearchFile |
1423 |
translateLabel: true |
|
4201 | 1424 |
) |
5273 | 1425 |
(MenuItem |
1426 |
label: '-' |
|
11053 | 1427 |
isVisible: false |
4201 | 1428 |
) |
5273 | 1429 |
(MenuItem |
1430 |
label: 'Settings...' |
|
1431 |
itemValue: doOpenSettings |
|
1432 |
translateLabel: true |
|
11053 | 1433 |
isVisible: false |
5104 | 1434 |
) |
5273 | 1435 |
(MenuItem |
5528 | 1436 |
label: 'Encoding...' |
1437 |
itemValue: fileEncodingDialog |
|
1438 |
translateLabel: true |
|
11053 | 1439 |
isVisible: false |
1440 |
) |
|
1441 |
(MenuItem |
|
1442 |
label: 'Line End Convention...' |
|
1443 |
itemValue: lineEndConventionDialog |
|
1444 |
translateLabel: true |
|
1445 |
isVisible: false |
|
1446 |
) |
|
1447 |
(MenuItem |
|
1448 |
label: 'Tab Stop Conversion...' |
|
1449 |
itemValue: tabStopConversionDialog |
|
1450 |
translateLabel: true |
|
1451 |
isVisible: false |
|
5528 | 1452 |
) |
1453 |
(MenuItem |
|
5273 | 1454 |
label: '-' |
5104 | 1455 |
) |
5273 | 1456 |
(MenuItem |
1457 |
label: 'Exit' |
|
1458 |
itemValue: closeRequest |
|
1459 |
translateLabel: true |
|
4201 | 1460 |
) |
1461 |
) |
|
1462 |
nil |
|
1463 |
nil |
|
4110 | 1464 |
) |
11057 | 1465 |
|
1466 |
"Modified: / 07-01-2012 / 12:51:20 / cg" |
|
4110 | 1467 |
! |
1468 |
||
3892 | 1469 |
directoryMenu |
1470 |
"This resource specification was automatically generated |
|
1471 |
by the MenuEditor of ST/X." |
|
1472 |
||
1473 |
"Do not manually edit this!! If it is corrupted, |
|
1474 |
the MenuEditor may not be able to read the specification." |
|
1475 |
||
11767 | 1476 |
|
3892 | 1477 |
" |
1478 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1479 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1480 |
" |
|
1481 |
||
1482 |
<resource: #menu> |
|
1483 |
||
1484 |
^ |
|
6220 | 1485 |
#(Menu |
1486 |
( |
|
1487 |
(MenuItem |
|
1488 |
label: 'Up' |
|
1489 |
itemValue: doGoDirectoryUp |
|
4414 | 1490 |
) |
6220 | 1491 |
(MenuItem |
1492 |
label: '-' |
|
4414 | 1493 |
) |
6220 | 1494 |
(MenuItem |
1495 |
activeHelpKey: directoryBack |
|
1496 |
enabled: enableBack |
|
1497 |
label: 'Back' |
|
1498 |
itemValue: doBack |
|
4414 | 1499 |
) |
6220 | 1500 |
(MenuItem |
1501 |
activeHelpKey: directoryBack |
|
1502 |
enabled: enableForward |
|
1503 |
label: 'Forward' |
|
1504 |
itemValue: doForward |
|
4414 | 1505 |
) |
6220 | 1506 |
(MenuItem |
1507 |
label: '-' |
|
4414 | 1508 |
) |
6220 | 1509 |
(MenuItem |
9596 | 1510 |
enabled: enableHome |
6434 | 1511 |
label: 'Home Directory' |
1512 |
itemValue: doGotoHomeDirectory |
|
1513 |
) |
|
1514 |
(MenuItem |
|
9596 | 1515 |
enabled: enableGotoDesktopDirectory |
9572 | 1516 |
label: 'Desktop' |
1517 |
itemValue: doGotoDesktopDirectory |
|
1518 |
) |
|
1519 |
(MenuItem |
|
9596 | 1520 |
enabled: enableGotoDefaultDirectory |
6434 | 1521 |
label: 'Default (Current) Directory' |
6220 | 1522 |
itemValue: doGotoDefaultDirectory |
9596 | 1523 |
) |
1524 |
(MenuItem |
|
1525 |
enabled: enableGotoSmalltalkDirectory |
|
1526 |
label: 'Smalltalk (Application) Directory' |
|
1527 |
itemValue: doGotoSmalltalkDirectory |
|
4414 | 1528 |
) |
6220 | 1529 |
(MenuItem |
9677 | 1530 |
enabled: enableGotoTempDirectory |
11995 | 1531 |
label: 'Smalltalk Temp Directory' |
9677 | 1532 |
itemValue: doGotoTempDirectory |
1533 |
) |
|
1534 |
(MenuItem |
|
9596 | 1535 |
label: '-' |
1536 |
) |
|
1537 |
(MenuItem |
|
1538 |
enabled: enableMakeCurrentDirectory |
|
1539 |
label: 'Make this the Default (Current) Directory' |
|
1540 |
itemValue: doMakeCurrentDirectory |
|
4414 | 1541 |
) |
6220 | 1542 |
(MenuItem |
9596 | 1543 |
label: '-' |
1544 |
) |
|
1545 |
(MenuItem |
|
6220 | 1546 |
label: 'Bookmarks' |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1547 |
submenuChannel: bookmarksMenu |
4414 | 1548 |
) |
6220 | 1549 |
(MenuItem |
1550 |
label: 'Visited Directories' |
|
1551 |
submenuChannel: visitedDirectoriesMenu |
|
4414 | 1552 |
) |
1553 |
) |
|
1554 |
nil |
|
1555 |
nil |
|
3892 | 1556 |
) |
1557 |
! |
|
1558 |
||
1559 |
editMenu |
|
1560 |
"This resource specification was automatically generated |
|
1561 |
by the MenuEditor of ST/X." |
|
1562 |
||
1563 |
"Do not manually edit this!! If it is corrupted, |
|
1564 |
the MenuEditor may not be able to read the specification." |
|
1565 |
||
1566 |
" |
|
1567 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1568 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1569 |
" |
|
1570 |
||
1571 |
<resource: #menu> |
|
1572 |
||
1573 |
^ |
|
5888 | 1574 |
#(Menu |
1575 |
( |
|
1576 |
(MenuItem |
|
1577 |
enabled: hasFileSelection |
|
1578 |
label: 'Copy Selected Filenames to Clipboard' |
|
1579 |
itemValue: copySelectedFilenames |
|
1580 |
translateLabel: true |
|
4414 | 1581 |
) |
5888 | 1582 |
(MenuItem |
1583 |
enabled: fileListIsNotEmpty |
|
1584 |
label: 'Copy All Filenames to Clipboard' |
|
1585 |
itemValue: copyFileList |
|
1586 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1587 |
) |
4414 | 1588 |
) |
1589 |
nil |
|
1590 |
nil |
|
3892 | 1591 |
) |
1592 |
! |
|
1593 |
||
6099 | 1594 |
emptyMenuSpec |
1595 |
"This resource specification was automatically generated |
|
1596 |
by the MenuEditor of ST/X." |
|
1597 |
||
1598 |
"Do not manually edit this!! If it is corrupted, |
|
1599 |
the MenuEditor may not be able to read the specification." |
|
1600 |
||
1601 |
" |
|
1602 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1603 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1604 |
" |
|
1605 |
||
1606 |
<resource: #menu> |
|
1607 |
||
1608 |
^ |
|
1609 |
#(#Menu |
|
1610 |
#( |
|
1611 |
) |
|
1612 |
nil |
|
1613 |
nil |
|
1614 |
) |
|
1615 |
! |
|
1616 |
||
11053 | 1617 |
extraMenu |
1618 |
"This resource specification was automatically generated |
|
1619 |
by the MenuEditor of ST/X." |
|
1620 |
||
1621 |
"Do not manually edit this!! If it is corrupted, |
|
1622 |
the MenuEditor may not be able to read the specification." |
|
1623 |
||
1624 |
||
1625 |
" |
|
1626 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu |
|
1627 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp |
|
1628 |
" |
|
1629 |
||
1630 |
<resource: #menu> |
|
1631 |
||
1632 |
^ |
|
1633 |
#(Menu |
|
1634 |
( |
|
1635 |
(MenuItem |
|
1636 |
label: 'Encoding...' |
|
1637 |
itemValue: fileEncodingDialog |
|
1638 |
translateLabel: true |
|
1639 |
) |
|
1640 |
(MenuItem |
|
1641 |
label: 'Line End Convention...' |
|
1642 |
itemValue: lineEndConventionDialog |
|
1643 |
translateLabel: true |
|
1644 |
) |
|
1645 |
(MenuItem |
|
1646 |
label: 'Tab Stop Conversion...' |
|
1647 |
itemValue: tabStopConversionDialog |
|
1648 |
translateLabel: true |
|
1649 |
) |
|
1650 |
(MenuItem |
|
1651 |
label: '-' |
|
1652 |
) |
|
1653 |
(MenuItem |
|
1654 |
label: 'Settings...' |
|
1655 |
itemValue: doOpenSettings |
|
1656 |
translateLabel: true |
|
11286 | 1657 |
labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...') |
11053 | 1658 |
) |
1659 |
) |
|
1660 |
nil |
|
1661 |
nil |
|
1662 |
) |
|
1663 |
! |
|
1664 |
||
3892 | 1665 |
fileMenu |
1666 |
"This resource specification was automatically generated |
|
1667 |
by the MenuEditor of ST/X." |
|
1668 |
||
1669 |
"Do not manually edit this!! If it is corrupted, |
|
1670 |
the MenuEditor may not be able to read the specification." |
|
1671 |
||
12497 | 1672 |
|
3892 | 1673 |
" |
1674 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1675 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1676 |
" |
|
1677 |
||
1678 |
<resource: #menu> |
|
1679 |
||
1680 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1681 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1682 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1683 |
(MenuItem |
6593 | 1684 |
label: 'Open' |
1685 |
itemValue: doShowFileContents |
|
1686 |
) |
|
1687 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1688 |
label: '-' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1689 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1690 |
(MenuItem |
6593 | 1691 |
enabled: hasFileSelection |
1692 |
label: 'FileIn' |
|
1693 |
itemValue: fileFileIn |
|
1694 |
) |
|
1695 |
(MenuItem |
|
1696 |
enabled: hasFileSelection |
|
1697 |
label: 'FileIn to Namespace...' |
|
1698 |
itemValue: fileFileInToNameSpace |
|
12497 | 1699 |
) |
1700 |
(MenuItem |
|
1701 |
enabled: hasPackageDirectorySelected |
|
1702 |
label: 'Load Package from Here' |
|
1703 |
itemValue: fileFileInPackage |
|
6593 | 1704 |
) |
1705 |
(MenuItem |
|
1706 |
label: '-' |
|
1707 |
) |
|
1708 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1709 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1710 |
submenuChannel: newMenu |
5425 | 1711 |
keepLinkedMenu: true |
4414 | 1712 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1713 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1714 |
label: '-' |
4534 | 1715 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1716 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1717 |
enabled: hasSelection |
5945 | 1718 |
label: 'Cut' |
1719 |
itemValue: cutFiles |
|
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1720 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1721 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1722 |
enabled: hasSelection |
5945 | 1723 |
label: 'Copy' |
1724 |
itemValue: copyFiles |
|
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1725 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1726 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1727 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1728 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1729 |
itemValue: pasteFiles |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1730 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1731 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1732 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1733 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1734 |
itemValue: deleteFiles |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1735 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1736 |
(MenuItem |
6169 | 1737 |
enabled: hasSelection |
1738 |
label: 'Erase' |
|
1739 |
itemValue: eraseFiles |
|
1740 |
) |
|
1741 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1742 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1743 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1744 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1745 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1746 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1747 |
itemValue: renameSelection |
8716 | 1748 |
shortcutKey: Rename |
4414 | 1749 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1750 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1751 |
enabled: hasSelection |
5634 | 1752 |
label: 'Move To...' |
6107 | 1753 |
itemValue: moveSelectionTo |
1754 |
) |
|
1755 |
(MenuItem |
|
1756 |
enabled: hasSelection |
|
1757 |
label: 'Copy To...' |
|
1758 |
itemValue: copySelectionTo |
|
4414 | 1759 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1760 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1761 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1762 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1763 |
itemValue: doShowProperties |
4554 | 1764 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1765 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1766 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1767 |
isVisible: javaSupportLoaded |
4414 | 1768 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1769 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1770 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1771 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1772 |
isVisible: javaSupportLoaded |
4414 | 1773 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1774 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1775 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1776 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1777 |
isVisible: javaSupportLoaded |
4414 | 1778 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1779 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1780 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1781 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1782 |
isVisible: javaSupportLoaded |
4414 | 1783 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1784 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1785 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1786 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1787 |
isVisible: javaSupportLoaded |
4414 | 1788 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1789 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1790 |
label: '-' |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1791 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1792 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1793 |
enabled: enableFileHistory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1794 |
label: 'File History' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1795 |
submenuChannel: menuFileHistory |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1796 |
) |
4414 | 1797 |
) |
1798 |
nil |
|
1799 |
nil |
|
3892 | 1800 |
) |
1801 |
! |
|
1802 |
||
4930 | 1803 |
fileOpMenu |
1804 |
"This resource specification was automatically generated |
|
1805 |
by the MenuEditor of ST/X." |
|
1806 |
||
1807 |
"Do not manually edit this!! If it is corrupted, |
|
1808 |
the MenuEditor may not be able to read the specification." |
|
1809 |
||
1810 |
" |
|
1811 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1812 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1813 |
" |
|
1814 |
||
1815 |
<resource: #menu> |
|
1816 |
||
1817 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1818 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1819 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1820 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1821 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1822 |
itemValue: splitSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1823 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1824 |
) |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1825 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1826 |
label: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1827 |
itemValue: joinSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1828 |
translateLabel: true |
4930 | 1829 |
) |
7635 | 1830 |
(MenuItem |
1831 |
label: 'Copy Corrupted File To...' |
|
1832 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1833 |
translateLabel: true |
|
1834 |
) |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1835 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1836 |
label: '-' |
4930 | 1837 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1838 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1839 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1840 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1841 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1842 |
argument: rot13 |
4930 | 1843 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1844 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1845 |
label: '-' |
4930 | 1846 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1847 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1848 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1849 |
itemValue: truncateSelectedFilesToZeroSize |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1850 |
translateLabel: true |
4930 | 1851 |
) |
9490 | 1852 |
(MenuItem |
1853 |
label: '-' |
|
1854 |
) |
|
1855 |
(MenuItem |
|
1856 |
label: 'Generate Signed Files' |
|
1857 |
itemValue: generateSignaturesForSelectedFiles |
|
1858 |
translateLabel: true |
|
1859 |
enabled: canGenerateSignatureFiles |
|
1860 |
) |
|
1861 |
(MenuItem |
|
1862 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1863 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1864 |
translateLabel: true |
|
1865 |
enabled: canGenerateSignatureFiles |
|
1866 |
) |
|
9596 | 1867 |
(MenuItem |
1868 |
label: '-' |
|
1869 |
) |
|
1870 |
(MenuItem |
|
1871 |
enabled: hasSelection |
|
1872 |
label: 'File Differences' |
|
1873 |
itemValue: openDiffView |
|
1874 |
translateLabel: true |
|
1875 |
isVisible: hasTwoFilesSelectedHolder |
|
1876 |
) |
|
1877 |
(MenuItem |
|
1878 |
enabled: hasSelection |
|
1879 |
label: 'File Differences...' |
|
1880 |
itemValue: openDiffView |
|
1881 |
translateLabel: true |
|
1882 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1883 |
) |
|
1884 |
(MenuItem |
|
1885 |
enabled: hasSelection |
|
1886 |
label: 'Directory Differences' |
|
1887 |
itemValue: openDirectoryDiffView |
|
1888 |
translateLabel: true |
|
1889 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
1890 |
) |
|
1891 |
(MenuItem |
|
1892 |
enabled: hasSelection |
|
1893 |
label: 'Directory Differences...' |
|
1894 |
itemValue: openDirectoryDiffView |
|
1895 |
translateLabel: true |
|
1896 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
1897 |
) |
|
4930 | 1898 |
) |
1899 |
nil |
|
1900 |
nil |
|
1901 |
) |
|
9490 | 1902 |
|
9596 | 1903 |
"Modified: / 26-10-2010 / 17:16:05 / cg" |
4930 | 1904 |
! |
1905 |
||
3892 | 1906 |
newMenu |
1907 |
"This resource specification was automatically generated |
|
1908 |
by the MenuEditor of ST/X." |
|
1909 |
||
1910 |
"Do not manually edit this!! If it is corrupted, |
|
1911 |
the MenuEditor may not be able to read the specification." |
|
1912 |
||
1913 |
" |
|
1914 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1915 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1916 |
" |
|
1917 |
||
1918 |
<resource: #menu> |
|
1919 |
||
1920 |
^ |
|
1921 |
#(#Menu |
|
4414 | 1922 |
#( |
1923 |
#(#MenuItem |
|
1924 |
#label: 'Directory...' |
|
1925 |
#translateLabel: true |
|
1926 |
#value: #newDirectory |
|
1927 |
) |
|
1928 |
#(#MenuItem |
|
1929 |
#label: 'File...' |
|
1930 |
#translateLabel: true |
|
1931 |
#value: #newFile |
|
1932 |
) |
|
1933 |
#(#MenuItem |
|
1934 |
#label: 'Hard Link...' |
|
1935 |
#translateLabel: true |
|
1936 |
#isVisible: #systemIsUnix |
|
1937 |
#value: #newHardLink |
|
1938 |
) |
|
1939 |
#(#MenuItem |
|
1940 |
#label: 'Symbolic Link...' |
|
1941 |
#translateLabel: true |
|
1942 |
#isVisible: #systemIsUnix |
|
1943 |
#value: #newSoftLink |
|
1944 |
) |
|
1945 |
) |
|
1946 |
nil |
|
1947 |
nil |
|
3892 | 1948 |
) |
3906 | 1949 |
! |
1950 |
||
4201 | 1951 |
showMenuSpec |
1952 |
"This resource specification was automatically generated |
|
1953 |
by the MenuEditor of ST/X." |
|
1954 |
||
1955 |
"Do not manually edit this!! If it is corrupted, |
|
1956 |
the MenuEditor may not be able to read the specification." |
|
1957 |
||
1958 |
" |
|
1959 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
1960 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
1961 |
" |
|
1962 |
||
1963 |
<resource: #menu> |
|
1964 |
||
1965 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1966 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1967 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1968 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1969 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1970 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1971 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1972 |
indication: showHiddenFiles |
4201 | 1973 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1974 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1975 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1976 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1977 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1978 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1979 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1980 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1981 |
indication: showDirectoryTree |
4201 | 1982 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1983 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1984 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1985 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1986 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1987 |
indication: viewFilesInDirectoryTree |
4201 | 1988 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1989 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1990 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1991 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1992 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1993 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1994 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1995 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1996 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1997 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1998 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1999 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2000 |
indication: viewNoteBookApplicationHolder |
4201 | 2001 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2002 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2003 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2004 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2005 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2006 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2007 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2008 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2009 |
indication: showDiskUsageHolder |
4201 | 2010 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2011 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2012 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2013 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2014 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2015 |
! |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2016 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2017 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2018 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2019 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2020 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2021 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2022 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2023 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2024 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2025 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2026 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2027 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2028 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2029 |
<resource: #menu> |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2030 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2031 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2032 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2033 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2034 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2035 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2036 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2037 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2038 |
indication: showHiddenFiles |
4554 | 2039 |
) |
4201 | 2040 |
) |
2041 |
nil |
|
2042 |
nil |
|
2043 |
) |
|
2044 |
! |
|
2045 |
||
3906 | 2046 |
sortMenu |
2047 |
"This resource specification was automatically generated |
|
2048 |
by the MenuEditor of ST/X." |
|
2049 |
||
2050 |
"Do not manually edit this!! If it is corrupted, |
|
2051 |
the MenuEditor may not be able to read the specification." |
|
2052 |
||
2053 |
" |
|
3907 | 2054 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
2055 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 2056 |
" |
2057 |
||
2058 |
<resource: #menu> |
|
2059 |
||
2060 |
^ |
|
2061 |
#(#Menu |
|
4414 | 2062 |
#( |
2063 |
#(#MenuItem |
|
2064 |
#label: 'By Filename' |
|
2065 |
#translateLabel: true |
|
2066 |
#hideMenuOnActivated: false |
|
2067 |
#choice: #sortBlockProperty |
|
2068 |
#choiceValue: #baseName |
|
2069 |
) |
|
2070 |
#(#MenuItem |
|
5122 | 2071 |
#label: 'By Extension' |
4414 | 2072 |
#translateLabel: true |
2073 |
#hideMenuOnActivated: false |
|
2074 |
#choice: #sortBlockProperty |
|
2075 |
#choiceValue: #suffix |
|
2076 |
) |
|
2077 |
#(#MenuItem |
|
2078 |
#label: 'By Permissions' |
|
2079 |
#translateLabel: true |
|
2080 |
#hideMenuOnActivated: false |
|
2081 |
#choice: #sortBlockProperty |
|
2082 |
#choiceValue: #permissions |
|
2083 |
) |
|
2084 |
#(#MenuItem |
|
2085 |
#label: 'By Owner' |
|
2086 |
#translateLabel: true |
|
2087 |
#isVisible: #viewOwner |
|
2088 |
#hideMenuOnActivated: false |
|
2089 |
#choice: #sortBlockProperty |
|
2090 |
#choiceValue: #owner |
|
2091 |
) |
|
2092 |
#(#MenuItem |
|
2093 |
#label: 'By Group' |
|
2094 |
#translateLabel: true |
|
2095 |
#isVisible: #viewOwner |
|
2096 |
#hideMenuOnActivated: false |
|
2097 |
#choice: #sortBlockProperty |
|
2098 |
#choiceValue: #group |
|
2099 |
) |
|
2100 |
#(#MenuItem |
|
2101 |
#label: 'By Size' |
|
2102 |
#translateLabel: true |
|
2103 |
#hideMenuOnActivated: false |
|
2104 |
#choice: #sortBlockProperty |
|
2105 |
#choiceValue: #fileSize |
|
2106 |
) |
|
2107 |
#(#MenuItem |
|
2108 |
#label: 'By Date && Time' |
|
2109 |
#translateLabel: true |
|
2110 |
#hideMenuOnActivated: false |
|
2111 |
#choice: #sortBlockProperty |
|
2112 |
#choiceValue: #modificationTime |
|
2113 |
) |
|
2114 |
#(#MenuItem |
|
2115 |
#label: '-' |
|
2116 |
) |
|
2117 |
#(#MenuItem |
|
2118 |
#label: 'Ignore Case in Sort' |
|
2119 |
#translateLabel: true |
|
2120 |
#hideMenuOnActivated: false |
|
2121 |
#indication: #sortCaseless |
|
2122 |
) |
|
2123 |
#(#MenuItem |
|
2124 |
#label: 'Directories before Files' |
|
2125 |
#translateLabel: true |
|
2126 |
#hideMenuOnActivated: false |
|
2127 |
#indication: #sortDirectoriesBeforeFiles |
|
2128 |
) |
|
2129 |
) |
|
2130 |
nil |
|
2131 |
nil |
|
3906 | 2132 |
) |
4018 | 2133 |
! |
2134 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2135 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2136 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2137 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2138 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2139 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2140 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2141 |
|
11286 | 2142 |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2143 |
" |
4367 | 2144 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
2145 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2146 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2147 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2148 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2149 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2150 |
^ |
5830 | 2151 |
#(Menu |
2152 |
( |
|
2153 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2154 |
label: 'Open (Win32-Shell)' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2155 |
itemValue: doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2156 |
translateLabel: true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2157 |
isVisible: systemIsDOS |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2158 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2159 |
(MenuItem |
6528 | 2160 |
label: 'Execute UNIX Command...' |
5830 | 2161 |
itemValue: doExecuteCommand |
2162 |
translateLabel: true |
|
6528 | 2163 |
isVisible: systemIsUnix |
2164 |
) |
|
2165 |
(MenuItem |
|
2166 |
label: 'Execute DOS Command...' |
|
2167 |
itemValue: doExecuteCommand |
|
2168 |
translateLabel: true |
|
2169 |
isVisible: systemIsDOS |
|
4230 | 2170 |
) |
5830 | 2171 |
(MenuItem |
5880 | 2172 |
label: 'Execute Script...' |
2173 |
itemValue: doExecuteScript |
|
2174 |
translateLabel: true |
|
2175 |
) |
|
2176 |
(MenuItem |
|
5830 | 2177 |
enabled: canDoTerminal |
2178 |
label: 'Shell Terminal' |
|
2179 |
itemValue: openTerminal |
|
2180 |
translateLabel: true |
|
2181 |
isVisible: canDoTerminalAndSystemIsUnix |
|
11286 | 2182 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal') |
4230 | 2183 |
) |
5830 | 2184 |
(MenuItem |
2185 |
enabled: canDoTerminal |
|
2186 |
label: 'DOS Terminal' |
|
2187 |
itemValue: openTerminal |
|
2188 |
translateLabel: true |
|
2189 |
isVisible: canDoTerminalAndSystemIsDOS |
|
11286 | 2190 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal') |
4230 | 2191 |
) |
5830 | 2192 |
(MenuItem |
2193 |
label: '-' |
|
4230 | 2194 |
) |
5830 | 2195 |
(MenuItem |
2196 |
enabled: hasFileSelection |
|
2197 |
label: 'Changes Browser' |
|
2198 |
itemValue: openChangesBrowser |
|
2199 |
translateLabel: true |
|
4230 | 2200 |
) |
5830 | 2201 |
(MenuItem |
2202 |
enabled: hasFileSelection |
|
2203 |
label: 'ChangeSet Browser' |
|
2204 |
itemValue: openChangeSetBrowser |
|
2205 |
translateLabel: true |
|
6602 | 2206 |
isVisible: changeSetBrowserItemVisible |
4230 | 2207 |
) |
5830 | 2208 |
(MenuItem |
6022 | 2209 |
enabled: hasFileSelection |
2210 |
label: 'Workspace' |
|
2211 |
itemValue: openWorkspace |
|
2212 |
translateLabel: true |
|
2213 |
) |
|
2214 |
(MenuItem |
|
2215 |
label: '-' |
|
2216 |
) |
|
2217 |
(MenuItem |
|
5830 | 2218 |
enabled: canReadAbbrevFile |
2219 |
label: 'Install Autoloaded' |
|
2220 |
itemValue: readAbbrevFile |
|
2221 |
translateLabel: true |
|
4230 | 2222 |
) |
5830 | 2223 |
(MenuItem |
2224 |
enabled: anySTFilesPresent |
|
6521 | 2225 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 2226 |
itemValue: installAllAsAutoloaded |
2227 |
translateLabel: true |
|
4230 | 2228 |
) |
5830 | 2229 |
(MenuItem |
6586 | 2230 |
enabled: recursiveAnySTFilesPresent |
6521 | 2231 |
label: 'Recursive Install All ST-Files as Autoloaded' |
2232 |
itemValue: installAllAsAutoloadedRecursive |
|
2233 |
translateLabel: true |
|
2234 |
) |
|
2235 |
(MenuItem |
|
5830 | 2236 |
label: '-' |
4230 | 2237 |
) |
5830 | 2238 |
(MenuItem |
6593 | 2239 |
label: 'File Operations' |
2240 |
translateLabel: true |
|
2241 |
submenuChannel: fileOpMenu |
|
2242 |
) |
|
2243 |
(MenuItem |
|
5830 | 2244 |
label: 'File Utilities' |
2245 |
translateLabel: true |
|
2246 |
submenu: |
|
2247 |
(Menu |
|
2248 |
( |
|
2249 |
(MenuItem |
|
2250 |
enabled: hasFileSelection |
|
2251 |
label: 'Editor' |
|
2252 |
itemValue: openEditor |
|
2253 |
translateLabel: true |
|
4820 | 2254 |
) |
5830 | 2255 |
(MenuItem |
2256 |
enabled: hasFileSelection |
|
2257 |
label: 'HTML Reader' |
|
2258 |
itemValue: openHTMLReader |
|
2259 |
translateLabel: true |
|
4820 | 2260 |
) |
5830 | 2261 |
(MenuItem |
8832 | 2262 |
enabled: hasFileSelection |
2263 |
label: 'Web Browser' |
|
2264 |
itemValue: openWebBrowser |
|
2265 |
translateLabel: true |
|
2266 |
) |
|
2267 |
(MenuItem |
|
7869 | 2268 |
label: 'XML Inspector' |
9784 | 2269 |
itemValue: inspectXmlFile |
7869 | 2270 |
translateLabel: true |
2271 |
isVisible: hasXml |
|
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2272 |
showBusyCursorWhilePerforming: true |
7869 | 2273 |
) |
2274 |
(MenuItem |
|
5830 | 2275 |
enabled: hasFileSelection |
2276 |
label: 'Acroread (PDF Viewer)' |
|
2277 |
itemValue: openPDFViewer |
|
2278 |
translateLabel: true |
|
4820 | 2279 |
) |
5830 | 2280 |
(MenuItem |
2281 |
enabled: hasASN1AndSelection |
|
2282 |
label: 'ASN1 Browser' |
|
2283 |
itemValue: openASN1Browser |
|
2284 |
translateLabel: true |
|
2285 |
isVisible: hasASN1 |
|
4820 | 2286 |
) |
5830 | 2287 |
(MenuItem |
2288 |
enabled: hasCBrowser |
|
2289 |
label: 'C Browser' |
|
2290 |
itemValue: openCBrowser |
|
2291 |
translateLabel: true |
|
2292 |
isVisible: hasCBrowser |
|
4820 | 2293 |
) |
5830 | 2294 |
(MenuItem |
2295 |
enabled: hasJavaAndSelection |
|
2296 |
label: 'Applet Viewer' |
|
2297 |
itemValue: openAppletViewer |
|
2298 |
translateLabel: true |
|
2299 |
isVisible: hasJava |
|
4820 | 2300 |
) |
5830 | 2301 |
(MenuItem |
2302 |
enabled: hasMP3PlayerAndSelection |
|
2303 |
label: 'MP3 Player' |
|
2304 |
itemValue: openMP3Player |
|
2305 |
translateLabel: true |
|
2306 |
isVisible: hasMP3Player |
|
4820 | 2307 |
) |
5830 | 2308 |
(MenuItem |
2309 |
enabled: hasFileSelection |
|
2310 |
label: 'xv (Image Viewer)' |
|
2311 |
itemValue: openXV |
|
2312 |
translateLabel: true |
|
6460 | 2313 |
isVisible: systemIsUnix |
4950 | 2314 |
) |
5830 | 2315 |
(MenuItem |
2316 |
enabled: currentFilesAreInSameDirectory |
|
2317 |
label: 'Slide Show' |
|
2318 |
itemValue: openSlideShow |
|
2319 |
translateLabel: true |
|
2320 |
isVisible: hasSlideShow |
|
4820 | 2321 |
) |
5830 | 2322 |
(MenuItem |
2323 |
enabled: hasFileSelection |
|
2324 |
label: 'gv (Postscript Viewer)' |
|
2325 |
itemValue: openGV |
|
2326 |
translateLabel: true |
|
6460 | 2327 |
isVisible: systemIsUnix |
2328 |
) |
|
2329 |
(MenuItem |
|
2330 |
enabled: hasMP3PlayerAndSelection |
|
2331 |
label: 'MP3 Player' |
|
2332 |
itemValue: openMP3Player |
|
2333 |
translateLabel: true |
|
2334 |
isVisible: hasMP3Player |
|
4957 | 2335 |
) |
5830 | 2336 |
(MenuItem |
2337 |
enabled: hasFileSelection |
|
9509 | 2338 |
label: 'Realplay (avi viewer)' |
5830 | 2339 |
itemValue: openRP |
2340 |
translateLabel: true |
|
6460 | 2341 |
isVisible: systemIsUnix |
2342 |
) |
|
2343 |
(MenuItem |
|
2344 |
label: '-' |
|
2345 |
) |
|
2346 |
(MenuItem |
|
2347 |
label: 'Smalltalk' |
|
2348 |
translateLabel: true |
|
2349 |
submenu: |
|
2350 |
(Menu |
|
2351 |
( |
|
2352 |
(MenuItem |
|
2353 |
enabled: hasSnapshotSelection |
|
2354 |
label: 'Snapshot Image Browser' |
|
2355 |
itemValue: openSnapshotImageBrowser |
|
2356 |
translateLabel: true |
|
2357 |
) |
|
2358 |
(MenuItem |
|
2359 |
enabled: canCreateNewProject |
|
2360 |
label: 'Create Smalltalk Project' |
|
2361 |
itemValue: createProjectAndOpenProjectBrowser |
|
2362 |
translateLabel: true |
|
2363 |
) |
|
2364 |
(MenuItem |
|
2365 |
label: '-' |
|
2366 |
) |
|
2367 |
(MenuItem |
|
8426 | 2368 |
enabled: hasResourceFileSelected |
6460 | 2369 |
label: 'Show Contents of Resourcefile' |
2370 |
itemValue: readAndShowResources |
|
2371 |
translateLabel: true |
|
2372 |
) |
|
8426 | 2373 |
(MenuItem |
2374 |
enabled: hasResourceFileSelected |
|
2375 |
label: 'Resource File Editor' |
|
2376 |
itemValue: openResourceFileEditor |
|
2377 |
translateLabel: true |
|
2378 |
showBusyCursorWhilePerforming: true |
|
2379 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2380 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2381 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2382 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2383 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2384 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2385 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2386 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2387 |
translateLabel: true |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2388 |
) |
6460 | 2389 |
) |
2390 |
nil |
|
2391 |
nil |
|
2392 |
) |
|
2393 |
) |
|
2394 |
(MenuItem |
|
2395 |
label: 'Image' |
|
2396 |
translateLabel: true |
|
2397 |
submenu: |
|
2398 |
(Menu |
|
2399 |
( |
|
2400 |
(MenuItem |
|
2401 |
enabled: hasFileSelection |
|
2402 |
label: 'Image Editor' |
|
2403 |
itemValue: openImageEditor |
|
2404 |
translateLabel: true |
|
2405 |
) |
|
2406 |
(MenuItem |
|
2407 |
enabled: hasFileSelection |
|
2408 |
label: 'Image Preview' |
|
2409 |
itemValue: openImagePreview |
|
2410 |
translateLabel: true |
|
2411 |
) |
|
2412 |
(MenuItem |
|
2413 |
enabled: hasFileSelection |
|
2414 |
label: 'Image Inspector' |
|
2415 |
itemValue: openImageInspector |
|
2416 |
translateLabel: true |
|
2417 |
) |
|
2418 |
(MenuItem |
|
2419 |
label: '-' |
|
2420 |
) |
|
2421 |
(MenuItem |
|
2422 |
enabled: hasFileSelection |
|
2423 |
label: 'Convert to GIF' |
|
2424 |
itemValue: convertImageToGIF |
|
2425 |
translateLabel: true |
|
2426 |
) |
|
2427 |
(MenuItem |
|
2428 |
enabled: hasFileSelection |
|
2429 |
label: 'Convert to PNG' |
|
2430 |
itemValue: convertImageToPNG |
|
2431 |
translateLabel: true |
|
2432 |
) |
|
2433 |
(MenuItem |
|
2434 |
enabled: hasFileSelection |
|
2435 |
label: 'Convert to XPM' |
|
2436 |
itemValue: convertImageToXPM |
|
2437 |
translateLabel: true |
|
2438 |
) |
|
2439 |
(MenuItem |
|
2440 |
enabled: hasFileSelection |
|
2441 |
label: 'Convert to JPG' |
|
2442 |
itemValue: convertImageToJPG |
|
2443 |
translateLabel: true |
|
2444 |
) |
|
2445 |
) |
|
2446 |
nil |
|
2447 |
nil |
|
2448 |
) |
|
2449 |
) |
|
2450 |
(MenuItem |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
2451 |
enabled: hasZipFileSelectedHolder |
6460 | 2452 |
label: 'ZipFile Tool' |
2453 |
itemValue: openZipTool |
|
2454 |
translateLabel: true |
|
2455 |
) |
|
2456 |
(MenuItem |
|
2457 |
enabled: hasFileSelection |
|
2458 |
label: 'Hex Dump' |
|
2459 |
itemValue: fileHexDump |
|
2460 |
translateLabel: true |
|
4958 | 2461 |
) |
4820 | 2462 |
) |
2463 |
nil |
|
2464 |
nil |
|
2465 |
) |
|
4230 | 2466 |
) |
5830 | 2467 |
(MenuItem |
2468 |
label: 'Find' |
|
2469 |
translateLabel: true |
|
2470 |
submenu: |
|
2471 |
(Menu |
|
2472 |
( |
|
2473 |
(MenuItem |
|
2474 |
label: 'File...' |
|
2475 |
itemValue: fileFindFile |
|
2476 |
translateLabel: true |
|
4367 | 2477 |
) |
5830 | 2478 |
(MenuItem |
10306 | 2479 |
label: 'Same Contents as Selected...' |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2480 |
itemValue: fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2481 |
translateLabel: true |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2482 |
) |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2483 |
(MenuItem |
5830 | 2484 |
label: 'Duplicate Files' |
2485 |
itemValue: fileFindDuplicates |
|
2486 |
translateLabel: true |
|
5082 | 2487 |
) |
5830 | 2488 |
(MenuItem |
2489 |
enabled: hasSelection |
|
2490 |
label: 'All Duplicate Files (Recursive)' |
|
2491 |
itemValue: fileFindAllDuplicates |
|
2492 |
translateLabel: true |
|
4367 | 2493 |
) |
8510 | 2494 |
(MenuItem |
2495 |
label: 'Similar Image Files' |
|
2496 |
itemValue: fileFindSimilarImages |
|
2497 |
translateLabel: true |
|
2498 |
isVisible: hasImageColorHistogram |
|
2499 |
) |
|
4367 | 2500 |
) |
2501 |
nil |
|
2502 |
nil |
|
2503 |
) |
|
4230 | 2504 |
) |
2505 |
) |
|
2506 |
nil |
|
2507 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2508 |
) |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2509 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2510 |
|
4018 | 2511 |
viewDetailsMenuSpec |
2512 |
"This resource specification was automatically generated |
|
2513 |
by the MenuEditor of ST/X." |
|
2514 |
||
2515 |
"Do not manually edit this!! If it is corrupted, |
|
2516 |
the MenuEditor may not be able to read the specification." |
|
2517 |
||
2518 |
" |
|
4648 | 2519 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2520 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2521 |
" |
2522 |
||
2523 |
<resource: #menu> |
|
2524 |
||
2525 |
^ |
|
2526 |
#(#Menu |
|
4414 | 2527 |
#( |
2528 |
#(#MenuItem |
|
2529 |
#label: '-' |
|
2530 |
) |
|
2531 |
#(#MenuItem |
|
2532 |
#label: 'Hidden Files' |
|
2533 |
#translateLabel: true |
|
2534 |
#indication: #showHiddenFiles |
|
2535 |
) |
|
2536 |
) |
|
2537 |
nil |
|
2538 |
nil |
|
4018 | 2539 |
) |
3892 | 2540 |
! ! |
2541 |
||
11144 | 2542 |
!AbstractFileBrowser class methodsFor:'menu specs-scm'! |
2543 |
||
2544 |
cvsMenu |
|
2545 |
"This resource specification was automatically generated |
|
2546 |
by the MenuEditor of ST/X." |
|
2547 |
||
2548 |
"Do not manually edit this!! If it is corrupted, |
|
2549 |
the MenuEditor may not be able to read the specification." |
|
2550 |
||
11149 | 2551 |
|
11144 | 2552 |
" |
2553 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
2554 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
2555 |
" |
|
2556 |
||
2557 |
<resource: #menu> |
|
2558 |
||
2559 |
^ |
|
11149 | 2560 |
#(Menu |
2561 |
( |
|
2562 |
(MenuItem |
|
2563 |
label: 'Commit (CVS)...' |
|
2564 |
itemValue: cvsCommit |
|
2565 |
translateLabel: true |
|
2566 |
) |
|
2567 |
(MenuItem |
|
2568 |
enabled: canCvsAddAndCommit |
|
2569 |
label: 'Add && Commit...' |
|
2570 |
itemValue: cvsAddAndCommit |
|
2571 |
translateLabel: true |
|
2572 |
) |
|
2573 |
(MenuItem |
|
2574 |
enabled: canCvsAddAndCommit |
|
2575 |
label: 'Add as Binary && Commit...' |
|
2576 |
itemValue: cvsAddBinaryAndCommit |
|
2577 |
translateLabel: true |
|
2578 |
) |
|
2579 |
(MenuItem |
|
2580 |
label: '-' |
|
2581 |
) |
|
2582 |
(MenuItem |
|
2583 |
enabled: hasSelection |
|
2584 |
label: 'Update selected Files/Directories' |
|
2585 |
itemValue: cvsUpdateSelection |
|
2586 |
translateLabel: true |
|
2587 |
) |
|
2588 |
(MenuItem |
|
2589 |
label: 'Update Directory Local' |
|
2590 |
itemValue: cvsUpdateAll |
|
2591 |
translateLabel: true |
|
2592 |
) |
|
2593 |
(MenuItem |
|
2594 |
label: 'Update Directory Recursive' |
|
2595 |
itemValue: cvsUpdateAllRecursive |
|
2596 |
translateLabel: true |
|
2597 |
) |
|
2598 |
(MenuItem |
|
2599 |
label: '-' |
|
2600 |
) |
|
2601 |
(MenuItem |
|
2602 |
enabled: hasSelection |
|
2603 |
label: 'Tag...' |
|
2604 |
itemValue: cvsTagSelection |
|
2605 |
translateLabel: true |
|
2606 |
) |
|
2607 |
(MenuItem |
|
2608 |
enabled: hasSelection |
|
2609 |
label: 'Revision Log' |
|
2610 |
itemValue: cvsRevisionLog |
|
2611 |
translateLabel: true |
|
2612 |
) |
|
2613 |
(MenuItem |
|
2614 |
enabled: hasSelection |
|
2615 |
label: 'Compare with newest in Repository' |
|
2616 |
itemValue: cvsCompareWithNewest |
|
2617 |
translateLabel: true |
|
2618 |
) |
|
2619 |
(MenuItem |
|
2620 |
label: '-' |
|
2621 |
) |
|
2622 |
(MenuItem |
|
2623 |
enabled: canRemoveCVSContainer |
|
2624 |
label: 'Remove File && CVS Container...' |
|
2625 |
itemValue: cvsRemoveFileAndCVSContainer |
|
2626 |
translateLabel: true |
|
11144 | 2627 |
) |
2628 |
) |
|
2629 |
nil |
|
2630 |
nil |
|
2631 |
) |
|
2632 |
! |
|
2633 |
||
2634 |
mercurialMenu |
|
2635 |
"This resource specification was automatically generated |
|
2636 |
by the MenuEditor of ST/X." |
|
2637 |
||
2638 |
"Do not manually edit this!! If it is corrupted, |
|
2639 |
the MenuEditor may not be able to read the specification." |
|
2640 |
||
2641 |
||
2642 |
" |
|
2643 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu |
|
2644 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp |
|
2645 |
" |
|
2646 |
||
2647 |
<resource: #menu> |
|
2648 |
||
2649 |
^ |
|
2650 |
#(Menu |
|
2651 |
( |
|
2652 |
(MenuItem |
|
2653 |
label: 'Add' |
|
2654 |
itemValue: mercurialAdd |
|
2655 |
translateLabel: true |
|
2656 |
) |
|
2657 |
(MenuItem |
|
2658 |
label: 'Commit Changes' |
|
2659 |
itemValue: mercurialCommit |
|
2660 |
translateLabel: true |
|
2661 |
) |
|
2662 |
(MenuItem |
|
2663 |
label: 'Push...' |
|
2664 |
itemValue: mercurialPush |
|
2665 |
translateLabel: true |
|
2666 |
) |
|
2667 |
(MenuItem |
|
2668 |
label: 'Status' |
|
2669 |
itemValue: mercurialStatus |
|
2670 |
translateLabel: true |
|
2671 |
) |
|
2672 |
(MenuItem |
|
2673 |
label: '-' |
|
2674 |
) |
|
2675 |
(MenuItem |
|
2676 |
label: 'Init' |
|
2677 |
itemValue: mercurialInit |
|
2678 |
translateLabel: true |
|
2679 |
) |
|
2680 |
) |
|
2681 |
nil |
|
2682 |
nil |
|
2683 |
) |
|
2684 |
||
2685 |
"Modified: / 17-01-2012 / 15:57:40 / cg" |
|
2686 |
! |
|
2687 |
||
2688 |
perforceMenu |
|
2689 |
"This resource specification was automatically generated |
|
2690 |
by the MenuEditor of ST/X." |
|
2691 |
||
2692 |
"Do not manually edit this!! If it is corrupted, |
|
2693 |
the MenuEditor may not be able to read the specification." |
|
2694 |
||
2695 |
||
2696 |
" |
|
2697 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu |
|
2698 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp |
|
2699 |
" |
|
2700 |
||
2701 |
<resource: #menu> |
|
2702 |
||
2703 |
^ |
|
2704 |
#(Menu |
|
2705 |
( |
|
2706 |
(MenuItem |
|
2707 |
label: 'Commit' |
|
2708 |
itemValue: perforceCommit |
|
2709 |
translateLabel: true |
|
2710 |
) |
|
2711 |
) |
|
2712 |
nil |
|
2713 |
nil |
|
2714 |
) |
|
2715 |
||
2716 |
"Created: / 15-01-2012 / 13:12:30 / cg" |
|
2717 |
! ! |
|
2718 |
||
3892 | 2719 |
!AbstractFileBrowser class methodsFor:'misc'! |
2720 |
||
2721 |
newLock |
|
2722 |
^ CodeExecutionLock new |
|
2723 |
! ! |
|
2724 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2725 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2726 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2727 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2728 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2729 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2730 |
|
4610 | 2731 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2732 |
||
11262 | 2733 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart |
2734 |
"utility helper: generate a hexDump with addresses" |
|
2735 |
||
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2736 |
|lines nHexLines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2737 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2738 |
"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
|
2739 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2740 |
nHexLines := (data size + 15) // 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2741 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2742 |
lines := VirtualArray new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2743 |
lines setSize:nHexLines + (nHexLines // 16). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2744 |
lines |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2745 |
generator:[:lineNr | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2746 |
|blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2747 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2748 |
blockNr := (lineNr - 1) // 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2749 |
lineNrInBlock := (lineNr - 1) \\ 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2750 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2751 |
lineNrInBlock == 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2752 |
line := '' |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2753 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2754 |
startOffset := ((blockNr * 16) + lineNrInBlock) * 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2755 |
lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2756 |
asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2757 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2758 |
lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2759 |
lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2760 |
1 to:16 do:[:i | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2761 |
i ~~ 1 ifTrue:[ lineStream space ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2762 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2763 |
(startOffset + i) > data size ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2764 |
asciiLineStream nextPut:(Character space). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2765 |
lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2766 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2767 |
byte := data at:startOffset + i. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2768 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2769 |
lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2770 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2771 |
(byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2772 |
asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2773 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2774 |
asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2775 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2776 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2777 |
]. |
12421 | 2778 |
line := (lineStream contents paddedTo:(addrDigits + 1 + (3*16)+ 8)) |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2779 |
, asciiLineStream contents. |
11262 | 2780 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2781 |
line |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2782 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2783 |
^ lines. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2784 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2785 |
"/ |offs |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2786 |
"/ col line lineStream asciiLineStream lines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2787 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2788 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2789 |
"/ offs := virtualStart. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2790 |
"/ lines := StringCollection new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2791 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2792 |
"/ lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2793 |
"/ asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2794 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2795 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2796 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2797 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2798 |
"/ data do:[:byte | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2799 |
"/ lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2800 |
"/ (byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2801 |
"/ asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2802 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2803 |
"/ asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2804 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2805 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2806 |
"/ offs := offs + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2807 |
"/ col := col + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2808 |
"/ col > 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2809 |
"/ lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2810 |
"/ lineStream nextPutAll:asciiLineStream contents. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2811 |
"/ lines add:(lineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2812 |
"/ (offs bitAnd:16rFF) == 0 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2813 |
"/ lines add:nil |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2814 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2815 |
"/ lineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2816 |
"/ asciiLineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2817 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2818 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2819 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2820 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2821 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2822 |
"/ lineStream space |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2823 |
"/ ] |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2824 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2825 |
"/ line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2826 |
"/ lines add:(line , ' ' , asciiLineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2827 |
"/ ^ lines |
11262 | 2828 |
|
2829 |
"Created: / 13-02-2012 / 15:01:46 / cg" |
|
2830 |
! |
|
2831 |
||
4610 | 2832 |
contentsOfFileAsHexDump:f |
8472 | 2833 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2834 |
! |
|
2835 |
||
2836 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2837 |
|resources fileName stream data offs |
11262 | 2838 |
addrDigits col lines answer sizeLimit showLastPart| |
4610 | 2839 |
|
2840 |
resources := self classResources. |
|
2841 |
||
2842 |
fileName := f baseName. |
|
2843 |
f isDirectory ifTrue:[ |
|
2844 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2845 |
^ nil |
|
2846 |
]. |
|
2847 |
f exists ifFalse:[ |
|
2848 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2849 |
^ nil |
|
2850 |
]. |
|
2851 |
f isReadable ifFalse:[ |
|
2852 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2853 |
^ nil |
|
2854 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2855 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2856 |
limitOrNil notNil ifTrue:[ |
2857 |
sizeLimit := limitOrNil. |
|
2858 |
showLastPart := showLastPartOrNil |
|
2859 |
] ifFalse:[ |
|
2860 |
answer := Dialog |
|
2861 |
confirmWithCancel:(resources |
|
2862 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2863 |
with:(fileName contractTo:40) allBold |
|
2864 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2865 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2866 |
||
2867 |
answer isNil ifTrue:[^ nil]. |
|
2868 |
answer ifTrue:[ |
|
2869 |
sizeLimit := 4 * 1024 * 1024 |
|
2870 |
]. |
|
8436 | 2871 |
]. |
4610 | 2872 |
]. |
2873 |
||
2874 |
stream := f readStream binary. |
|
8436 | 2875 |
sizeLimit notNil ifTrue:[ |
8472 | 2876 |
showLastPart == true ifTrue:[ |
2877 |
stream position:(f fileSize - sizeLimit). |
|
2878 |
]. |
|
8436 | 2879 |
data := stream nextBytes:sizeLimit. |
2880 |
] ifFalse:[ |
|
2881 |
data := stream contents. |
|
2882 |
]. |
|
4610 | 2883 |
stream close. |
2884 |
||
2885 |
col := 1. |
|
2886 |
offs := 0. |
|
2887 |
lines := StringCollection new. |
|
2888 |
||
2889 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2890 |
||
11262 | 2891 |
^ self |
2892 |
contentsOfBytesAsHexDump:data |
|
2893 |
numberOfAddressDigits:addrDigits |
|
2894 |
addressStart:0 |
|
2895 |
||
2896 |
"Modified: / 13-02-2012 / 15:01:19 / cg" |
|
4610 | 2897 |
! ! |
2898 |
||
3892 | 2899 |
!AbstractFileBrowser methodsFor:'actions'! |
2900 |
||
2901 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2902 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2903 |
Then evaluate aBlock passing the command-string as argument." |
2904 |
||
4523 | 2905 |
|box osName commandString| |
3892 | 2906 |
|
2907 |
osName := OperatingSystem platformName. |
|
2908 |
||
2909 |
box := FilenameEnterBox |
|
4414 | 2910 |
title:(resources string:'Execute %1 command:' with:osName) |
2911 |
okText:(resources string:'Execute') |
|
4523 | 2912 |
action:[:cmd | commandString := cmd]. |
3892 | 2913 |
|
2914 |
fileName notNil ifTrue:[ |
|
4414 | 2915 |
self initialCommandFor:fileName into:box. |
3892 | 2916 |
]. |
2917 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2918 |
box show. |
3892 | 2919 |
box destroy. |
2920 |
||
4523 | 2921 |
commandString notNil ifTrue:[ |
2922 |
aBlock value:commandString |
|
2923 |
]. |
|
2924 |
||
3892 | 2925 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2926 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2927 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2928 |
! |
|
2929 |
||
2930 |
changeFileBrowserTitleTo:aString |
|
4774 | 2931 |
self |
2932 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2933 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2934 |
! |
2935 |
||
2936 |
copyFileList |
|
4774 | 2937 |
"copy the fileList to the clipBoard" |
2938 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2939 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2940 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2941 |
fileList := self |
4774 | 2942 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2943 |
ifPresentDo:[:app | app browserFileList]. |
2944 |
||
2945 |
fileList notNil ifTrue:[ |
|
2946 |
self copyFileListToClipBoard:fileList. |
|
2947 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2948 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2949 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2950 |
copyFileListToClipBoard:fileList |
4774 | 2951 |
"copy the itemList to the clipBoard" |
2952 |
||
2953 |
|stream| |
|
2954 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2955 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2956 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2957 |
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
|
2958 |
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
|
2959 |
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
|
2960 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2961 |
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
|
2962 |
(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
|
2963 |
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
|
2964 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2965 |
]. |
3892 | 2966 |
]. |
6034 | 2967 |
self window setClipboardText:stream contents. |
3892 | 2968 |
! |
2969 |
||
2970 |
copySelectedFilenames |
|
4774 | 2971 |
"copy the selected fileNames to the clipBoard" |
2972 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2973 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2974 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2975 |
fileList := self |
4774 | 2976 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2977 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2978 |
fileList notNil ifTrue:[ |
|
2979 |
self copyFileListToClipBoard:fileList. |
|
2980 |
]. |
|
3892 | 2981 |
! |
2982 |
||
10923 | 2983 |
doAddArchiver |
2984 |
|files| |
|
2985 |
||
2986 |
files := self currentSelectedFiles. |
|
2987 |
files size == 1 ifFalse:[ |
|
2988 |
Dialog information:'Select exactly one archive.'. |
|
2989 |
^ self |
|
2990 |
]. |
|
2991 |
||
2992 |
self |
|
2993 |
applicationNamed:#FileApplicationNoteBook |
|
2994 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
2995 |
||
2996 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
2997 |
! |
|
2998 |
||
3892 | 2999 |
doAddTerminal |
5960 | 3000 |
|dir| |
3001 |
||
3002 |
dir := self currentDirectory. |
|
3892 | 3003 |
|
5960 | 3004 |
dir isNil ifTrue:[ |
4414 | 3005 |
dir := Filename homeDirectory |
3892 | 3006 |
]. |
4774 | 3007 |
|
5009 | 3008 |
self |
3009 |
applicationNamed:#FileApplicationNoteBook |
|
3010 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 3011 |
! |
3012 |
||
3013 |
doOpenSearchFile |
|
5961 | 3014 |
|item file| |
3015 |
||
3016 |
file := self firstSelectedFileName. |
|
3017 |
file isNil ifTrue:[ |
|
3018 |
file := Filename homeDirectory asAbsoluteFilename. |
|
3019 |
]. |
|
3020 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 3021 |
self openSearchFileOn:item. |
3022 |
! |
|
3023 |
||
3024 |
doShowFileContents |
|
5009 | 3025 |
self |
3026 |
applicationNamed:#DirectoryContentsBrowser |
|
3027 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
3028 |
||
3029 |
^ nil |
|
3892 | 3030 |
! |
3031 |
||
3032 |
doShowProperties |
|
3033 |
"show long stat (file)-info" |
|
3034 |
||
3035 |
self fileGetInfo:true |
|
3036 |
! |
|
3037 |
||
5528 | 3038 |
fileEncodingDialog |
3039 |
"open a dialog to allow change of the files character encoding. |
|
3040 |
Files are converted to internal encoding when read, and converted back |
|
3041 |
to this encoding when saved. |
|
3042 |
Notice: currently, not too many encodings are supported by the system." |
|
3043 |
||
3044 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
3045 |
||
3046 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
3047 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
3048 |
||
3049 |
bindings := IdentityDictionary new. |
|
3050 |
bindings at:#encodingList put:encodingDescr. |
|
3051 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 3052 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
3053 |
||
5528 | 3054 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
3055 |
ifTrue:[ |
|
3056 |
idx := (bindings at:#selectedEncoding) value. |
|
3057 |
selectedEncoding := encodings at:idx. |
|
3058 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 3059 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 3060 |
]. |
5737 | 3061 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 3062 |
]. |
3063 |
||
3064 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
3065 |
! |
|
3066 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3067 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3068 |
"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
|
3069 |
|
5959 | 3070 |
|currentFileNameHolder currentSel| |
3071 |
||
3072 |
currentFileNameHolder := self currentFileNameHolder. |
|
3073 |
||
3074 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3075 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 3076 |
self withWaitCursorDo:[ |
3077 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
3078 |
] |
|
3079 |
]. |
|
3080 |
||
3081 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 3082 |
! |
3083 |
||
11053 | 3084 |
lineEndConventionDialog |
3085 |
"open a dialog to allow change of the line end conventions |
|
3086 |
(when writing files)" |
|
3087 |
||
3088 |
|bindings| |
|
3089 |
||
3090 |
bindings := IdentityDictionary new. |
|
3091 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
3092 |
||
3093 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
3094 |
ifTrue:[ |
|
3095 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value |
|
3096 |
]. |
|
3097 |
||
3098 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
3099 |
! |
|
3100 |
||
4392 | 3101 |
newTextEditor |
5009 | 3102 |
self |
3103 |
applicationNamed:#FileApplicationNoteBook |
|
3104 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
3105 |
||
3106 |
^ nil. |
|
3107 |
! |
|
3108 |
||
3109 |
openApplByFileItem:anItem |
|
8490 | 3110 |
"/ q: is the following always wanted ? |
9267 | 3111 |
self window sensor shiftDown ifFalse:[ |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3112 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3113 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3114 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3115 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3116 |
"/ ]. |
9267 | 3117 |
|
8490 | 3118 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
3119 |
"/ Error handle:[:ex | |
|
3120 |
"/ ] do:[ |
|
3121 |
"/ OperatingSystem |
|
3122 |
"/ shellExecute:nil |
|
3123 |
"/ lpOperation:'open' |
|
3124 |
"/ lpFile:(anItem fileName pathName) |
|
3125 |
"/ lpParameters:nil |
|
3126 |
"/ lpDirectory:(self directory pathName) |
|
3127 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
3128 |
"/ ^ self. |
|
3129 |
"/ ] |
|
3130 |
"/ ] |
|
9267 | 3131 |
]. |
5306 | 3132 |
^ self |
5009 | 3133 |
applicationNamed:#FileApplicationNoteBook |
5306 | 3134 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3135 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3136 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
3892 | 3137 |
! |
3138 |
||
4392 | 3139 |
openApplForFile:aFilename |
5306 | 3140 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 3141 |
! |
3142 |
||
3892 | 3143 |
openCommandResultApplication |
3144 |
||
5009 | 3145 |
self |
3146 |
applicationNamed:#FileApplicationNoteBook |
|
3147 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
3148 |
||
3149 |
^ nil |
|
3892 | 3150 |
! |
3151 |
||
5010 | 3152 |
openNewTextEditorOn:anItem |
5009 | 3153 |
self |
3154 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3155 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3156 |
|
3157 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3158 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3159 |
|
5010 | 3160 |
openSearchFileOn:anItem |
5009 | 3161 |
self |
3162 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3163 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3164 |
|
3165 |
^ nil. |
|
3892 | 3166 |
! |
3167 |
||
5162 | 3168 |
openTextEditorForFile:aFilename |
3169 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3170 |
! |
|
3171 |
||
5010 | 3172 |
openTextEditorOn:anItem |
5009 | 3173 |
self |
3174 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3175 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3176 |
|
3177 |
^ nil. |
|
3892 | 3178 |
! |
3179 |
||
5010 | 3180 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3181 |
self |
3182 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3183 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3184 |
|
3185 |
^ nil. |
|
4618 | 3186 |
! |
3187 |
||
5959 | 3188 |
setCurrentFileName:aFilename |
3189 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3190 |
! |
|
3191 |
||
3192 |
setCurrentFileNames:aCollectionOfFilenames |
|
3193 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3194 |
! |
|
3195 |
||
11053 | 3196 |
tabStopConversionDialog |
3197 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3198 |
||
3199 |
|bindings| |
|
3200 |
||
3201 |
bindings := IdentityDictionary new. |
|
3202 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3203 |
||
3204 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3205 |
ifTrue:[ |
|
3206 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3207 |
]. |
|
3208 |
||
3209 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3210 |
! |
|
3211 |
||
3892 | 3212 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3213 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3214 |
aColOfFiles notNil ifTrue:[ |
5959 | 3215 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3216 |
]. |
3892 | 3217 |
! |
3218 |
||
3219 |
updateCurrentDirectory |
|
5739 | 3220 |
self updateCurrentDirectory:false |
3221 |
! |
|
3222 |
||
3223 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3224 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3225 |
|
5009 | 3226 |
self |
3227 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3228 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3229 |
self |
3230 |
applicationNamed:#DirectoryTreeBrowser |
|
3231 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3232 |
! |
3233 |
||
5739 | 3234 |
updateCurrentDirectoryWithReread |
3235 |
self updateCurrentDirectory:true |
|
3236 |
! |
|
3237 |
||
4345 | 3238 |
withActivityIndicationDo:aBlock |
3239 |
||
3240 |
self activityVisibilityChannel value:true. |
|
3241 |
[ |
|
9361 | 3242 |
self withWaitCursorDo:[ |
3243 |
aBlock value. |
|
3244 |
] |
|
4345 | 3245 |
] ensure:[ |
3246 |
self activityVisibilityChannel value:false. |
|
3247 |
] |
|
3892 | 3248 |
! ! |
3249 |
||
3250 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3251 |
||
3252 |
addBookmark |
|
3253 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3254 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3255 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3256 |
! |
3257 |
||
3258 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3259 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3260 |
self class addBookmark:path |
3892 | 3261 |
]. |
3262 |
! |
|
3263 |
||
8013 | 3264 |
editBookmarks |
3265 |
||
3266 |
| default selectedDirectories | |
|
3267 |
||
3268 |
selectedDirectories := self currentSelectedDirectories. |
|
3269 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
3270 |
self class editBookmarksWithDefault: default. |
|
3271 |
! |
|
3272 |
||
3892 | 3273 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3274 |
^ self class hasBookmarks |
3892 | 3275 |
! |
3276 |
||
3277 |
hasBookmarksToRemove |
|
3278 |
|bookmarks directories| |
|
3279 |
||
3982 | 3280 |
directories := self currentSelectedDirectories. |
3892 | 3281 |
bookmarks := self class directoryBookmarks. |
3282 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
3283 |
! |
|
3284 |
||
3285 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3286 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3287 |
self class removeBookmark:dir |
3892 | 3288 |
]. |
4679 | 3289 |
! |
3290 |
||
3291 |
saveBookmarks |
|
3292 |
self class saveBookmarks |
|
3892 | 3293 |
! ! |
3294 |
||
3295 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3296 |
||
3297 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3298 |
|cmd suffix cmdHist historySize| |
3892 | 3299 |
|
3300 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3301 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3302 |
cmdHist notNil ifTrue:[ |
3303 |
cmdHist addFirst:aCommandString. |
|
6369 | 3304 |
historySize := self class commandHistorySize. |
3305 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3306 |
cmdHist removeLast |
3307 |
] |
|
3308 |
]. |
|
3309 |
aFilename notNil ifTrue:[ |
|
3310 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3311 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3312 |
DefaultCommandPerSuffix := Dictionary new. |
|
3313 |
]. |
|
3314 |
suffix := aFilename asFilename suffix. |
|
3315 |
suffix notNil ifTrue:[ |
|
3316 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3317 |
] |
|
3318 |
] |
|
3892 | 3319 |
] |
3320 |
! |
|
3321 |
||
3322 |
doBack |
|
6286 | 3323 |
"go backward in the history" |
3892 | 3324 |
|
4022 | 3325 |
| fileName| |
3326 |
||
6369 | 3327 |
fileName := self directoryHistory goBackward. |
3892 | 3328 |
fileName notNil ifTrue:[ |
4347 | 3329 |
self gotoFile:(fileName asFilename). |
3892 | 3330 |
] |
3331 |
! |
|
3332 |
||
3333 |
doForward |
|
6286 | 3334 |
"go forward in the history" |
3892 | 3335 |
|
3964 | 3336 |
| fileName| |
3337 |
||
6369 | 3338 |
fileName := self directoryHistory goForward. |
3892 | 3339 |
fileName notNil ifTrue:[ |
4414 | 3340 |
self gotoFile:(fileName asFilename). |
4022 | 3341 |
] ifFalse:[ |
4414 | 3342 |
self enableForward value:false. |
4022 | 3343 |
|
3344 |
]. |
|
3892 | 3345 |
! ! |
3346 |
||
3347 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3348 |
||
5009 | 3349 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3350 |
|appl| |
|
3351 |
||
3352 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3353 |
appl notNil ifTrue:[ |
|
3354 |
^ aBlock value:appl |
|
3355 |
]. |
|
3356 |
^ nil. |
|
3357 |
! |
|
3358 |
||
4004 | 3359 |
directoryContentsBrowser |
3360 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3361 |
! ! |
3362 |
||
3363 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3364 |
||
3365 |
applications |
|
3366 |
^ aspects at:#applications |
|
3367 |
! |
|
3368 |
||
3369 |
backgroundProcesses |
|
3370 |
||
3371 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3372 |
! |
|
3373 |
||
4230 | 3374 |
canMake |
6095 | 3375 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 3376 |
! |
3377 |
||
3892 | 3378 |
currentDirectories |
6725 | 3379 |
" returns a holder on a Collection of all currently selected directories |
3380 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3381 |
" |
3382 |
||
3383 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3384 |
! |
|
3385 |
||
6725 | 3386 |
currentDirectoriesValue |
3387 |
" returns a Collection of all currently selected directories |
|
3388 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3389 |
" |
|
3390 |
||
3391 |
^ self currentDirectories value |
|
3392 |
! |
|
3393 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3394 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3395 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3396 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3397 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3398 |
|
6725 | 3399 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3400 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3401 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3402 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3403 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3404 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3405 |
|
3892 | 3406 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3407 |
"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
|
3408 |
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
|
3409 |
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
|
3410 |
|
6589 | 3411 |
^ self aspectFor:#currentFileNameHolder |
3412 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3413 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3414 |
|
4692 | 3415 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3416 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3417 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3418 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3419 |
currentSel asValue |
6589 | 3420 |
] |
3421 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3422 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3423 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3424 |
newFilenames := Set new. |
6589 | 3425 |
filenames do:[:eachFilename| |
3426 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3427 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3428 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3429 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3430 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3431 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3432 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3433 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3434 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3435 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3436 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3437 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3438 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3439 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3440 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3441 |
! |
3442 |
||
5528 | 3443 |
defaultFileEncoding |
3444 |
^ #'iso8859-1' "/ #'utf-8' |
|
3445 |
! |
|
3446 |
||
3892 | 3447 |
enableDirectoryUp |
3448 |
||
3449 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
3450 |
! |
|
3451 |
||
6456 | 3452 |
enableGotoDefaultDirectory |
3453 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 3454 |
! |
3455 |
||
8168 | 3456 |
enableGotoDesktop |
3457 |
^ self aspectFor:#enableGotoDesktop ifAbsent:[ true asValue ]. |
|
3458 |
! |
|
3459 |
||
9572 | 3460 |
enableGotoDesktopDirectory |
3461 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ true asValue ]. |
|
3462 |
||
3463 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3464 |
! |
|
3465 |
||
6434 | 3466 |
enableGotoSmalltalkDirectory |
6456 | 3467 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3468 |
! |
3469 |
||
9677 | 3470 |
enableGotoTempDirectory |
3471 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3472 |
||
3473 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3474 |
! |
|
3475 |
||
3892 | 3476 |
enableHome |
3477 |
||
3478 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3479 |
! |
|
3480 |
||
9596 | 3481 |
enableMakeCurrentDirectory |
3482 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3483 |
||
3484 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3485 |
! |
|
3486 |
||
3892 | 3487 |
enableViewNoteBookApplication |
3488 |
||
3489 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3490 |
! |
|
3491 |
||
5528 | 3492 |
fileEncoding |
3493 |
^ self fileEncodingHolder value |
|
3494 |
! |
|
3495 |
||
3496 |
fileEncoding:newEncoding |
|
5533 | 3497 |
self fileEncodingHolder value:newEncoding. |
3498 |
||
3499 |
self |
|
3500 |
applicationNamed:#FileApplicationNoteBook |
|
3501 |
ifPresentDo:[:nb | |
|
3502 |
|appl| |
|
3503 |
||
3504 |
appl := nb selectedApplication. |
|
5535 | 3505 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3506 |
appl fileEncoding:newEncoding |
3507 |
] |
|
3508 |
]. |
|
5528 | 3509 |
! |
3510 |
||
5737 | 3511 |
fileEncodingHolder |
3512 |
^ self |
|
3513 |
aspectFor:#fileEncodingHolder |
|
3514 |
ifAbsent:[ |
|
3515 |
self |
|
3516 |
applicationNamed:#FileApplicationNoteBook |
|
3517 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3518 |
] |
|
3519 |
! |
|
3520 |
||
5961 | 3521 |
firstSelectedFileName |
3522 |
|files| |
|
3523 |
||
7560 | 3524 |
files := self currentSelectedObjects. |
5961 | 3525 |
files notEmpty ifTrue:[ |
3526 |
^ files first |
|
3527 |
]. |
|
3528 |
^ nil |
|
7560 | 3529 |
|
3530 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3531 |
! |
3532 |
||
6456 | 3533 |
gotoDefaultDirectoryIsVisible |
9596 | 3534 |
^ true. |
3535 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3536 |
||
3537 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3538 |
! |
3539 |
||
9572 | 3540 |
gotoDesktopDirectoryIsVisible |
3541 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3542 |
||
3543 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3544 |
||
3545 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3546 |
! |
|
3547 |
||
4618 | 3548 |
hasFileSelection |
3549 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3550 |
! |
|
3551 |
||
9490 | 3552 |
hasNotTwoDirectoriesSelectedHolder |
3553 |
^ self |
|
3554 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3555 |
ifAbsent:[ |
|
3556 |
BlockValue |
|
3557 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3558 |
argument:self currentFileNameHolder |
|
3559 |
]. |
|
3560 |
||
3561 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
3562 |
! |
|
3563 |
||
5830 | 3564 |
hasNotTwoFilesSelectedHolder |
9490 | 3565 |
^ self |
3566 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 3567 |
ifAbsent:[ |
3568 |
BlockValue |
|
3569 |
with:[:m | self hasTwoFilesSelected not] |
|
3570 |
argument:self currentFileNameHolder |
|
3571 |
]. |
|
9490 | 3572 |
|
3573 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 3574 |
! |
3575 |
||
3892 | 3576 |
hasSelection |
3577 |
||
3578 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
3579 |
! |
|
3580 |
||
9490 | 3581 |
hasTwoDirectoriesSelectedHolder |
3582 |
^ self |
|
3583 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
3584 |
ifAbsent:[ |
|
3585 |
BlockValue |
|
3586 |
with:[:m | self hasTwoDirectoriesSelected] |
|
3587 |
argument:self currentFileNameHolder |
|
3588 |
]. |
|
3589 |
||
3590 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
3591 |
! |
|
3592 |
||
4414 | 3593 |
hasTwoFilesSelectedHolder |
9490 | 3594 |
^ self |
3595 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3596 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3597 |
BlockValue |
5830 | 3598 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3599 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3600 |
]. |
9490 | 3601 |
|
3602 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 3603 |
! |
3604 |
||
11053 | 3605 |
inputTabColumnConversion |
3606 |
^ self inputTabColumnConversionHolder value |
|
3607 |
||
3608 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
3609 |
! |
|
3610 |
||
3611 |
inputTabColumnConversionHolder |
|
3612 |
^ self |
|
3613 |
aspectFor:#inputTabColumnConversionHolder |
|
3614 |
ifAbsent:[ |
|
3615 |
self |
|
3616 |
applicationNamed:#FileApplicationNoteBook |
|
3617 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
3618 |
] |
|
3619 |
||
3620 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
3621 |
! |
|
3622 |
||
3623 |
lineEndConvention |
|
3624 |
^ self lineEndConventionHolder value |
|
3625 |
||
3626 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
3627 |
! |
|
3628 |
||
11591 | 3629 |
lineEndConvention: aSymbol |
3630 |
self lineEndConventionHolder value: aSymbol |
|
3631 |
||
3632 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
3633 |
! |
|
3634 |
||
11053 | 3635 |
lineEndConventionHolder |
3636 |
^ self |
|
3637 |
aspectFor:#lineEndConventionHolder |
|
3638 |
ifAbsent:[ |
|
3639 |
self |
|
3640 |
applicationNamed:#FileApplicationNoteBook |
|
3641 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
3642 |
] |
|
3643 |
||
3644 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
3645 |
! |
|
3646 |
||
5737 | 3647 |
lockFileEncoding:aBoolean |
3648 |
self lockFileEncodingHolder value:aBoolean. |
|
3649 |
||
3650 |
self |
|
3651 |
applicationNamed:#FileApplicationNoteBook |
|
3652 |
ifPresentDo:[:nb | |
|
3653 |
|appl| |
|
3654 |
||
3655 |
appl := nb selectedApplication. |
|
3656 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
3657 |
appl lockFileEncoding:aBoolean |
|
3658 |
] |
|
3659 |
]. |
|
3660 |
! |
|
3661 |
||
3662 |
lockFileEncodingHolder |
|
3663 |
^ self |
|
3664 |
aspectFor:#lockFileEncodingHolder |
|
3665 |
ifAbsent:[ |
|
3666 |
self |
|
3667 |
applicationNamed:#FileApplicationNoteBook |
|
3668 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
3669 |
] |
|
3670 |
! |
|
3671 |
||
4523 | 3672 |
notify:aString |
11108 | 3673 |
"aString is shown in the lower pane" |
3674 |
||
4523 | 3675 |
self notifyChannel value:aString |
11108 | 3676 |
|
3677 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 3678 |
! |
3679 |
||
3892 | 3680 |
notifyChannel |
3681 |
||
3682 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3683 |
! |
3684 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3685 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3686 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3687 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3688 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3689 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3690 |
|
4071 | 3691 |
rootHolder |
3692 |
"holder, which keeps the rootHolder of the treeView |
|
3693 |
" |
|
3694 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3695 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3696 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3697 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3698 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3699 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3700 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3701 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3702 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3703 |
! ! |
3704 |
||
3705 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3706 |
||
3707 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3708 |
"returns the model for an aspect; these are stored in a common dictionary" |
3709 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3710 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3711 |
! |
3712 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3713 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3714 |
"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
|
3715 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3716 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3717 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3718 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3719 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3720 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3721 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3722 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3723 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3724 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3725 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3726 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3727 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3728 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3729 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3730 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3731 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3732 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3733 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3734 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3735 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3736 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3737 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3738 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3739 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3740 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3741 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3742 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3743 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3744 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3745 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3746 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3747 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3748 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3749 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3750 |
aspectFor:something put:aValueHolder |
6284 | 3751 |
"stores the model for an aspect; these are stored in a common dictionary" |
3752 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3753 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3754 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3755 |
|
3892 | 3756 |
aspects |
6284 | 3757 |
"returns the common aspect dictionary" |
3758 |
||
3892 | 3759 |
^ aspects |
3760 |
! |
|
3761 |
||
3762 |
runtimeAspectValueFor:something |
|
3763 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3764 |
" |
|
3765 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3766 |
! |
|
3767 |
||
4201 | 3768 |
saveAspectValues |
3769 |
|saveAspects aspectValue| |
|
3770 |
||
3771 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3772 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3773 |
saveAspects do:[ :aspectKey | |
4201 | 3774 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3775 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3776 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3777 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3778 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3779 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3780 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3781 |
! |
3782 |
||
3892 | 3783 |
saveRuntimeAspectValues |
3784 |
|savedAspects dictionary value isHolder aspect| |
|
3785 |
||
5941 | 3786 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3787 |
dictionary := Dictionary new. |
5941 | 3788 |
savedAspects do:[:aspectKey | |
4414 | 3789 |
aspect := self perform:aspectKey. |
3790 |
isHolder := aspect isValueModel. |
|
5941 | 3791 |
isHolder ifTrue:[ |
3792 |
value := aspect value |
|
3793 |
] ifFalse:[ |
|
3794 |
value := aspect |
|
3795 |
]. |
|
3796 |
dictionary at:aspectKey |
|
3797 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3798 |
]. |
|
3799 |
RuntimeAspects := dictionary. |
|
3892 | 3800 |
! |
3801 |
||
4201 | 3802 |
userPreferencesAspectValueFor:something |
3803 |
"returns the default aspect from the Userpreferences |
|
3892 | 3804 |
" |
4201 | 3805 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3806 |
(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
|
3807 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3808 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3809 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3810 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3811 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 3812 |
! ! |
3813 |
||
4011 | 3814 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3815 |
||
9015 | 3816 |
filter:aString |
3817 |
self filterModel value:aString |
|
3818 |
! |
|
3819 |
||
4018 | 3820 |
filterBackgroundColor |
3821 |
||
3822 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3823 |
! |
|
3824 |
||
4011 | 3825 |
filterBlockHolder |
3826 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3827 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3828 |
! |
3829 |
||
3830 |
filterListModel |
|
3831 |
||
3832 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3833 |
! |
|
3834 |
||
3835 |
filterModel |
|
5941 | 3836 |
|m| |
3837 |
||
3838 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3839 |
^ m |
|
4011 | 3840 |
! |
3841 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3842 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3843 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3844 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3845 |
|
4018 | 3846 |
filterValueBox |
3847 |
||
3848 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3849 |
! |
|
3850 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3851 |
makeFilterBlock |
9102 | 3852 |
"return a two-arg filterblock on the files path- and base-name. This block should return true for files |
3853 |
to be shown" |
|
3854 |
||
12760 | 3855 |
| filterString filterStrings filters notFilters showHidden filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3856 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3857 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3858 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3859 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3860 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3861 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 3862 |
filterStrings := filterStrings |
3863 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
3864 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3865 |
filters := filterStrings |
12760 | 3866 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
3867 |
thenCollect: |
|
3868 |
[:eachPattern | |
|
3869 |
|pattern| |
|
3870 |
||
3871 |
pattern := eachPattern withoutSeparators. |
|
3872 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
|
3873 |
]. |
|
3874 |
||
3875 |
notFilters := filterStrings |
|
3876 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
3877 |
thenCollect: |
|
3878 |
[:eachPattern | |
|
9296 | 3879 |
|pattern| |
3880 |
||
3881 |
pattern := eachPattern withoutSeparators. |
|
12760 | 3882 |
pattern := (pattern copyFrom:2) withoutSeparators. |
3883 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
|
9296 | 3884 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3885 |
|
12760 | 3886 |
|
3887 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3888 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3889 |
] ifFalse:[ |
12760 | 3890 |
filters isEmpty ifTrue:[ |
3891 |
filterBlock := [:name :baseName | |
|
3892 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
3893 |
]. |
|
3894 |
] ifFalse:[ |
|
3895 |
notFilters isEmpty ifTrue:[ |
|
3896 |
filterBlock := [:name :baseName | |
|
3897 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3898 |
]. |
|
3899 |
] ifFalse:[ |
|
3900 |
filterBlock := [:name :baseName | |
|
3901 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3902 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
3903 |
]. |
|
3904 |
] |
|
3905 |
] |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3906 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3907 |
|
4011 | 3908 |
showHidden := self showHiddenFiles value. |
3909 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3910 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3911 |
]. |
9296 | 3912 |
^ [:name :baseName | |
3913 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
4018 | 3914 |
! |
3915 |
||
3916 |
shownFiles |
|
3917 |
||
3918 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 3919 |
! ! |
3920 |
||
3892 | 3921 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
3922 |
||
3923 |
dirHistory |
|
6369 | 3924 |
"obsolete" |
3925 |
^ self directoryHistory |
|
3926 |
! |
|
3927 |
||
3928 |
directoryHistory |
|
3952 | 3929 |
^ self class directoryHistory |
3892 | 3930 |
! |
3931 |
||
3932 |
enableBack |
|
3933 |
||
3934 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
3935 |
! |
|
3936 |
||
3937 |
enableFileHistory |
|
3938 |
||
3939 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
3940 |
! |
|
3941 |
||
3942 |
enableForward |
|
3943 |
||
3944 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
3945 |
! |
|
3946 |
||
3947 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
3948 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 3949 |
! ! |
3950 |
||
3951 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
3952 |
||
4345 | 3953 |
activityVisibilityChannel |
6284 | 3954 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 3955 |
|
3956 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
3957 |
! |
|
3958 |
||
6602 | 3959 |
changeSetBrowserItemVisible |
3960 |
^ Screen current ctrlDown. |
|
3961 |
! |
|
3962 |
||
11135 | 3963 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
3964 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 3965 |
|
3966 |
"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
|
3967 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 3968 |
! |
3969 |
||
3970 |
mercurialMenusAreShown |
|
11147 | 3971 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 3972 |
|
3973 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
3974 |
! |
|
3975 |
||
4110 | 3976 |
openAlwaysInTextEditor |
4201 | 3977 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 3978 |
|
3979 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
3980 |
! |
|
3981 |
||
3892 | 3982 |
openMultipleApplicationsForType |
3983 |
||
4201 | 3984 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
3985 |
open TextEditor " |
|
3986 |
||
3892 | 3987 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
3988 |
! |
|
3989 |
||
11137 | 3990 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
3991 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
3992 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 3993 |
|
3994 |
"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
|
3995 |
"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
|
3996 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 3997 |
! |
3998 |
||
4201 | 3999 |
showDirectoryTree |
4000 |
||
4001 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 4002 |
! |
4003 |
||
4554 | 4004 |
showDiskUsageHolder |
4005 |
|holder| |
|
4006 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
4007 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 4008 |
holder addDependent:self. |
4554 | 4009 |
^ holder |
4010 |
! |
|
4011 |
||
3892 | 4012 |
showHiddenFiles |
4013 |
||
9582 | 4014 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
4015 |
||
4016 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 4017 |
! |
4018 |
||
9108 | 4019 |
showHiddenFiles:aHolder |
4020 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
4021 |
! |
|
4022 |
||
4023 |
shownFiles:aHolder |
|
4024 |
self aspectFor:#shownFiles put:aHolder. |
|
4025 |
! |
|
4026 |
||
11135 | 4027 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4028 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 4029 |
|
4030 |
"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
|
4031 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4032 |
! |
4033 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4034 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4035 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
4036 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4037 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
4038 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4039 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4040 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4041 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4042 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4043 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4044 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4045 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4046 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4047 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4048 |
|
4648 | 4049 |
userContextAvailable |
4050 |
||
4051 |
" aspect for show group and user columns in contents view |
|
4052 |
windows provides no user context" |
|
4053 |
||
4054 |
^ OperatingSystem isMSWINDOWSlike not |
|
4055 |
! |
|
4056 |
||
3892 | 4057 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4058 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4059 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4060 |
^ self directoryContentsBrowser viewDescription |
3892 | 4061 |
! |
4062 |
||
4063 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4064 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4065 |
" |
3892 | 4066 |
|
6121 | 4067 |
|directoryContentsBrowser| |
4068 |
||
4069 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4070 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4071 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4072 |
! |
4073 |
||
4074 |
viewDirectoryDescription |
|
4075 |
||
4201 | 4076 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4077 |
on change directory " |
|
4078 |
||
3892 | 4079 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4080 |
! |
|
4081 |
||
4201 | 4082 |
viewDirsInContentsBrowser |
4083 |
||
4084 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4085 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4086 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4087 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4088 |
" |
4201 | 4089 |
! |
4090 |
||
5870 | 4091 |
viewFilesInContentsBrowser |
4092 |
||
4093 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4094 |
! |
|
4095 |
||
3892 | 4096 |
viewFilesInDirectoryTree |
4097 |
||
4201 | 4098 |
" aspect for view files in tree view (not only directories) " |
4099 |
||
3892 | 4100 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4101 |
! |
|
4102 |
||
4103 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4104 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4105 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4106 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4107 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4108 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4109 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4110 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4111 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4112 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4113 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4114 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4115 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4116 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4117 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4118 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4119 |
! |
4120 |
||
4121 |
viewNoteBookApplicationHolder |
|
4122 |
||
4123 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4124 |
! |
|
4125 |
||
4126 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4127 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4128 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4129 |
^ self directoryContentsBrowser viewOwner |
3892 | 4130 |
! |
4131 |
||
4132 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4133 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4134 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4135 |
^ self directoryContentsBrowser viewPermissions |
3892 | 4136 |
! |
4137 |
||
4138 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4139 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4140 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4141 |
^ self directoryContentsBrowser viewPreview |
3892 | 4142 |
! |
4143 |
||
4144 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4145 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4146 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4147 |
^ self directoryContentsBrowser viewSize |
3892 | 4148 |
! |
4149 |
||
4974 | 4150 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4151 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4152 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4153 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4154 |
! |
4155 |
||
5312 | 4156 |
viewSizeInKiloBytes |
4157 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4158 |
||
4159 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4160 |
! |
|
4161 |
||
3892 | 4162 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4163 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4164 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4165 |
^ self directoryContentsBrowser viewTime |
3892 | 4166 |
! |
4167 |
||
4168 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4169 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4170 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4171 |
^ self directoryContentsBrowser viewType |
3892 | 4172 |
! ! |
4173 |
||
4174 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4175 |
||
4176 |
executeCommand:cmd |
|
4177 |
||
4178 |
self executeCommand:cmd inDirectory:nil |
|
4179 |
! |
|
4180 |
||
5880 | 4181 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4182 |
| nameString executionBlock| |
4183 |
||
5880 | 4184 |
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
|
4185 |
nameString := 'Execute: ', cmd. |
3892 | 4186 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4187 |
! |
|
4188 |
||
4189 |
getExecutionBlockForCommand:cmd |
|
4190 |
||
4191 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4192 |
! |
|
4193 |
||
5880 | 4194 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4195 |
| dir| |
|
4196 |
||
4197 |
dir := directoryOrNil. |
|
4198 |
directoryOrNil isNil ifTrue:[ |
|
4199 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4200 |
dir isNil ifTrue:[ |
12493 | 4201 |
Dialog warn:(resources string:'Please select a single directory.'). |
6671 | 4202 |
AbortSignal raise. |
4203 |
^ nil |
|
4204 |
]. |
|
3892 | 4205 |
]. |
4523 | 4206 |
|
4207 |
^ [:stream| |
|
4208 |
stream notNil ifTrue:[ |
|
4414 | 4209 |
OperatingSystem |
4210 |
executeCommand:cmd |
|
4211 |
inputFrom:nil |
|
4212 |
outputTo:stream |
|
4213 |
errorTo:stream |
|
4214 |
inDirectory:dir |
|
4215 |
onError:[:status| false]. |
|
4216 |
] |
|
4523 | 4217 |
]. |
3892 | 4218 |
! |
4219 |
||
4220 |
killAllRunningBackgroundProcesses |
|
4221 |
||
4222 |
self backgroundProcesses do:[ : process | |
|
4523 | 4223 |
self notify:'kill ', process name. |
4414 | 4224 |
process terminate. |
3892 | 4225 |
]. |
4226 |
! |
|
4227 |
||
4228 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4229 |
| stream process appl nameString| |
|
4230 |
||
4231 |
appl := self openCommandResultApplication. |
|
4232 |
stream := appl resultStream. |
|
4233 |
nameString := aString ? 'Execution Result'. |
|
4234 |
appl changeTabTo:nameString. |
|
4523 | 4235 |
|
8355 | 4236 |
process := [ |
4237 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
4238 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4239 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4240 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4241 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4242 |
"/ close automatically, if there was no output. |
4571 | 4243 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4244 |
"/ appl doClose. |
|
4245 |
"/ ] |
|
8355 | 4246 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4247 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4248 |
] newProcess. |
3892 | 4249 |
process priority:(Processor userBackgroundPriority). |
4250 |
process name:nameString. |
|
4251 |
self backgroundProcesses add:process. |
|
4252 |
appl process value:process. |
|
4253 |
process resume. |
|
4254 |
! ! |
|
4255 |
||
4256 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4257 |
||
4915 | 4258 |
currentFileNameHolderChanged |
4259 |
"/ self currentFileNameHolderChangedForCommon |
|
4260 |
! |
|
4261 |
||
4577 | 4262 |
currentFileNameHolderChangedForCommon |
5476 | 4263 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4264 |
|
7560 | 4265 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4266 |
self class currentSelection:selection. |
4734 | 4267 |
|
5476 | 4268 |
selectionNotEmpty := selection notEmpty. |
4269 |
self hasSelection value:selectionNotEmpty. |
|
4270 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 4271 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4272 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4273 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4274 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4275 |
self currentDirectories value:newDirectories. |
4276 |
size := newDirectories size. |
|
4774 | 4277 |
rootInTreeView := self |
4278 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4279 |
ifPresentDo:[:appl | appl rootHolder]. |
4280 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4281 |
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
|
4282 |
|
4347 | 4283 |
newDirectories notEmpty ifTrue:[ |
6369 | 4284 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4285 |
]. |
5074 | 4286 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
8168 | 4287 |
self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4288 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4289 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4290 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4291 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4292 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4293 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4294 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4295 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4296 |
self enableForward value:self canForward. |
4734 | 4297 |
self enableBack value:self canBackward. |
6095 | 4298 |
|
4299 |
self updateCanMake. |
|
7560 | 4300 |
|
9677 | 4301 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
4011 | 4302 |
! |
4303 |
||
4304 |
filterModelChanged |
|
4305 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4306 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4307 |
! |
4308 |
||
3892 | 4309 |
update:something with:aParameter from:changedObject |
4310 |
||
4311 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4312 |
and the things that have to be done if it runs standalone " |
|
4313 |
||
4314 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4315 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4316 |
^ self |
3892 | 4317 |
]. |
3989 | 4318 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4319 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4320 |
^ self |
3989 | 4321 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4322 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4323 |
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
|
4324 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4325 |
]. |
4011 | 4326 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4327 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4328 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4329 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4330 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4331 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4332 |
^ self |
4004 | 4333 |
]. |
4781 | 4334 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4335 |
self notify:nil. |
4781 | 4336 |
^ self |
4337 |
]. |
|
3989 | 4338 |
|
3892 | 4339 |
super update:something with:aParameter from:changedObject |
5543 | 4340 |
! |
4341 |
||
6095 | 4342 |
updateCanMake |
4343 |
|dir can| |
|
4344 |
||
4345 |
can := false. |
|
4346 |
dir := self currentDirectory. |
|
4347 |
dir notNil ifTrue:[ |
|
4348 |
can := (dir asFilename construct:'Makefile') exists. |
|
4349 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
4350 |
can ifFalse:[ |
|
4351 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
4352 |
] |
|
4353 |
]. |
|
4354 |
]. |
|
4355 |
self canMake value:can. |
|
4356 |
! |
|
4357 |
||
5543 | 4358 |
updateListAfterDelete:colOfFiles |
4359 |
self updateCurrentDirectory |
|
3892 | 4360 |
! ! |
4361 |
||
4362 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4363 |
||
4364 |
canPaste |
|
4365 |
||
4366 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
4367 |
! |
|
4368 |
||
4369 |
clipboard |
|
4370 |
||
4371 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4372 |
! |
|
4373 |
||
4374 |
copyFilesToClipBoard:colOfFiles |
|
4375 |
self putInClipBoard:colOfFiles as:#copy. |
|
4376 |
! |
|
4377 |
||
4378 |
cutFilesToClipBoard:colOfFiles |
|
4379 |
"defete current selected files/directories |
|
4380 |
" |
|
4381 |
self putInClipBoard:colOfFiles as:#cut. |
|
4382 |
! |
|
4383 |
||
4384 |
emptyClipBoard |
|
4385 |
||
4386 |
self clipboard files:nil. |
|
4387 |
self canPaste value:false. |
|
4388 |
! |
|
4389 |
||
4390 |
putInClipBoard:colOfFiles as:aSymbol |
|
4391 |
| stream clp| |
|
4392 |
||
4393 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4394 |
clp := self clipboard. |
|
4395 |
clp files:nil. |
|
4396 |
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
|
4397 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4398 |
stream := String writeStream. |
3892 | 4399 |
stream nextPutAll:aSymbol asString. |
4400 |
stream nextPutAll:' <'. |
|
4401 |
stream nextPutAll:colOfFiles first asString. |
|
4402 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4403 |
stream nextPutAll:' ...'. |
3892 | 4404 |
]. |
4405 |
stream nextPutAll:'> to clipboard'. |
|
4406 |
||
4523 | 4407 |
self notify:stream contents. |
3892 | 4408 |
stream close. |
4409 |
clp files:colOfFiles. |
|
4410 |
self canPaste value:true. |
|
4411 |
! ! |
|
4412 |
||
4413 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4414 |
||
4415 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4416 |
|filenameDirString filenameDir| |
3892 | 4417 |
|
4418 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4419 |
|
3892 | 4420 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4421 |
filenameDir isNil ifTrue:[^ false ]. |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
4422 |
filenameDir isWritable ifFalse:[^ false]. |
6284 | 4423 |
|
3892 | 4424 |
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
|
4425 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4426 |
dropedObjects do:[:aDropObject | |
6284 | 4427 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4428 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4429 |
"/ |
|
4430 |
"/ dropFileName := aDropObject theObject. |
|
4431 |
"/ dropFileNameString := dropFileName asString. |
|
4432 |
"/ dropFileName isDirectory ifTrue:[ |
|
4433 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4434 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4435 |
"/ ^ false |
|
4436 |
"/ ] |
|
4437 |
"/ ] ifFalse:[ |
|
4438 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4439 |
"/ (filenameDirString = dropFileName directory asString |
|
4440 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4441 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4442 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4443 |
"/ ^ false |
|
4444 |
"/ ] |
|
4445 |
"/ ] |
|
4446 |
]. |
|
4447 |
self notify:nil. |
|
4448 |
^ true |
|
4449 |
! |
|
4450 |
||
4451 |
canDropObject:aDropObject into:aDirectory |
|
4452 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4453 |
||
4454 |
dropFileName := aDropObject theObject. |
|
4455 |
dropFileNameString := dropFileName asString. |
|
4456 |
dropFileName isDirectory ifTrue:[ |
|
4457 |
filenameDirString := aDirectory asString. |
|
4458 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4459 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4460 |
^ false |
|
4414 | 4461 |
] |
6284 | 4462 |
] ifFalse:[ |
4463 |
physicalPathName := dropFileName physicalPathName. |
|
4464 |
(aDirectory = dropFileName directory |
|
4465 |
or:[ aDropObject isFileInArchive not |
|
4466 |
and:[physicalPathName notNil |
|
4467 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4468 |
self notify:'Cannot drop a file into same directory'. |
|
4469 |
^ false |
|
4470 |
] |
|
4471 |
]. |
|
4472 |
^ true. |
|
3892 | 4473 |
! |
4474 |
||
7406 | 4475 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
4476 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
4477 |
||
4478 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4479 |
! |
|
4480 |
||
3892 | 4481 |
doStartDrag:aDropSource in:aView |
7829 | 4482 |
"set the cursors before starting the drag & drop operation" |
4483 |
||
3892 | 4484 |
|hdl| |
4485 |
||
4486 |
hdl := DragAndDropManager new. |
|
4487 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4488 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4489 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 4490 |
hdl alienCursor:nil. |
4491 |
||
4745 | 4492 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
4493 |
||
7829 | 4494 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 4495 |
! |
4496 |
||
7408 | 4497 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 4498 |
|fileEntryFieldHolder destDir dropObject fn d| |
4499 |
||
4500 |
fileEntryFieldHolder := self masterApplication notNil |
|
4501 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
4502 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
4503 |
||
4504 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4505 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4506 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4507 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4508 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4509 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4510 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4511 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4512 |
]. |
7990 | 4513 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4514 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4515 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4516 |
]. |
6479 | 4517 |
|
4518 |
destDir := self currentDirectory. |
|
4519 |
destDir isNil ifTrue:[^ self]. |
|
4520 |
||
8601 | 4521 |
self withWaitCursorDo:[ |
4522 |
aCollectionOfDropObjects do:[:dropObject | |
|
4523 |
|fn| |
|
4524 |
||
4525 |
dropObject isFileObject ifTrue:[ |
|
4526 |
fn := dropObject theObject asFilename. |
|
4527 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
4528 |
fn recursiveCopyTo:destDir |
8601 | 4529 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
4530 |
fn copyTo:(destDir / fn baseName ) |
8601 | 4531 |
] |
6479 | 4532 |
] |
8601 | 4533 |
]. |
4534 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4535 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4536 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4537 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4538 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4539 |
]. |
7408 | 4540 |
|
4541 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 4542 |
! ! |
4543 |
||
4544 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
4545 |
||
4546 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 4547 |
"copy to" |
4548 |
||
7635 | 4549 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
4550 |
||
4551 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
4552 |
! |
|
4553 |
||
4554 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
4555 |
"copy to" |
|
4556 |
||
4557 |
|copyOperation msg| |
|
4558 |
||
4559 |
repairCorruptedFiles ifTrue:[ |
|
4560 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
4561 |
] ifFalse:[ |
|
4562 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
4563 |
]. |
|
4564 |
copyOperation result ifTrue:[ |
|
6190 | 4565 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 4566 |
] ifFalse:[ |
7635 | 4567 |
msg := copyOperation errorString. |
6190 | 4568 |
]. |
4569 |
self notify:msg. |
|
7635 | 4570 |
^ copyOperation result |
4571 |
||
4572 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 4573 |
! |
4574 |
||
4575 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 4576 |
|copy result| |
3892 | 4577 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4578 |
self withActivityIndicationDo:[ |
5961 | 4579 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 4580 |
copy result ifTrue:[ |
4581 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
4582 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4583 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4584 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4585 |
self updateCurrentDirectory. |
3892 | 4586 |
]. |
6374 | 4587 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4588 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4589 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 4590 |
! |
4591 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4592 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4593 |
|size stream msg answer file| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4594 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4595 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4596 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4597 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4598 |
"/ 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
|
4599 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4600 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4601 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4602 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4603 |
"/ 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
|
4604 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4605 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4606 |
"/ 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
|
4607 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4608 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4609 |
"/ 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
|
4610 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4611 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4612 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4613 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4614 |
stringWithCRs:'Copy or move\\%1:\ %2\to:\ %3 ?' |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4615 |
with:(file type == #regular ifTrue:'file' ifFalse:[file isDirectory ifTrue:'directory' ifFalse:'object']) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4616 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4617 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4618 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4619 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4620 |
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
|
4621 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4622 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 4623 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4624 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4625 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4626 |
request:msg |
8127 | 4627 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
4628 |
image:(WarningBox iconBitmap) |
8127 | 4629 |
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
|
4630 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4631 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4632 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4633 |
^ answer. |
3892 | 4634 |
! |
4635 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4636 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 4637 |
"copy or move aColOfSourceFiles to aDirectory. |
4638 |
Asks the used if a move or a copy is wanted. |
|
4639 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
4640 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4641 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4642 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4643 |
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
|
4644 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4645 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4646 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4647 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4648 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4649 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4650 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4651 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4652 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4653 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4654 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4655 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 4656 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4657 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4658 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4659 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4660 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4661 |
|
4745 | 4662 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4663 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4664 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4665 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4666 |
^ true. |
3892 | 4667 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4668 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4669 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4670 |
^ true. |
3892 | 4671 |
]. |
4745 | 4672 |
^ false. |
3892 | 4673 |
! |
4674 |
||
6107 | 4675 |
copySelectionTo |
4676 |
"copy the selected file(s) to another directory" |
|
4677 |
||
7635 | 4678 |
self copySelectionToRepairingCorruptedFiles:false |
4679 |
||
4680 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
4681 |
! |
|
4682 |
||
4683 |
copySelectionToRepairingCorruptedFiles |
|
4684 |
"copy the selected file(s) to another directory" |
|
4685 |
||
4686 |
self copySelectionToRepairingCorruptedFiles:true |
|
4687 |
||
4688 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
4689 |
! |
|
4690 |
||
4691 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
4692 |
"copy the selected file(s) to another directory" |
|
4693 |
||
6299 | 4694 |
|selectedFiles msg destination directory| |
4695 |
||
7560 | 4696 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 4697 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
4698 |
||
4699 |
msg := (selectedFiles size > 1) |
|
4700 |
ifTrue:[ 'Copy Selected Items To Directory:' ] |
|
4701 |
ifFalse:[ 'Copy "%1" To Directory:' ]. |
|
4702 |
||
4703 |
destination := Dialog |
|
7635 | 4704 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first pathName) |
4705 |
default:(LastMoveDestination ? self currentDirectory) |
|
4706 |
ok:(resources string:'Copy') |
|
4707 |
abort:nil. |
|
4708 |
||
6299 | 4709 |
destination isEmptyOrNil ifTrue:[^ self]. |
4710 |
destination := destination asFilename. |
|
4711 |
||
4712 |
destination isDirectory ifFalse:[ |
|
4713 |
selectedFiles size == 1 ifTrue:[ |
|
4714 |
directory := destination directory. |
|
4715 |
directory isDirectory ifTrue:[ |
|
4716 |
LastMoveDestination := directory. |
|
7635 | 4717 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 4718 |
^ self. |
4719 |
] |
|
4720 |
] |
|
4721 |
]. |
|
4722 |
||
4723 |
LastMoveDestination := destination. |
|
7635 | 4724 |
repairingCorruptedFiles ifTrue:[ |
4725 |
selectedFiles do:[:eachFile | |
|
4726 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
4727 |
]. |
|
4728 |
^ self. |
|
4729 |
] ifFalse:[ |
|
4730 |
self copyFiles:selectedFiles to:destination |
|
4731 |
] |
|
4732 |
||
4733 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 4734 |
! |
4735 |
||
3892 | 4736 |
deleteFile:aFile |
6373 | 4737 |
"delete the selected files/directories" |
3892 | 4738 |
|
4739 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
4740 |
! |
|
4741 |
||
4742 |
deleteFiles:colOfFiles |
|
6373 | 4743 |
"delete some files/directories" |
4744 |
||
5081 | 4745 |
^ self deleteFiles:colOfFiles confirm:true. |
4746 |
! |
|
4747 |
||
4748 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 4749 |
"delete some files/directories" |
4750 |
||
5673 | 4751 |
|delete result| |
3892 | 4752 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4753 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4754 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4755 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4756 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4757 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4758 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4759 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4760 |
]. |
5673 | 4761 |
result notNil ifTrue:[ |
4762 |
result ifFalse:[ |
|
4763 |
self notify:delete errorString. |
|
5753 | 4764 |
] ifTrue:[ |
4765 |
self updateListAfterDelete:colOfFiles. |
|
4766 |
] |
|
4394 | 4767 |
]. |
5673 | 4768 |
]. |
4769 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4770 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4771 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 4772 |
! |
4773 |
||
6169 | 4774 |
eraseFiles:colOfFiles |
6373 | 4775 |
"erase (clear and delete) some files/directories" |
4776 |
||
6169 | 4777 |
^ self eraseFiles:colOfFiles confirm:true. |
4778 |
! |
|
4779 |
||
4780 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4781 |
"erase (clear and delete) some files/directories" |
4782 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4783 |
|deleteOperation result fileSize| |
6169 | 4784 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4785 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4786 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4787 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4788 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4789 |
ifTrue:[ |
4790 |
result := deleteOperation result. |
|
4791 |
] ifFalse:[ |
|
4792 |
ProgressIndicator |
|
4793 |
displayProgressNotifications:'Erasing' |
|
4794 |
abortable:true |
|
4795 |
at:nil |
|
4796 |
during:[ |
|
4797 |
result := deleteOperation result. |
|
4798 |
]. |
|
4799 |
]. |
|
4800 |
||
6169 | 4801 |
result notNil ifTrue:[ |
4802 |
result ifFalse:[ |
|
8294 | 4803 |
self notify:deleteOperation errorString. |
6169 | 4804 |
] ifTrue:[ |
4805 |
self updateListAfterDelete:colOfFiles. |
|
4806 |
] |
|
4807 |
]. |
|
4808 |
]. |
|
4809 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4810 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4811 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4812 |
! |
4813 |
||
3892 | 4814 |
moveFile:aSourceFile to:aDestFile |
6373 | 4815 |
"move a file/directory" |
3892 | 4816 |
|
4817 |
|move| |
|
4818 |
||
5961 | 4819 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4820 |
move result ifTrue:[ |
4523 | 4821 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4822 |
] ifFalse:[ |
4523 | 4823 |
self notify:move errorString. |
3892 | 4824 |
]. |
4825 |
self updateCurrentDirectory. |
|
4826 |
^ move result |
|
4827 |
! |
|
4828 |
||
4829 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4830 |
"move some files to aDirectory" |
4831 |
||
3892 | 4832 |
|move| |
4833 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4834 |
self withActivityIndicationDo:[ |
5961 | 4835 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4836 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4837 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4838 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4839 |
self updateCurrentDirectory. |
3892 | 4840 |
]. |
6373 | 4841 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4842 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4843 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4844 |
! |
4845 |
||
6107 | 4846 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4847 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4848 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4849 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4850 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4851 |
destinationDirectory := Dialog |
6352 | 4852 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items To:') |
5789 | 4853 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4854 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4855 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4856 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4857 |
|
5789 | 4858 |
LastMoveDestination := destinationDirectory. |
7560 | 4859 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename |
4860 |
||
4861 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4862 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4863 |
|
3892 | 4864 |
newDirectory |
4865 |
"ask for and create a new directory" |
|
4866 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4867 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4868 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4869 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4870 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4871 |
self warn:'Select a single directory to create a directory'. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4872 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4873 |
]. |
4521 | 4874 |
|
4875 |
"/ 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
|
4876 |
selectedFiles := self currentSelectedFiles. |
4521 | 4877 |
selectedFiles size == 1 ifTrue:[ |
4878 |
singleSelectedFile := selectedFiles first. |
|
4879 |
||
4880 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
4881 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
4882 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
4883 |
||
4884 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
4885 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 4886 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
4887 |
]. |
|
4888 |
]. |
|
4889 |
]. |
|
4890 |
||
5961 | 4891 |
|
4521 | 4892 |
defaultAnswer notNil ifTrue:[ |
5961 | 4893 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 4894 |
] ifFalse:[ |
5961 | 4895 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 4896 |
]. |
4897 |
createOp result ifFalse:[ ^ self]. |
|
4898 |
newFile := createOp createdFile. |
|
3892 | 4899 |
newFile notNil ifTrue:[ |
4414 | 4900 |
self updateCurrentDirectory. |
3892 | 4901 |
] |
4902 |
! |
|
4903 |
||
4904 |
newFile |
|
4905 |
"ask for and create a new file" |
|
4906 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4907 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4908 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4909 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4910 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4911 |
self warn:'Select a single directory to create a file.'. |
4979
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4912 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4913 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4914 |
|
3982 | 4915 |
curFile := self firstSelectedFile. |
3892 | 4916 |
curFile notNil ifTrue:[ |
4414 | 4917 |
file := curFile. |
3892 | 4918 |
] ifFalse:[ |
4414 | 4919 |
file := directory. |
3892 | 4920 |
]. |
5961 | 4921 |
create := FileOperation createFileIn:file. |
3892 | 4922 |
create result ifFalse:[ ^ self]. |
4923 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
4924 |
! |
|
4925 |
||
4926 |
newHardLink |
|
4927 |
"ask for and create a hard link (unix only)" |
|
4928 |
||
6151 | 4929 |
self newLink:#hard. |
4930 |
! |
|
4931 |
||
4932 |
newLink:typeOfLink |
|
3892 | 4933 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
4934 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4935 |
| sel dir create createdFile| |
3892 | 4936 |
|
7560 | 4937 |
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
|
4938 |
(sel size ~= 1) ifTrue:[ |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4939 |
self warn:'Select one directory to link'. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4940 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4941 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4942 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4943 |
|
6151 | 4944 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 4945 |
create result ifFalse:[ ^ self]. |
4946 |
createdFile := create createdFile. |
|
4947 |
createdFile notNil ifTrue:[ |
|
6151 | 4948 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4949 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4950 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4951 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4952 |
] |
3892 | 4953 |
]. |
7560 | 4954 |
|
4955 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 4956 |
! |
4957 |
||
4958 |
newSoftLink |
|
4959 |
"ask for and create a soft link (unix only)" |
|
4960 |
||
6151 | 4961 |
self newLink:#soft. |
3892 | 4962 |
! |
4963 |
||
4964 |
pasteFiles |
|
6373 | 4965 |
"paste from clipBoard" |
4966 |
||
4967 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 4968 |
|
4969 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
4970 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 4971 |
|
4972 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
4973 |
||
3892 | 4974 |
buffer := self clipboard copy. |
3982 | 4975 |
directories := self currentSelectedDirectories. |
5880 | 4976 |
directories size ~~ 1 ifTrue:[ |
4414 | 4977 |
|box dirStringCol| |
5880 | 4978 |
|
4414 | 4979 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
4980 |
box := ListSelectionBox new. |
|
6373 | 4981 |
box title:'Paste into which directory ?'. |
4414 | 4982 |
box list:dirStringCol. |
4983 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4984 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4985 |
box destroy. |
3892 | 4986 |
] ifFalse:[ |
5880 | 4987 |
destination := directories anElement. |
3892 | 4988 |
]. |
6373 | 4989 |
|
4990 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 4991 |
buffer files copy do:[:aFile| |
4992 |
aFile directory = destination ifTrue:[ |
|
4993 |
buffer files remove:aFile. |
|
4994 |
]. |
|
4995 |
]. |
|
4996 |
]. |
|
4997 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 4998 |
copiedFiles notEmptyOrNil ifTrue:[ |
4999 |
thisIsAFileMoveOperation ifTrue:[ |
|
5000 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
5001 |
]. |
|
5002 |
||
5003 |
"/ select those pasted files. |
|
5004 |
self updateCurrentDirectory:true. |
|
5005 |
self currentFileNameHolder value:copiedFiles values. |
|
5006 |
] |
|
3892 | 5007 |
! |
5008 |
||
5009 |
renameFile:aFile |
|
5010 |
"rename the selected file(s)" |
|
5011 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5012 |
^ self renameFiles:(Array with:aFile). |
3892 | 5013 |
! |
5014 |
||
4230 | 5015 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 5016 |
"rename filename to newFileString" |
5017 |
||
5018 |
|rename| |
|
5019 |
||
5961 | 5020 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 5021 |
rename result ifTrue:[ |
4230 | 5022 |
aBoolean ifTrue:[ |
5023 |
self updateAndSelect:(rename renamedFiles). |
|
5024 |
]. |
|
3892 | 5025 |
] ifFalse:[ |
4523 | 5026 |
self notify:rename errorString. |
3892 | 5027 |
]. |
5028 |
^ rename result |
|
5029 |
! |
|
5030 |
||
5031 |
renameFiles:aColOfFiles |
|
6373 | 5032 |
"rename some file(s)" |
3892 | 5033 |
|
5034 |
|rename| |
|
5035 |
||
5961 | 5036 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 5037 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5038 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5039 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5040 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5041 |
^ rename |
3892 | 5042 |
! |
5043 |
||
5044 |
renameSelection |
|
5045 |
"rename the selected file(s)" |
|
5046 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5047 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5048 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5049 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5050 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5051 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5052 |
]. |
7560 | 5053 |
|
5054 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5055 |
! ! |
5056 |
||
4080 | 5057 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5058 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5059 |
bookmarksMenu |
3952 | 5060 |
<resource: #programMenu> |
5061 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5062 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5063 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5064 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
7763 | 5065 |
|
5066 |
"/ add the bookmark items ... |
|
5067 |
bookmarks := self class directoryBookmarks. |
|
5068 |
bookmarks notEmptyOrNil ifTrue:[ |
|
5069 |
menu addItem:(MenuItem labeled:'-'). |
|
5070 |
bookmarks do:[:dirName | |
|
5071 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
5072 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5073 |
self setCurrentFileName:dirName. |
|
5074 |
]. |
|
5075 |
])). |
|
5076 |
]. |
|
5077 |
]. |
|
4080 | 5078 |
menu findGuiResourcesIn:self. |
7763 | 5079 |
^ menu |
5080 |
||
11135 | 5081 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5082 |
! |
5083 |
||
5084 |
canBackward |
|
5085 |
^ self directoryHistory canBackward. |
|
5086 |
||
5087 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5088 |
! |
|
5089 |
||
5090 |
canForward |
|
5091 |
^ self directoryHistory canForward. |
|
5092 |
||
5093 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5094 |
! |
|
5095 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5096 |
gotoBookmarksMenu |
7763 | 5097 |
<resource: #programMenu> |
5098 |
||
5099 |
|menu bookmarks| |
|
5100 |
||
5101 |
menu := self class baseBookmarksMenuSpec2 decodeAsLiteralArray. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5102 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5103 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5104 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5105 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 5106 |
menu addItem:(MenuItem labeled:'-'). |
5107 |
bookmarks do:[:dirName | |
|
5108 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
6725 | 5109 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
5959 | 5110 |
self setCurrentFileName:dirName. |
4414 | 5111 |
]. |
5112 |
])). |
|
5113 |
]. |
|
3952 | 5114 |
]. |
7763 | 5115 |
menu findGuiResourcesIn:self. |
3952 | 5116 |
^ menu |
5117 |
||
11135 | 5118 |
"Modified: / 14-01-2012 / 21:13:58 / cg" |
6099 | 5119 |
! |
5120 |
||
3892 | 5121 |
menuDirHistory:backOrForward |
7763 | 5122 |
"initialize the history menu" |
5123 |
||
3892 | 5124 |
<resource: #programMenu > |
5125 |
||
7763 | 5126 |
|hist menu pathList currentSel currentPath| |
5127 |
||
5128 |
hist := self directoryHistory. |
|
5129 |
hist isEmpty ifTrue:[^ nil]. |
|
5130 |
||
3892 | 5131 |
backOrForward == #back ifTrue:[ |
6725 | 5132 |
currentSel := self currentSelectedDirectories. |
4347 | 5133 |
currentSel size == 1 ifTrue:[ |
5134 |
currentPath := currentSel first asString. |
|
5135 |
] ifFalse:[ |
|
5136 |
currentPath := nil. |
|
5137 |
]. |
|
7763 | 5138 |
pathList := hist getBackCollection. |
3892 | 5139 |
] ifFalse:[ |
7763 | 5140 |
pathList := hist getForwardCollection. |
3892 | 5141 |
]. |
4022 | 5142 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5143 |
|
6370 | 5144 |
pathList size > 30 ifTrue:[ |
5145 |
pathList := pathList copyTo:30 |
|
5146 |
]. |
|
7763 | 5147 |
|
5148 |
menu := Menu new. |
|
5149 |
||
3964 | 5150 |
pathList do:[:aPath| |
4347 | 5151 |
| menuItem | |
5152 |
menuItem := MenuItem new. |
|
5153 |
menuItem label:aPath. |
|
11783 | 5154 |
menuItem itemValue:[ self setCurrentFileName:(aPath asFilename) ]. |
4347 | 5155 |
menu addItem:menuItem. |
3952 | 5156 |
]. |
7763 | 5157 |
menu findGuiResourcesIn:self. |
3892 | 5158 |
^ menu |
7763 | 5159 |
|
11783 | 5160 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5161 |
! |
5162 |
||
5163 |
menuDirHistoryBack |
|
5164 |
"initialize the directory menu |
|
5165 |
" |
|
5166 |
<resource: #programMenu > |
|
5167 |
||
5168 |
^ self menuDirHistory:#back. |
|
5169 |
! |
|
5170 |
||
5171 |
menuDirHistoryForward |
|
5172 |
"initialize the directory menu |
|
5173 |
" |
|
5174 |
<resource: #programMenu > |
|
5175 |
||
5176 |
^ self menuDirHistory:#forward. |
|
3906 | 5177 |
! |
5178 |
||
5179 |
menuFileHistory |
|
5180 |
"initialize the file history menu |
|
5181 |
" |
|
5182 |
<resource: #programMenu > |
|
5183 |
||
7763 | 5184 |
|menu hist text removeItem| |
3906 | 5185 |
|
5186 |
hist := self fileHistory. |
|
5187 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5188 |
|
7763 | 5189 |
menu := Menu new. |
5190 |
||
5191 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5192 |
aFileItem fileName exists ifTrue:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5193 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
5959 | 5194 |
self setCurrentFileName:(aFileItem fileName). |
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5195 |
self openApplByFileItem:aFileItem |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5196 |
]). |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5197 |
] ifFalse:[ |
7763 | 5198 |
"/ remove all not existing history entries |
5199 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5200 |
] |
3906 | 5201 |
]. |
7763 | 5202 |
menu addSeparator. |
5203 |
||
4080 | 5204 |
removeItem := MenuItem new. |
5205 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5206 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5207 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5208 |
removeItem label:text. |
11783 | 5209 |
removeItem |
5210 |
itemValue:[ |
|
5211 |
self fileHistory removeAll. |
|
5212 |
self enableFileHistory value:false. |
|
5213 |
]. |
|
3906 | 5214 |
menu addItem:removeItem. |
7763 | 5215 |
menu findGuiResourcesIn:self. |
3906 | 5216 |
^ menu |
7763 | 5217 |
|
11783 | 5218 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5219 |
! |
5220 |
||
4080 | 5221 |
sortMenu |
5222 |
<resource: #programMenu > |
|
5223 |
||
5224 |
|menu| |
|
5225 |
||
7763 | 5226 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5227 |
menu findGuiResourcesIn:self. |
5228 |
^ menu |
|
7763 | 5229 |
|
5230 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5231 |
! |
5232 |
||
5233 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5234 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5235 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5236 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5237 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5238 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5239 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5240 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5241 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5242 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5243 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5244 |
^ spec |
4080 | 5245 |
! |
5246 |
||
5247 |
viewInContentsBrowserMenu |
|
5009 | 5248 |
self |
5249 |
applicationNamed:#DirectoryContentsBrowser |
|
5250 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5251 |
||
5252 |
^ nil. |
|
4080 | 5253 |
! |
5254 |
||
3952 | 5255 |
visitedDirectoriesMenu |
5256 |
<resource: #programMenu > |
|
5257 |
||
5258 |
|menu histCopy text removeItem| |
|
5259 |
||
7763 | 5260 |
histCopy := self directoryHistory. |
5261 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5262 |
||
3952 | 5263 |
menu := Menu new. |
7763 | 5264 |
|
5265 |
histCopy do:[:aFile| |
|
5266 |
menu addItem:(MenuItem label:aFile asString value:[ |
|
5267 |
self setCurrentFileName:(aFile path asFilename). |
|
5268 |
]). |
|
5269 |
]. |
|
5270 |
menu addSeparator. |
|
5271 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5272 |
"/ 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
|
5273 |
text := (resources string:'Clear History'). |
3952 | 5274 |
removeItem := MenuItem new. |
4040 | 5275 |
removeItem translateLabel:true. |
3952 | 5276 |
removeItem label:text. |
11783 | 5277 |
removeItem |
5278 |
itemValue:[ |
|
5279 |
self directoryHistory removeAll. |
|
5280 |
self enableForward value:self canForward. |
|
5281 |
self enableBack value:self canBackward. |
|
5282 |
]. |
|
7763 | 5283 |
|
3952 | 5284 |
menu addItem:removeItem. |
7763 | 5285 |
menu findGuiResourcesIn:self. |
3952 | 5286 |
^ menu |
7763 | 5287 |
|
11783 | 5288 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5289 |
! ! |
5290 |
||
5880 | 5291 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5292 |
||
5293 |
doCompareTwoFiles |
|
5294 |
self openDiffView. |
|
5295 |
! |
|
5296 |
||
5297 |
doGoDirectoryUp |
|
5960 | 5298 |
| upDir directory rootInTreeView| |
5880 | 5299 |
|
5300 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5301 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5302 |
directory := self currentDirectory. |
5303 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5304 |
] ifFalse:[ |
5305 |
rootInTreeView := self |
|
5306 |
applicationNamed:#DirectoryTreeBrowser |
|
5307 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5308 |
directory := rootInTreeView value asFilename. |
5309 |
]. |
|
5310 |
upDir := directory directory. |
|
5959 | 5311 |
self setCurrentFileName:upDir. |
5880 | 5312 |
! |
5313 |
||
5314 |
doGotoDefaultDirectory |
|
5315 |
self gotoFile:(Filename defaultDirectory). |
|
5316 |
! |
|
5317 |
||
8091 | 5318 |
doGotoDesktopDirectory |
5319 |
self gotoFile:(Filename desktopDirectory). |
|
5320 |
! |
|
5321 |
||
5880 | 5322 |
doGotoHomeDirectory |
8091 | 5323 |
self gotoFile:(Filename homeDirectory). |
5880 | 5324 |
! |
5325 |
||
6434 | 5326 |
doGotoSmalltalkDirectory |
5327 |
self gotoFile:(self smalltalkDirectory). |
|
5328 |
! |
|
5329 |
||
9677 | 5330 |
doGotoTempDirectory |
5331 |
self gotoFile:(self tempDirectory). |
|
5332 |
||
5333 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5334 |
! |
|
5335 |
||
9596 | 5336 |
doMakeCurrentDirectory |
5337 |
OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5338 |
self currentFileNameHolderChangedForCommon. |
|
5339 |
||
5340 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
5341 |
! |
|
5342 |
||
5880 | 5343 |
fileGetInfo:longInfo |
5344 |
"get info on selected file - show it in a box" |
|
5345 |
||
5346 |
|string box updater| |
|
5347 |
||
5348 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5349 |
string notNil ifTrue:[ |
|
5350 |
box := InfoBox title:string. |
|
5351 |
updater := [ |
|
5352 |
[true] whileTrue:[ |
|
5353 |
Delay waitForSeconds:2. |
|
5354 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5355 |
string isNil ifTrue:[ ^ self]. |
|
5356 |
box title:string |
|
5357 |
] |
|
5358 |
] fork. |
|
5359 |
box show. |
|
5360 |
updater terminate. |
|
5361 |
box destroy |
|
5362 |
] |
|
6434 | 5363 |
! |
5364 |
||
5365 |
smalltalkDirectory |
|
8590 | 5366 |
|stxPath| |
6434 | 5367 |
|
5368 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5369 |
stxPath isNil ifTrue:[ |
5370 |
^ Filename currentDirectory |
|
5371 |
]. |
|
5372 |
^ stxPath asFilename directory. |
|
9677 | 5373 |
! |
5374 |
||
5375 |
tempDirectory |
|
5376 |
^ Filename tempDirectory. |
|
5377 |
||
5378 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5379 |
! ! |
5380 |
||
11139 | 5381 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5382 |
||
5383 |
copyFiles |
|
5384 |
self |
|
5385 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5386 |
! |
|
5387 |
||
5388 |
cutFiles |
|
5389 |
self |
|
5390 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5391 |
! |
|
5392 |
||
5393 |
deleteFiles |
|
5394 |
self |
|
5395 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5396 |
! |
|
5397 |
||
5398 |
eraseFiles |
|
5399 |
self |
|
5400 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
5401 |
! |
|
5402 |
||
5403 |
openSettingsDialog |
|
5404 |
|dialog| |
|
5405 |
||
5406 |
dialog := FileBrowserV2SettingsDialog new. |
|
5407 |
dialog settingsDialog:self. |
|
5408 |
dialog allButOpen. |
|
5409 |
dialog doReload. |
|
5410 |
dialog openWindow |
|
5411 |
! |
|
5412 |
||
5413 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
5414 |
|files dirs| |
|
5415 |
||
5416 |
files := self currentSelectedFiles. |
|
5417 |
files notEmpty ifTrue:[ |
|
5418 |
aBlock value:files. |
|
5419 |
] ifFalse:[ |
|
5420 |
dirs := self currentSelectedDirectories. |
|
5421 |
dirs notEmpty ifTrue:[ |
|
5422 |
aBlock value:dirs. |
|
5423 |
]. |
|
5424 |
]. |
|
5425 |
! ! |
|
5426 |
||
5427 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
5428 |
||
5429 |
openAboutThisApplication |
|
5430 |
"opens an about box for this application." |
|
5431 |
||
5432 |
Dialog aboutClass:self class. |
|
5433 |
! |
|
5434 |
||
5435 |
openHTMLDocument:relativeDocPath |
|
5436 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
5437 |
! ! |
|
5438 |
||
5439 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 5440 |
|
12777 | 5441 |
commitFilesToCVS:files |
5442 |
|numFiles| |
|
5443 |
||
5444 |
(numFiles := files size) > 0 ifTrue:[ |
|
5445 |
self withActivityIndicationDo:[ |
|
5446 |
self cvsCommitFiles:files |
|
5447 |
] |
|
5448 |
] |
|
5449 |
! |
|
5450 |
||
3892 | 5451 |
cvsAddAndCommit |
4849 | 5452 |
self cvsAddAndCommitAsBinary:false |
5453 |
! |
|
5454 |
||
5455 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 5456 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 5457 |
|
5458 |
log := Dialog |
|
11139 | 5459 |
requestText:(resources string:'Enter initial log message:') |
4414 | 5460 |
lines:10 |
5461 |
columns:70 |
|
5462 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
5463 |
log isNil ifTrue:[^ self]. |
3892 | 5464 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5465 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5466 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5467 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5468 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5469 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5470 |
|
8588 | 5471 |
binArg := ''. |
5472 |
asBinary ifTrue:[ |
|
5473 |
binArg := '-kb '. |
|
5474 |
]. |
|
3982 | 5475 |
sel := self currentSelectedFiles. |
11139 | 5476 |
executionBlock := |
5477 |
[:stream | |
|
5478 |
log notNil ifTrue:[ |
|
5479 |
sel size > 0 ifTrue:[ |
|
5480 |
sel do:[:fn | |
|
5481 |
|nameArg| |
|
5482 |
||
5483 |
nameArg := '"',fn baseName,'"'. |
|
5484 |
||
5485 |
dir := self getDirWithoutFileName:fn. |
|
5486 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
5487 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5488 |
||
5489 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5490 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 5491 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
5492 |
"/ support and need the 'admin -kb' command. |
|
5493 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
5494 |
asBinary ifTrue:[ |
|
5495 |
cmd := ('cvs admin -kb ' , nameArg). |
|
5496 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5497 |
||
5498 |
cmd := ('cvs upd ' , nameArg). |
|
5499 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5500 |
]. |
|
5501 |
] |
|
5502 |
] |
|
5503 |
] |
|
5504 |
]. |
|
4107 | 5505 |
nameString := 'Command> cvs add and commit'. |
3892 | 5506 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 5507 |
|
5508 |
"Modified (format): / 15-01-2012 / 16:02:07 / cg" |
|
3892 | 5509 |
! |
5510 |
||
4849 | 5511 |
cvsAddBinaryAndCommit |
5512 |
self cvsAddAndCommitAsBinary:true |
|
5513 |
! |
|
5514 |
||
3892 | 5515 |
cvsCommit |
12777 | 5516 |
|selectedFiles| |
3892 | 5517 |
|
3982 | 5518 |
selectedFiles:= self currentSelectedFiles. |
12777 | 5519 |
self cvsCommitFiles:selectedFiles |
5520 |
! |
|
5521 |
||
5522 |
cvsCommitFiles:files |
|
5523 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
5524 |
||
5525 |
nFiles := files size. |
|
5526 |
nFiles == 0 ifTrue:[^ self]. |
|
5527 |
||
5528 |
nFiles == 1 ifTrue:[ |
|
5529 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 5530 |
] ifFalse:[ |
12777 | 5531 |
nFiles > 1 ifTrue:[ |
5532 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 5533 |
] ifFalse:[ |
6627 | 5534 |
msg := resources string:'Enter log message for checkIn' |
4414 | 5535 |
] |
3892 | 5536 |
]. |
5537 |
||
5538 |
log := Dialog |
|
4414 | 5539 |
requestText:msg |
5540 |
lines:10 |
|
5541 |
columns:70 |
|
5542 |
initialAnswer:nil. |
|
3892 | 5543 |
|
4663 | 5544 |
log isNil ifTrue:[^ self]. |
12777 | 5545 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5546 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5547 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 5548 |
"/ save the log message into another tempFile ... |
5549 |
logTmp := Filename newTemporary. |
|
5550 |
s := logTmp writeStream. |
|
5551 |
s nextPutAll:log. |
|
5552 |
s close. |
|
5553 |
||
5554 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5555 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5556 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5557 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5558 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5559 |
executionBlock := [:stream | |
12777 | 5560 |
[ |
5561 |
files do:[:fn | |
|
5562 |
| dir nameArg cmd | |
|
5563 |
||
5564 |
nameArg := '"',fn baseName,'"'. |
|
5565 |
dir := fn directory. |
|
5566 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
5567 |
stream showCR:fn pathName. |
|
5568 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 5569 |
] |
12777 | 5570 |
] ensure:[ |
5571 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
5572 |
]. |
|
4107 | 5573 |
]. |
5574 |
nameString := 'Command> cvs commit'. |
|
5575 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 5576 |
! |
5577 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5578 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5579 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5580 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5581 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5582 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5583 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5584 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5585 |
out := WriteStream on:(String new:100). |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5586 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5587 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5588 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5589 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5590 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5591 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5592 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5593 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5594 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5595 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5596 |
|
3892 | 5597 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
5598 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
5599 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5600 |
|toRemove updateRunning executionBlock nameString| |
3892 | 5601 |
|
5602 |
updateRunning := self backgroundProcesses value notEmpty. |
|
5603 |
self killAllRunningBackgroundProcesses. |
|
5604 |
toRemove := OrderedCollection new. |
|
5605 |
||
12493 | 5606 |
executionBlock := |
5607 |
[:stream | |
|
5608 |
|cmd logArg prevDir prevFiles| |
|
5609 |
||
5610 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5611 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
5612 |
] ifFalse:[ |
|
5613 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
5614 |
]. |
|
5615 |
prevFiles := ''. |
|
5616 |
||
5617 |
filesToRemove do:[:fileName | |
|
5618 |
|dir file| |
|
5619 |
||
5620 |
dir := fileName directory. |
|
5621 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
5622 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
5623 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5624 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5625 |
prevFiles := ''. |
|
4414 | 5626 |
]. |
12493 | 5627 |
|
5628 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5629 |
"was not able to remove it" |
|
5630 |
| lastError msg | |
|
5631 |
lastError := OperatingSystem lastErrorString. |
|
5632 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5633 |
lastError isNil ifFalse:[ |
|
5634 |
msg := msg , '\\(' , lastError , ')' |
|
5635 |
]. |
|
5636 |
Dialog warn:msg withCRs |
|
5637 |
] do:[ |
|
5638 |
(fileName isSymbolicLink) ifFalse:[ |
|
5639 |
fileName remove. |
|
5640 |
file := fileName baseName. |
|
5641 |
cmd := ('cvs remove -f "',file,'"'). |
|
5642 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5643 |
"/ Transcript show:dir; space; showCR:cmd. |
|
5644 |
] |
|
5645 |
]. |
|
5646 |
prevDir := dir. |
|
5647 |
prevFiles := prevFiles,' ',file. |
|
4414 | 5648 |
]. |
12493 | 5649 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
5650 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5651 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5652 |
]. |
|
4107 | 5653 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 5654 |
filesToRemove size > 1 ifTrue:[ |
4414 | 5655 |
nameString := nameString, ' ...'. |
3892 | 5656 |
]. |
5657 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5658 |
! |
|
5659 |
||
5660 |
cvsRemoveFileAndCVSContainer |
|
12493 | 5661 |
|files| |
5662 |
||
5663 |
files := self currentSelectedFiles copy. |
|
5664 |
self removeFilesAndCVSContainers:files |
|
3892 | 5665 |
! |
5666 |
||
9338 | 5667 |
cvsRevisionLog |
5668 |
| cmd sel executionBlock nameString| |
|
5669 |
||
5670 |
sel := self currentSelectedObjects. |
|
5671 |
sel isEmpty ifTrue:[ ^ self ]. |
|
5672 |
||
5673 |
executionBlock := [:stream | |
|
5674 |
sel do:[:fn | |
|
5675 |
| dir nameArg | |
|
5676 |
||
5677 |
nameArg := '"',fn baseName,'"'. |
|
5678 |
dir := fn directory. |
|
5679 |
cmd := 'cvs log ' , nameArg. |
|
5680 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5681 |
] |
|
5682 |
]. |
|
5683 |
nameString := 'Command> cvs log'. |
|
5684 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5685 |
! |
|
5686 |
||
8562 | 5687 |
cvsTagSelection |
5688 |
|tag stream cmd| |
|
5689 |
||
5690 |
tag := Dialog request:(resources string:'Tag:'). |
|
5691 |
||
5692 |
CVSSourceCodeManager notNil ifTrue:[ |
|
5693 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
5694 |
] ifFalse:[ |
|
5695 |
cmd := 'cvs'. |
|
5696 |
]. |
|
5697 |
||
5698 |
stream := WriteStream on:''. |
|
5699 |
stream |
|
5700 |
nextPutAll:cmd; |
|
5701 |
nextPutAll:' tag -F '; |
|
5702 |
nextPutAll:'"'; |
|
5703 |
nextPutAll:tag; |
|
8563 | 5704 |
nextPutAll:'" '; |
5705 |
nextPutAll:(self makeFileNameArgumentString). |
|
5706 |
||
8562 | 5707 |
self executeCommand:stream contents. |
5708 |
! |
|
5709 |
||
3892 | 5710 |
cvsUpdateAll |
5711 |
| cmd | |
|
5712 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5713 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5714 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5715 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5716 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5717 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5718 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5719 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 5720 |
! |
5721 |
||
5722 |
cvsUpdateAllRecursive |
|
5723 |
| cmd | |
|
5724 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5725 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5726 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5727 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5728 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5729 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5730 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 5731 |
! |
5732 |
||
5733 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5734 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5735 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5736 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5737 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5738 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5739 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5740 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5741 |
|
3892 | 5742 |
stream := WriteStream on:''. |
8563 | 5743 |
stream |
5744 |
nextPutAll:cmd; |
|
5745 |
nextPutAll:' upd '; |
|
5746 |
nextPutAll:(self makeFileNameArgumentString). |
|
5747 |
||
5748 |
self executeCommand:stream contents. |
|
5749 |
! |
|
5750 |
||
5751 |
makeFileNameArgumentString |
|
5752 |
|stream| |
|
5753 |
||
5754 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5755 |
self currentSelectedFiles do:[: file | |
8563 | 5756 |
stream nextPut:$". |
4414 | 5757 |
stream nextPutAll:file baseName. |
8563 | 5758 |
stream nextPutAll:'" '. |
5759 |
]. |
|
5760 |
^ stream contents. |
|
12493 | 5761 |
! |
5762 |
||
5763 |
removeFilesAndCVSContainers:files |
|
5764 |
|numFiles question aswer| |
|
5765 |
||
5766 |
(numFiles := files size) > 0 ifTrue:[ |
|
5767 |
numFiles > 1 ifTrue:[ |
|
5768 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
5769 |
] ifFalse:[ |
|
5770 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
5771 |
]. |
|
5772 |
||
5773 |
aswer := Dialog |
|
5774 |
confirm:question withCRs |
|
5775 |
yesLabel:(resources string:'Remove') |
|
5776 |
noLabel:(resources string:'Cancel'). |
|
5777 |
||
5778 |
aswer ifTrue:[ |
|
5779 |
self withActivityIndicationDo:[ |
|
5780 |
self cvsRemoveAndRemoveFromCVS:files |
|
5781 |
] |
|
5782 |
] |
|
5783 |
] |
|
3892 | 5784 |
! ! |
5785 |
||
11139 | 5786 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
5787 |
||
5788 |
mercurialAdd |
|
5789 |
|executionBlock sel maxCmdSize| |
|
5790 |
||
5791 |
maxCmdSize := 512. |
|
5792 |
||
5793 |
sel := self currentSelectedObjects. |
|
5794 |
sel isEmptyOrNil ifTrue:[ |
|
5795 |
^ self |
|
5796 |
]. |
|
5797 |
||
5798 |
executionBlock := |
|
5799 |
[:stream | |
|
5800 |
|prevDir cmd| |
|
5801 |
||
5802 |
prevDir := nil. |
|
5803 |
sel do:[:fn | |
|
5804 |
|nameArg dir| |
|
5805 |
||
5806 |
nameArg := '"',fn baseName,'"'. |
|
5807 |
dir := fn directory. |
|
5808 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
5809 |
"/ flush |
|
5810 |
cmd notNil ifTrue:[ |
|
5811 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5812 |
cmd := nil. |
|
5813 |
] |
|
5814 |
]. |
|
5815 |
cmd isNil ifTrue:[ |
|
5816 |
cmd := 'hg add'. |
|
5817 |
]. |
|
5818 |
cmd := cmd,' ',nameArg. |
|
5819 |
prevDir := dir. |
|
5820 |
]. |
|
5821 |
cmd notNil ifTrue:[ |
|
5822 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5823 |
cmd := nil. |
|
5824 |
]. |
|
5825 |
stream nextPutLine:'Commit to finish the transaction'. |
|
5826 |
]. |
|
5827 |
||
5828 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
5829 |
||
5830 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
5831 |
! |
|
5832 |
||
5833 |
mercurialCommit |
|
5834 |
|dir executionBlock| |
|
5835 |
||
5836 |
"/ dir := self currentDirectory. |
|
5837 |
dir := self directoryContentsBrowser directory. |
|
5838 |
executionBlock := |
|
5839 |
[:stream | |
|
5840 |
(self getExecutionBlockForCommand:'hg commit' |
|
5841 |
inDirectory:dir) value:stream. |
|
5842 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 5843 |
]. |
11139 | 5844 |
|
5845 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
5846 |
||
5847 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
5848 |
! |
|
5849 |
||
11144 | 5850 |
mercurialInit |
5851 |
|dir executionBlock| |
|
5852 |
||
5853 |
dir := self directoryContentsBrowser directory. |
|
5854 |
||
5855 |
(Dialog confirm:(resources |
|
5856 |
string:'Initialize new Mercurial Repository in %1?' |
|
5857 |
with:dir baseName)) ifFalse:[^ self]. |
|
5858 |
||
5859 |
executionBlock := |
|
5860 |
[:stream | |
|
5861 |
(self getExecutionBlockForCommand:('hg init') |
|
5862 |
inDirectory:dir) value:stream. |
|
5863 |
]. |
|
5864 |
||
5865 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
5866 |
||
5867 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
5868 |
! |
|
5869 |
||
11139 | 5870 |
mercurialPush |
5871 |
|destination dir executionBlock| |
|
5872 |
||
5873 |
destination := Dialog request:'Mercurial Repository' |
|
5874 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
5875 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
5876 |
||
5877 |
LastMercurialRepository := destination. |
|
5878 |
||
5879 |
dir := self directoryContentsBrowser directory. |
|
5880 |
executionBlock := |
|
5881 |
[:stream | |
|
5882 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
5883 |
inDirectory:dir) value:stream. |
|
5884 |
]. |
|
5885 |
||
5886 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
5887 |
||
5888 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
5889 |
! |
|
5890 |
||
5891 |
mercurialStatus |
|
5892 |
|executionBlock sel maxCmdSize| |
|
5893 |
||
5894 |
maxCmdSize := 512. |
|
5895 |
||
5896 |
sel := self currentSelectedObjects. |
|
5897 |
sel isEmptyOrNil ifTrue:[ |
|
5898 |
^ self |
|
5899 |
]. |
|
5900 |
||
5901 |
executionBlock := |
|
5902 |
[:stream | |
|
5903 |
|prevDir cmd| |
|
5904 |
||
5905 |
prevDir := nil. |
|
5906 |
sel do:[:fn | |
|
5907 |
|nameArg dir| |
|
5908 |
||
5909 |
nameArg := '"',fn baseName,'"'. |
|
5910 |
dir := fn directory. |
|
5911 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
5912 |
"/ flush |
|
5913 |
cmd notNil ifTrue:[ |
|
5914 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5915 |
cmd := nil. |
|
5916 |
] |
|
5917 |
]. |
|
5918 |
cmd isNil ifTrue:[ |
|
5919 |
cmd := 'hg status'. |
|
5920 |
]. |
|
5921 |
cmd := cmd,' ',nameArg. |
|
5922 |
prevDir := dir. |
|
5923 |
]. |
|
5924 |
cmd notNil ifTrue:[ |
|
5925 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5926 |
cmd := nil. |
|
5927 |
]. |
|
5928 |
]. |
|
5929 |
||
5930 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
5931 |
||
5932 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 5933 |
! ! |
5934 |
||
4849 | 5935 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 5936 |
|
8510 | 5937 |
allFilesInSelectedDirectoriesForWhich:aBlock |
5938 |
|directories allFiles| |
|
5939 |
||
5940 |
directories := self currentSelectedDirectories. |
|
5941 |
directories isEmpty ifTrue:[^ self]. |
|
5942 |
||
5943 |
allFiles := OrderedCollection new. |
|
5944 |
directories do:[:dir| |
|
5945 |
[ |
|
5946 |
|fileNames| |
|
5947 |
||
5948 |
fileNames := dir directoryContents. |
|
5949 |
fileNames notNil ifTrue:[ |
|
5950 |
fileNames := fileNames |
|
5951 |
collect:[:fn | dir construct:fn] |
|
5952 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
5953 |
allFiles addAll:fileNames. |
|
5954 |
] |
|
5955 |
] on:FileStream openErrorSignal do:[:ex| |
|
5956 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
5957 |
with:ex pathName |
|
5958 |
with:ex description). |
|
5959 |
ex proceedWith:nil. |
|
5960 |
]. |
|
5961 |
]. |
|
5962 |
||
5963 |
^ allFiles |
|
5964 |
! |
|
5965 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5966 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5967 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5968 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5969 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5970 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5971 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5972 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5973 |
"/ 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
|
5974 |
"/ 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
|
5975 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5976 |
conv := OrderedCollection new. |
4722 | 5977 |
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
|
5978 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5979 |
outSuffix = 'png' ifTrue:[ |
4722 | 5980 |
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
|
5981 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5982 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5983 |
outSuffix = 'gif' ifTrue:[ |
4722 | 5984 |
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
|
5985 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5986 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5987 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 5988 |
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
|
5989 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5990 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5991 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 5992 |
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
|
5993 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5994 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5995 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5996 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5997 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5998 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5999 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6000 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6001 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6002 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6003 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6004 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6005 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6006 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6007 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6008 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6009 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6010 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6011 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6012 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6013 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6014 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6015 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6016 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6017 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6018 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6019 |
|
4367 | 6020 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6021 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6022 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6023 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6024 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6025 |
self convertImageToSuffix:'jpg' |
4531 | 6026 |
! |
6027 |
||
6028 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6029 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6030 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6031 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6032 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6033 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6034 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6035 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6036 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6037 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6038 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6039 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6040 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6041 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6042 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6043 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6044 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6045 |
outFile exists ifTrue:[ |
4722 | 6046 |
|answer| |
6047 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6048 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6049 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6050 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6051 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6052 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6053 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6054 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6055 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6056 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6057 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6058 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6059 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6060 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6061 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6062 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6063 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6064 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6065 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6066 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6067 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6068 |
self updateAndSelect:nil. |
4367 | 6069 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6070 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6071 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6072 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6073 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6074 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6075 |
"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
|
6076 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6077 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6078 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6079 |
self convertImageToSuffix:'xpm' |
4367 | 6080 |
! |
6081 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6082 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6083 |
|inFile outFile chainOfConversions conversionStream tempFileTemplate |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6084 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6085 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6086 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6087 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6088 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6089 |
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
|
6090 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6091 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6092 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6093 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6094 |
tempFileTemplate := Filename newTemporary. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6095 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6096 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6097 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6098 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6099 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6100 |
eachConversionCommand == #readToXPM ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6101 |
|image tempFileXPM| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6102 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6103 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6104 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6105 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6106 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6107 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6108 |
tempFileXPM := tempFileTemplate withSuffix:'xpm'. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6109 |
image saveOn:tempFileXPM using:XPMReader. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6110 |
inFile := tempFileXPM. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6111 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6112 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6113 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6114 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6115 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6116 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6117 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6118 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6119 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6120 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6121 |
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
|
6122 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6123 |
outFile := tempFileTemplate withSuffix:eachConversionSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6124 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6125 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6126 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6127 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6128 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6129 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6130 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6131 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6132 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6133 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6134 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6135 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6136 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6137 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6138 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6139 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6140 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6141 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6142 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6143 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6144 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6145 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6146 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6147 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6148 |
] ifCurtailed:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6149 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6150 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6151 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6152 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6153 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6154 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6155 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6156 |
|
3892 | 6157 |
createProjectAndOpenProjectBrowser |
6158 |
|nm f s directory| |
|
6159 |
||
6160 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6161 |
directory := self currentDirectory. |
3892 | 6162 |
nm := directory baseName. |
6163 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6164 |
f exists ifTrue:[ |
|
4414 | 6165 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6166 |
^ self. |
|
3892 | 6167 |
]. |
6168 |
s := f writeStream. |
|
6169 |
s nextPutAll:' |
|
6170 |
name ''' , nm , ''' |
|
6171 |
type #classLibrary |
|
6172 |
package #''private:' , nm , ''' |
|
6173 |
prerequisites nil |
|
6174 |
||
6175 |
classes #( ) |
|
6176 |
'. |
|
6177 |
s close. |
|
6178 |
ProjectBrowser openOnFile:f. |
|
6179 |
! |
|
6180 |
||
5880 | 6181 |
doExecuteCommand |
6182 |
"execute an OperatingSystem-command" |
|
6183 |
||
6184 |
| action fileName| |
|
6185 |
||
6186 |
fileName := self firstSelectedFile. |
|
6187 |
action := [:command | |
|
6188 |
self addToCommandHistory:command for:fileName. |
|
6189 |
self executeCommand:command. |
|
6190 |
]. |
|
6191 |
self askForCommandFor:fileName thenDo:action |
|
6192 |
! |
|
6193 |
||
6194 |
doExecuteScript |
|
6195 |
"execute a smalltalk script" |
|
6196 |
||
6197 |
|textHolder dialog template dummyClass dummyInstance| |
|
6198 |
||
6199 |
template := |
|
6200 |
'"/ Smalltalk script: |
|
6201 |
||
6202 |
"/ the following variables are accessable: |
|
6203 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
6204 |
"/ selectedFiles (= ...) |
|
6205 |
"/ |
|
6206 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6207 |
"/ |
|
6208 |
"/ Useful operations are: |
|
6209 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6210 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6211 |
"/ directory directory |
|
6212 |
"/ |
|
6213 |
"/ example: move all files which match a aarticular pattern to |
|
6214 |
"/ a separate directory: |
|
6215 |
"/ |
|
6216 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6217 |
"/ |
|
6218 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6219 |
"/ |
|
6220 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6221 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6222 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6223 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6224 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6225 |
"/ newDir := directory construct:prefix. |
|
6226 |
"/ newDir exists ifFalse:[ |
|
6227 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6228 |
"/ newDir makeDirectory. |
|
6229 |
"/ ]. |
|
6230 |
"/ ]. |
|
6231 |
"/ newDir exists ifTrue:[ |
|
6232 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6233 |
"/ newFile := newDir construct:rest. |
|
6234 |
"/ oldFile moveTo:newFile |
|
6235 |
"/ ] |
|
6236 |
"/ ] |
|
6237 |
"/ ] |
|
6238 |
'. |
|
6239 |
||
6240 |
LastScriptBlockString isNil ifTrue:[ |
|
6241 |
LastScriptBlockString := template. |
|
6242 |
]. |
|
6243 |
||
6244 |
textHolder := ValueHolder new. |
|
6245 |
dialog := Dialog |
|
6246 |
forRequestText:(resources string:'Enter script') |
|
6247 |
editViewClass:CodeView |
|
6248 |
lines:25 |
|
6249 |
columns:70 |
|
6250 |
initialAnswer:LastScriptBlockString |
|
6251 |
model:textHolder. |
|
6252 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6253 |
dialog open. |
|
6254 |
dialog accepted ifFalse:[^ self]. |
|
6255 |
||
6256 |
LastScriptBlockString := textHolder value. |
|
6257 |
||
6258 |
Class classConventionViolationConfirmationQuerySignal |
|
6259 |
answer:true |
|
6260 |
do:[ |
|
6261 |
dummyClass := Object class |
|
6262 |
name:#Dummy |
|
6263 |
inEnvironment:nil |
|
6264 |
subclassOf:Object |
|
6265 |
instanceVariableNames:'directory selectedFiles' |
|
6266 |
variable:false |
|
6267 |
words:true |
|
6268 |
pointers:true |
|
6269 |
classVariableNames:'' |
|
6270 |
poolDictionaries:'' |
|
6271 |
category:#dummyCategory |
|
6272 |
comment:nil |
|
6273 |
changed:true. |
|
6274 |
]. |
|
6275 |
||
6276 |
dummyInstance := dummyClass basicNew. |
|
6277 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6278 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6279 |
||
6280 |
Compiler |
|
6281 |
evaluate:textHolder value |
|
6282 |
in:nil |
|
6283 |
receiver:dummyInstance |
|
6284 |
notifying:nil |
|
6285 |
logged:false |
|
6286 |
ifFail:[] |
|
6287 |
compile:true. |
|
6288 |
||
6289 |
"/ fileName := self firstSelectedFile. |
|
6290 |
"/ action := [:command | |
|
6291 |
"/ self addToCommandHistory:command for:fileName. |
|
6292 |
"/ self executeCommand:command. |
|
6293 |
"/ ]. |
|
6294 |
"/ self askForCommandFor:fileName thenDo:action |
|
6295 |
! |
|
6296 |
||
4230 | 6297 |
doMake |
7938 | 6298 |
|dir cmd| |
4230 | 6299 |
|
6300 |
cmd := 'make'. |
|
7938 | 6301 |
dir := self theSingleSelectedDirectoryOrNil. |
6302 |
||
6303 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6304 |
dir notNil ifTrue:[ |
|
6305 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
6306 |
cmd := 'bmake.bat'. |
|
6307 |
] |
|
6308 |
] |
|
6309 |
]. |
|
4230 | 6310 |
self executeCommand:cmd. |
6311 |
! |
|
6312 |
||
8256 | 6313 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6314 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6315 |
(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
|
6316 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6317 |
|
8256 | 6318 |
|destDir| |
6319 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6320 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6321 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6322 |
]. |
8256 | 6323 |
destDir := self currentDirectory. |
6324 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6325 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6326 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6327 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6328 |
! |
6329 |
||
7829 | 6330 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6331 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6332 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6333 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 6334 |
! |
6335 |
||
12473 | 6336 |
doOpenFinder |
6337 |
self currentDirectory asFilename openFinder |
|
6338 |
||
6339 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
6340 |
! |
|
6341 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6342 |
doOpenSettings |
8168 | 6343 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6344 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6345 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6346 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6347 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6348 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6349 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6350 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6351 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6352 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6353 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6354 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6355 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6356 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6357 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6358 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6359 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6360 |
|
7104 | 6361 |
editMode:aSymbol |
6362 |
self |
|
6363 |
applicationNamed:#FileApplicationNoteBook |
|
6364 |
ifPresentDo:[:appl | |
|
6365 |
|subApp| |
|
6366 |
||
6367 |
subApp := appl selectedApplication. |
|
6368 |
subApp notNil ifTrue:[ |
|
6369 |
^ subApp perform:aSymbol |
|
6370 |
] |
|
6371 |
]. |
|
6372 |
||
6373 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
6374 |
! |
|
6375 |
||
6376 |
editModeInsert |
|
6377 |
self editMode:#editModeInsert |
|
6378 |
||
6379 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
6380 |
! |
|
6381 |
||
6382 |
editModeInsertAndSelect |
|
6383 |
self editMode:#editModeInsertAndSelect |
|
6384 |
||
6385 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
6386 |
! |
|
6387 |
||
6388 |
editModeOverwrite |
|
6389 |
self editMode:#editModeOverwrite |
|
6390 |
||
6391 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
6392 |
! |
|
6393 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6394 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6395 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6396 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6397 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6398 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6399 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6400 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
11889 | 6401 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6402 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6403 |
]. |
11889 | 6404 |
(Dialog confirm:(resources string:'File is big - proceed ?')) ifFalse:[^ self]. |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6405 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6406 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6407 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6408 |
|
3892 | 6409 |
fileFileIn |
6410 |
"fileIn the selected file(s)" |
|
6411 |
||
6412 |
self fileFileInLazy:false |
|
6413 |
! |
|
6414 |
||
7324 | 6415 |
fileFileIn:aFilename lazy:lazy |
6416 |
"fileIn a file" |
|
6417 |
||
6418 |
self withActivityIndicationDo:[ |
|
6419 |
self notify:('File in:', aFilename asFilename baseName). |
|
6420 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6421 |
self notify:nil. |
|
6422 |
] |
|
6423 |
||
6424 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
6425 |
! |
|
6426 |
||
3892 | 6427 |
fileFileInLazy |
6428 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
6429 |
||
6430 |
self fileFileInLazy:true |
|
6431 |
! |
|
6432 |
||
6433 |
fileFileInLazy:lazy |
|
6434 |
"fileIn the selected file(s)" |
|
6435 |
||
7324 | 6436 |
self currentSelectedFiles do:[:fileName | |
6437 |
self fileIn:fileName lazy:lazy |
|
6438 |
]. |
|
6439 |
||
6440 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 6441 |
! |
6442 |
||
12497 | 6443 |
fileFileInPackage |
6444 |
"assuming the current directory is a package directory, load it" |
|
6445 |
||
6446 |
|packageDir dir path top packageID| |
|
6447 |
||
6448 |
"/ find a reasonable package-id (walk up until we find stx) |
|
6449 |
path := ''. |
|
6450 |
dir := packageDir := self currentDirectory. |
|
6451 |
||
6452 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
6453 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
6454 |
path := dir baseName , '/' , path. |
|
6455 |
dir := dir directory. |
|
6456 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6457 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 6458 |
"/ should ask the user for a packageID and proceed... |
6459 |
^ self. |
|
6460 |
]. |
|
6461 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6462 |
packageID := path copyButLast:1. |
12497 | 6463 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
6464 |
! |
|
6465 |
||
3892 | 6466 |
fileFileInToNameSpace |
6467 |
"fileIn the selected file(s)<into a nameSpace" |
|
6468 |
||
6469 |
|ns listOfKnownNameSpaces| |
|
6470 |
||
6471 |
listOfKnownNameSpaces := Set new. |
|
6472 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
6473 |
allNameSpaces |
4414 | 6474 |
do:[:eachNameSpace | |
6475 |
listOfKnownNameSpaces add:eachNameSpace name |
|
6476 |
]. |
|
3892 | 6477 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
6478 |
||
6479 |
ns := Dialog |
|
4414 | 6480 |
request:'During fileIn, new classes are created in nameSpace:' |
6481 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
6482 |
list:listOfKnownNameSpaces. |
|
3892 | 6483 |
ns isEmptyOrNil ifTrue:[^ self]. |
6484 |
||
6485 |
LastEnforcedNameSpace := ns. |
|
6486 |
ns := NameSpace name:ns. |
|
6487 |
||
6488 |
Class nameSpaceQuerySignal |
|
4414 | 6489 |
answer:ns |
6490 |
do:[ |
|
6491 |
self fileFileInLazy:false |
|
6492 |
] |
|
3892 | 6493 |
! |
6494 |
||
6495 |
fileFindAllDuplicates |
|
6496 |
"scan directory and all subdirs for duplicate files" |
|
6497 |
||
6498 |
|fileNames dir infoDir filesBySize |
|
6499 |
result info dirPrefix myName stream textBox maxLength directories| |
|
6500 |
||
6501 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6502 |
self withActivityIndicationDo:[ |
4414 | 6503 |
result := Dictionary new. |
6504 |
myName := self class name asString. |
|
6505 |
directories := self currentSelectedDirectories. |
|
6506 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 6507 |
|
4414 | 6508 |
dir := directories first. |
3892 | 6509 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6510 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6511 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6512 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 6513 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
6514 |
with:ex pathName |
|
6515 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6516 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6517 |
]. |
4765 | 6518 |
fileNames := fileNames |
6519 |
collect:[:fn | dir construct:fn] |
|
6520 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 6521 |
|
6522 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 6523 |
infoDir := Dictionary new. |
6524 |
fileNames do:[:fn | |
|
6525 |
infoDir at:fn put:(fn fileSize) |
|
6526 |
]. |
|
6527 |
||
6528 |
"/ for each, get the files size. |
|
6529 |
"/ in a first pass, look for files of the same size and |
|
6530 |
"/ compare them ... |
|
3892 | 6531 |
|
6532 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 6533 |
filesBySize := Dictionary new. |
6534 |
infoDir keysAndValuesDo:[:fn :sz | |
|
6535 |
|entry| |
|
6536 |
||
6537 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6538 |
entry add:fn. |
|
6539 |
]. |
|
6540 |
||
6541 |
"/ any of same size ? |
|
3892 | 6542 |
|
6543 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 6544 |
filesBySize do:[:entry | |
6545 |
|files| |
|
6546 |
||
6547 |
entry size > 1 ifTrue:[ |
|
6548 |
files := entry asArray. |
|
6549 |
1 to:files size-1 do:[:idx1 | |
|
6550 |
idx1+1 to:files size do:[:idx2 | |
|
6551 |
|fn1 fn2| |
|
6552 |
||
6553 |
fn1 := files at:idx1. |
|
6554 |
fn2 := files at:idx2. |
|
3892 | 6555 |
|
6556 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 6557 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
6558 |
"/ compare the files |
|
6559 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6560 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 6561 |
result at:fn1 put:fn2. |
6562 |
] |
|
6563 |
] |
|
6564 |
] |
|
6565 |
] |
|
6566 |
] |
|
6567 |
]. |
|
3892 | 6568 |
|
6569 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 6570 |
dirPrefix := dir pathName. |
6571 |
result := result associations. |
|
6572 |
result := result collect:[:assoc | |
|
6573 |
|f1 f2| |
|
6574 |
||
6575 |
f1 := assoc key name. |
|
6576 |
f2 := assoc value name. |
|
6577 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
6578 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
6579 |
]. |
|
6580 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
6581 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
6582 |
]. |
|
6583 |
f1 < f2 ifTrue:[ |
|
6584 |
f2 -> f1 |
|
6585 |
] ifFalse:[ |
|
6586 |
f1 -> f2 |
|
6587 |
] |
|
6588 |
]. |
|
6589 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
6590 |
||
6591 |
info := OrderedCollection new. |
|
6592 |
result do:[:assoc | |
|
6593 |
info add:(assoc key , ' same as ' , assoc value) |
|
6594 |
]. |
|
6595 |
info isEmpty ifTrue:[ |
|
11889 | 6596 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 6597 |
^ self. |
4414 | 6598 |
]. |
3892 | 6599 |
]. |
6600 |
||
6601 |
stream := WriteStream on:''. |
|
11688 | 6602 |
stream nextPutAllLines:info. |
5542 | 6603 |
|
3892 | 6604 |
textBox := TextBox new. |
6605 |
textBox initialText:(stream contents). |
|
5542 | 6606 |
stream close. |
11889 | 6607 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 6608 |
textBox readOnly:true. |
6609 |
textBox noCancel. |
|
11889 | 6610 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 6611 |
maxLength := 10. |
6612 |
info do:[: el | |
|
4414 | 6613 |
maxLength := maxLength max:(el size). |
3892 | 6614 |
]. |
6615 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 6616 |
textBox maxExtent:Screen current extent. |
6617 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6618 |
|
11688 | 6619 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 6620 |
! |
6621 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6622 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6623 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6624 |
|
10306 | 6625 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6626 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6627 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6628 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6629 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6630 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6631 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6632 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6633 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6634 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6635 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6636 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6637 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6638 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6639 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6640 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6641 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6642 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6643 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6644 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6645 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6646 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6647 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6648 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6649 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6650 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6651 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6652 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6653 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6654 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6655 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6656 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6657 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6658 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6659 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6660 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6661 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6662 |
stream := WriteStream on:''. |
10306 | 6663 |
stream nextPutLine:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6664 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6665 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6666 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6667 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6668 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6669 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6670 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6671 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6672 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6673 |
]. |
10306 | 6674 |
stream nextPutLine:'Files without duplicates:'. |
6675 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6676 |
do:[:origFile | |
|
6677 |
|sameFiles| |
|
6678 |
||
6679 |
sameFiles := samePerFile at:origFile. |
|
6680 |
sameFiles isEmpty ifTrue:[ |
|
6681 |
stream nextPutLine:origFile baseName. |
|
6682 |
]. |
|
6683 |
]. |
|
6684 |
||
6685 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
6686 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
6687 |
LastMustMatchPattern := mustHaveMatches. |
|
6688 |
||
6689 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
6690 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6691 |
do:[:origFile | |
|
6692 |
|sameFiles| |
|
6693 |
||
6694 |
sameFiles := samePerFile at:origFile. |
|
6695 |
sameFiles notEmpty ifTrue:[ |
|
6696 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
6697 |
stream nextPutLine:origFile baseName. |
|
6698 |
] |
|
6699 |
]. |
|
6700 |
]. |
|
6701 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6702 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6703 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6704 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6705 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6706 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6707 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6708 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6709 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6710 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6711 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6712 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6713 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6714 |
|
3892 | 6715 |
fileFindDuplicates |
6716 |
"scan directory for duplicate files" |
|
6717 |
||
8510 | 6718 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
6719 |
||
6720 |
directories := self currentSelectedDirectories. |
|
3892 | 6721 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6722 |
self withActivityIndicationDo:[ |
4355 | 6723 |
result := Dictionary new. |
6724 |
||
6725 |
directories := self currentSelectedDirectories. |
|
6726 |
directories isEmpty ifTrue:[^ self]. |
|
6727 |
||
8510 | 6728 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 6729 |
|
6730 |
infoDir := Dictionary new. |
|
6731 |
allFiles do:[:fn | |
|
6732 |
infoDir at:fn put:(fn info) |
|
6733 |
]. |
|
6734 |
||
6735 |
"/ for each, get the files size. |
|
6736 |
"/ in a first pass, look for files of the same size and |
|
6737 |
"/ compare them ... |
|
6738 |
||
6739 |
filesBySize := Dictionary new. |
|
6740 |
infoDir keysAndValuesDo:[:fn :info | |
|
6741 |
|sz entry| |
|
6742 |
||
6743 |
sz := info size. |
|
6744 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6745 |
entry add:fn. |
|
6746 |
]. |
|
6747 |
||
6748 |
"/ any of same size ? |
|
6749 |
||
6750 |
filesBySize do:[:entry | |
|
6751 |
|files| |
|
6752 |
||
6753 |
entry size > 1 ifTrue:[ |
|
6754 |
files := entry asArray. |
|
6755 |
1 to:files size-1 do:[:idx1 | |
|
6756 |
idx1+1 to:files size do:[:idx2 | |
|
6757 |
|fn1 fn2| |
|
6758 |
||
6759 |
fn1 := files at:idx1. |
|
6760 |
fn2 := files at:idx2. |
|
6761 |
||
6762 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
6763 |
"/ compare the files |
|
6764 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6765 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 6766 |
result at:fn1 put:fn2. |
6767 |
] |
|
6768 |
] |
|
6769 |
] |
|
6770 |
] |
|
6771 |
] |
|
6772 |
]. |
|
6773 |
||
6774 |
result := result associations. |
|
6775 |
result := result collect:[:assoc | |
|
6776 |
|f1 f2| |
|
6777 |
||
6778 |
f1 := assoc key asString. |
|
6779 |
f2 := assoc value asString. |
|
6780 |
f1 < f2 ifTrue:[ |
|
6781 |
f2 -> f1 |
|
6782 |
] ifFalse:[ |
|
6783 |
f1 -> f2 |
|
6784 |
] |
|
6785 |
]. |
|
5789 | 6786 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
6787 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 6788 |
|
6789 |
info := OrderedCollection new. |
|
6790 |
size := self getBestDirectory asString size. |
|
6791 |
result do:[:assoc | |
|
6792 |
|fn1 fn2| |
|
6793 |
||
6794 |
fn1 := assoc key. |
|
6795 |
fn2 := assoc value. |
|
6796 |
size > 1 ifTrue:[ |
|
6797 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
6798 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
6799 |
]. |
|
6800 |
(fn1 includes:Character space) ifTrue:[ |
|
6801 |
fn1 := '"' , fn1 , '"' |
|
6802 |
]. |
|
6803 |
(fn2 includes:Character space) ifTrue:[ |
|
6804 |
fn2 := '"' , fn2 , '"' |
|
6805 |
]. |
|
6806 |
info add:(fn1 , ' same as ' , fn2) |
|
6807 |
]. |
|
6808 |
info isEmpty ifTrue:[ |
|
5543 | 6809 |
Dialog information:'No duplicate files found.'. |
6810 |
^ self. |
|
4355 | 6811 |
]. |
3892 | 6812 |
]. |
6813 |
stream := WriteStream on:''. |
|
11688 | 6814 |
stream nextPutAllLines:info. |
6815 |
||
3892 | 6816 |
titleStream := WriteStream on:''. |
12602 | 6817 |
titleStream nextPutAll:'File duplicates in directory'. |
3892 | 6818 |
directories size == 1 ifTrue:[ |
12602 | 6819 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 6820 |
] ifFalse:[ |
4535 | 6821 |
titleStream nextPutLine:'ies: '. |
4355 | 6822 |
directories do:[:dir| |
6823 |
size > 1 ifTrue:[ |
|
6824 |
titleStream nextPutAll:'..'. |
|
4535 | 6825 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 6826 |
] ifFalse:[ |
4535 | 6827 |
titleStream nextPutLine:(dir asString). |
4355 | 6828 |
]. |
6829 |
] |
|
3892 | 6830 |
]. |
5543 | 6831 |
|
3892 | 6832 |
textBox := TextBox new. |
6833 |
textBox initialText:(stream contents). |
|
6834 |
textBox title:(titleStream contents). |
|
6835 |
textBox readOnly:true. |
|
6836 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6837 |
stream := WriteStream on:'Duplicates in '. |
4170 | 6838 |
directories do:[ :aDirectory | |
4355 | 6839 |
stream nextPutAll:aDirectory baseName. |
6840 |
stream space. |
|
4050 | 6841 |
]. |
4170 | 6842 |
textBox label:stream contents. |
3892 | 6843 |
maxLength := 10. |
6844 |
info do:[: el | |
|
4355 | 6845 |
maxLength := maxLength max:(el size). |
3892 | 6846 |
]. |
5092 | 6847 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
6848 |
textBox maxExtent:Screen current extent. |
|
4355 | 6849 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6850 |
|
11688 | 6851 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 6852 |
! |
6853 |
||
6854 |
fileFindFile |
|
5961 | 6855 |
|filename| |
6856 |
||
6857 |
filename := self firstSelectedFileName. |
|
6858 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6859 |
filename := Filename homeDirectory. |
3892 | 6860 |
]. |
4101 | 6861 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 6862 |
! |
6863 |
||
8510 | 6864 |
fileFindSimilarImages |
6865 |
"scan directory for similar image files" |
|
6866 |
||
8512 | 6867 |
|result stream textBox directories imageFiles histogramsV histogramsH |
6868 |
similarV similarH similar alreadyPrinted| |
|
8510 | 6869 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6870 |
self withWaitCursorDo:[ |
8510 | 6871 |
self withActivityIndicationDo:[ |
6872 |
result := Dictionary new. |
|
6873 |
||
6874 |
directories := self currentSelectedDirectories. |
|
6875 |
directories isEmpty ifTrue:[^ self]. |
|
6876 |
||
6877 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImage]. |
|
8511 | 6878 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
6879 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
6880 |
||
8510 | 6881 |
"/ for each, get the color histogram |
6882 |
histogramsV := Dictionary new. |
|
6883 |
histogramsH := Dictionary new. |
|
6884 |
imageFiles do:[:fn | |
|
6885 |
|hist image| |
|
6886 |
||
6887 |
image := Image fromFile:fn. |
|
6888 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
6889 |
hist := ImageColorHistogram new forImage:image. |
|
6890 |
histogramsV at:fn put:(hist histogramVectorV). |
|
6891 |
histogramsH at:fn put:(hist histogramVectorH). |
|
6892 |
]. |
|
6893 |
||
6894 |
similarH := Dictionary new. |
|
6895 |
similarV := Dictionary new. |
|
6896 |
similar := Dictionary new. |
|
6897 |
||
8512 | 6898 |
(self firstSelectedFile notNil |
6899 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
6900 |
ifFalse:[ imageFiles ]) |
|
6901 |
do:[:eachFile1 | |
|
8510 | 6902 |
|setOfSimilar distancesV distancesH| |
6903 |
||
6904 |
distancesV := OrderedCollection new. |
|
6905 |
distancesH := OrderedCollection new. |
|
6906 |
setOfSimilar := OrderedCollection new. |
|
6907 |
||
6908 |
imageFiles do:[:eachFile2 | |
|
6909 |
|v1 v2 dV dH| |
|
6910 |
||
6911 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
6912 |
v1 := histogramsV at:eachFile1. |
|
6913 |
v2 := histogramsV at:eachFile2. |
|
6914 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
6915 |
distancesV add:(eachFile2 -> dV). |
|
6916 |
v1 := histogramsH at:eachFile1. |
|
6917 |
v2 := histogramsH at:eachFile2. |
|
6918 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
6919 |
distancesH add:(eachFile2 -> dH). |
|
6920 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 6921 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 6922 |
]. |
6923 |
] |
|
6924 |
]. |
|
6925 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
6926 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
6927 |
similarV at:eachFile1 put:distancesV. |
|
6928 |
similarH at:eachFile1 put:distancesH. |
|
6929 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
6930 |
]. |
|
6931 |
||
6932 |
similar isEmpty ifTrue:[ |
|
6933 |
Dialog information:'No similarities found.'. |
|
6934 |
^ self. |
|
6935 |
]. |
|
6936 |
]. |
|
6937 |
||
6938 |
stream := WriteStream on:''. |
|
8512 | 6939 |
alreadyPrinted := Set new. |
6940 |
||
6941 |
imageFiles do:[:eachFile | |
|
6942 |
|eachSet| |
|
6943 |
||
6944 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
6945 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
6946 |
eachSet notNil ifTrue:[ |
|
6947 |
stream nextPutLine:eachFile pathName. |
|
6948 |
eachSet do:[:info | |
|
6949 |
|fn2 dist| |
|
6950 |
||
6951 |
fn2 := info key. |
|
6952 |
dist := info value. |
|
6953 |
stream nextPutAll:' '. |
|
6954 |
stream nextPutAll:fn2 pathName. |
|
6955 |
stream nextPutLine:' (',dist printString,')'. |
|
6956 |
alreadyPrinted add:fn2. |
|
6957 |
]. |
|
6958 |
stream cr. |
|
6959 |
]. |
|
8510 | 6960 |
]. |
6961 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6962 |
]. |
8510 | 6963 |
|
6964 |
textBox := TextBox new. |
|
6965 |
textBox initialText:(stream contents). |
|
6966 |
textBox title:'File similarities:'. |
|
6967 |
textBox readOnly:true. |
|
6968 |
textBox noCancel. |
|
6969 |
||
6970 |
textBox label:'File similarities'. |
|
6971 |
textBox extent:(400@((similar size max:40)* 10)). |
|
6972 |
textBox maxExtent:Screen current extent. |
|
6973 |
textBox openModeless. "/ showAtPointer. |
|
6974 |
||
6975 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
6976 |
! |
|
6977 |
||
4618 | 6978 |
fileHexDump |
6979 |
||
6980 |
| file item| |
|
6981 |
||
6982 |
file := self firstSelectedFile. |
|
6983 |
file notNil ifTrue:[ |
|
6984 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 6985 |
self |
6986 |
applicationNamed:#FileApplicationNoteBook |
|
6987 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 6988 |
]. |
6989 |
! |
|
6990 |
||
7324 | 6991 |
fileIn:aFilename |
6992 |
"fileIn a file" |
|
6993 |
||
6994 |
self fileIn:aFilename lazy:false |
|
6995 |
||
6996 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
6997 |
! |
|
6998 |
||
6999 |
fileIn:aFilename lazy:lazy |
|
7000 |
"fileIn a file" |
|
7001 |
||
7002 |
self withActivityIndicationDo:[ |
|
7003 |
self notify:('File in:', aFilename asFilename baseName). |
|
7004 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7005 |
self notify:nil. |
|
7006 |
] |
|
7007 |
||
7008 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
7009 |
! |
|
7010 |
||
4930 | 7011 |
filterSelectedFiles:whichFilter |
7012 |
|selectedFiles numFiles msg filterBlock| |
|
7013 |
||
7560 | 7014 |
selectedFiles := self currentSelectedObjects. |
4930 | 7015 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7016 |
||
7017 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7018 |
numFiles > 1 ifTrue:[ |
|
7019 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7020 |
]. |
|
7021 |
||
7022 |
(Dialog |
|
6352 | 7023 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7024 |
initialAnswer:false |
7025 |
) ifFalse:[ |
|
7026 |
^ self |
|
7027 |
]. |
|
7028 |
||
7029 |
whichFilter == #rot13 ifTrue:[ |
|
7030 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7031 |
]. |
|
7032 |
"/ add more here... |
|
7033 |
||
7034 |
filterBlock isNil ifTrue:[ |
|
7035 |
self information:'No such filter: ' , whichFilter. |
|
7036 |
^ self. |
|
7037 |
]. |
|
7038 |
||
7039 |
selectedFiles do:[:fileName | |
|
7040 |
|s| |
|
7041 |
||
7042 |
self notify:('Processing:', fileName baseName). |
|
7043 |
fileName isDirectory ifFalse:[ |
|
7044 |
[ |
|
7045 |
|inFile outFile in out| |
|
7046 |
||
7047 |
inFile := fileName asFilename. |
|
7048 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7049 |
||
7050 |
[ |
|
7051 |
|charIn charOut| |
|
7052 |
||
7053 |
in := inFile readStream. |
|
7054 |
out := outFile writeStream. |
|
7055 |
[in atEnd] whileFalse:[ |
|
7056 |
charIn := in next. |
|
7057 |
charOut := filterBlock value:charIn. |
|
7058 |
out nextPut:charOut. |
|
7059 |
]. |
|
7060 |
outFile renameTo:inFile. |
|
7061 |
] ensure:[ |
|
7062 |
out notNil ifTrue:[ out close ]. |
|
7063 |
in notNil ifTrue:[ in close ]. |
|
7064 |
outFile delete. |
|
7065 |
] |
|
7066 |
] on:FileStream openErrorSignal do:[:ex| |
|
7067 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7068 |
]. |
|
7069 |
] |
|
7070 |
]. |
|
6190 | 7071 |
self notify:nil. |
7560 | 7072 |
|
7073 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7074 |
! |
7075 |
||
9784 | 7076 |
forEachParsedXmlFileDo:aBlock |
7077 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7078 |
||
7079 |
self withActivityIndicationDo:[ |
|
7080 |
| selectedFiles xmlDocument | |
|
7081 |
||
7082 |
selectedFiles:= self currentSelectedFiles. |
|
7083 |
selectedFiles do:[:fileName | |
|
7084 |
XML::XMLSignal handle:[:ex | |
|
7085 |
Dialog information:('Error while reading XML:\ %1' bindWith:ex description) withCRs. |
|
7086 |
^ self. |
|
7087 |
] do:[ |
|
7088 |
|s d magic encoder document| |
|
7089 |
||
7090 |
s := fileName asFilename readStream. |
|
7091 |
s binary. |
|
7092 |
magic := (s next:2). |
|
7093 |
magic = #[254 255] ifTrue:[ |
|
7094 |
"/ UTF16BE |
|
7095 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7096 |
] ifFalse:[ |
|
7097 |
magic = #[255 254] ifTrue:[ |
|
7098 |
"/ UTF16LE |
|
7099 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7100 |
]. |
|
7101 |
]. |
|
7102 |
s close. |
|
7103 |
||
7104 |
document notNil ifTrue:[ |
|
7105 |
xmlDocument := XML::XMLParser |
|
7106 |
processDocumentString:document |
|
7107 |
beforeScanDo:[:parse| parse validate:false]. |
|
7108 |
] ifFalse:[ |
|
7109 |
xmlDocument := XML::XMLParser |
|
7110 |
processDocumentInFilename:fileName |
|
7111 |
beforeScanDo:[:parse| parse validate:false]. |
|
7112 |
] |
|
7113 |
]. |
|
7114 |
aBlock value:xmlDocument. |
|
7115 |
]. |
|
7116 |
] |
|
7117 |
||
7118 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7119 |
! |
|
7120 |
||
8832 | 7121 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7122 |
|numItems path files| |
|
7123 |
||
7124 |
files := self currentSelectedFiles. |
|
7125 |
||
7126 |
(numItems := files size) > 2 ifTrue:[ |
|
7127 |
(self |
|
7128 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7129 |
with:numItems)) ifFalse:[^ self]. |
|
7130 |
]. |
|
7131 |
||
7132 |
self withActivityIndicationDo:[ |
|
7133 |
files do:[:fileName | |
|
7134 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7135 |
fileName isAbsolute ifTrue:[ |
|
7136 |
path := fileName getName. |
|
7137 |
] ifFalse:[ |
|
7138 |
path := fileName pathName. |
|
7139 |
]. |
|
7140 |
aBlock value:path |
|
7141 |
] |
|
7142 |
]. |
|
7143 |
]. |
|
7144 |
! |
|
7145 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7146 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7147 |
"generate detached signature (pkcs7) files from the contents of the selected files. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7148 |
For smalltalk text files, better use #generateSignaturesForSelectedFiles." |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7149 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7150 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7151 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7152 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7153 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7154 |
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
|
7155 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7156 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7157 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7158 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7159 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7160 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7161 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7162 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7163 |
]. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7164 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7165 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7166 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7167 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7168 |
generateSignaturesForSelectedFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7169 |
"generate signed pkcs7 files from the contents of the selected files" |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7170 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7171 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7172 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7173 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7174 |
|
8646 | 7175 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7176 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7177 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7178 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7179 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7180 |
]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7181 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7182 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7183 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7184 |
|
9784 | 7185 |
inspectXmlFile |
7186 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7187 |
a plain inspector on the XML tree" |
|
7188 |
||
7189 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7190 |
XML::XMLInspector notNil ifTrue:[ |
|
7191 |
XML::XMLInspector openOn:xmlDocument. |
|
7192 |
] ifFalse:[ |
|
7193 |
"fall back..." |
|
7194 |
xmlDocument inspect. |
|
7195 |
] |
|
7196 |
]. |
|
7197 |
||
7198 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7199 |
! |
|
7200 |
||
3892 | 7201 |
installAllAsAutoloaded |
7202 |
"install all classes found here as autoloaded classes" |
|
7203 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7204 |
self installAllAsAutoloadedRecursive:false |
3892 | 7205 |
! |
7206 |
||
6521 | 7207 |
installAllAsAutoloadedRecursive |
7208 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7209 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7210 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7211 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7212 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7213 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7214 |
"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
|
7215 |
|
6521 | 7216 |
[ |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7217 |
|installAction| |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7218 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7219 |
installAction := |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7220 |
[:fn | |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7221 |
(fn suffix = 'st') ifTrue:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7222 |
self notify:('Install as autoloaded: ', fn baseName). |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7223 |
self installAsAutoloaded:fn. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7224 |
] |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7225 |
]. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7226 |
|
6521 | 7227 |
self withActivityIndicationDo:[ |
6725 | 7228 |
self currentSelectedDirectories do:[:dir| |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7229 |
aBoolean ifTrue:[ |
9675
704831da3132
changed: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9674
diff
changeset
|
7230 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7231 |
] ifFalse:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7232 |
dir directoryContentsAsFilenamesDo:installAction |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7233 |
]. |
6521 | 7234 |
]. |
7235 |
self notify:nil. |
|
7236 |
] |
|
7237 |
] fork. |
|
7238 |
! |
|
7239 |
||
3892 | 7240 |
installAsAutoloaded:aFilename |
7241 |
"install aFilename as autoloaded class" |
|
7242 |
||
9455 | 7243 |
|chunks filename| |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7244 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7245 |
filename := aFilename asFilename. |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7246 |
|
12396 | 7247 |
ChangeSet::InvalidChangeChunkError handle:[:ex | |
7248 |
^ self |
|
7249 |
] do:[ |
|
7250 |
filename readingFileDo:[:s| |
|
7251 |
chunks := ChangeSet fromStream:s while:[:chunk | chunk isMethodChange not]. |
|
7252 |
]. |
|
7253 |
]. |
|
7254 |
||
3892 | 7255 |
chunks |
4414 | 7256 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7257 |
thenDo:[:eachClassChunk | |
8039
732cbc4ea214
keep absolute-pathname including suffix as classFilename
Claus Gittinger <cg@exept.de>
parents:
8013
diff
changeset
|
7258 |
eachClassChunk installAsAutoloadedClassIfPublicWithFilename:filename asAbsoluteFilename "withoutSuffix" name "baseName" |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7259 |
]. |
3892 | 7260 |
! |
7261 |
||
4558 | 7262 |
joinSelectedFiles |
6264 | 7263 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 7264 |
|
7560 | 7265 |
selectedFiles := self currentSelectedObjects. |
4558 | 7266 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
7267 |
||
7268 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 7269 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 7270 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
7271 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 7272 |
|
7273 |
outStream := outFile writeStream. |
|
7274 |
||
7275 |
selectedFiles do:[:fileName | |
|
7276 |
|inStream| |
|
7277 |
||
7278 |
self notify:('Adding:', fileName baseName). |
|
7279 |
inStream := fileName readStream. |
|
7280 |
inStream copyToEndInto:outStream. |
|
7281 |
inStream close. |
|
7282 |
]. |
|
7283 |
outStream close. |
|
6190 | 7284 |
self notify:nil. |
7560 | 7285 |
|
7286 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 7287 |
! |
7288 |
||
6292 | 7289 |
loadImageThenDo:aBlock |
3892 | 7290 |
|img path files| |
7291 |
||
3982 | 7292 |
files := self currentSelectedFiles. |
3892 | 7293 |
files isEmpty ifTrue:[ ^ self]. |
7294 |
files do:[:fileName | |
|
4414 | 7295 |
path := fileName. |
7296 |
path isDirectory ifFalse:[ |
|
7297 |
img := Image fromFile:(path pathName). |
|
7298 |
img notNil ifTrue:[ |
|
6292 | 7299 |
aBlock value:img |
4414 | 7300 |
] ifFalse:[ |
6292 | 7301 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 7302 |
] |
7303 |
] |
|
3892 | 7304 |
]. |
7305 |
! |
|
7306 |
||
7307 |
openASN1Browser |
|
7308 |
||
7309 |
self openTool:OSI::ASN1Browser |
|
7310 |
! |
|
7311 |
||
7312 |
openAppletViewer |
|
7313 |
|numItems files| |
|
7314 |
||
3982 | 7315 |
files := self currentSelectedFiles. |
3892 | 7316 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 7317 |
(self |
7318 |
confirm:(resources string:'open for each of the %1 items ?' |
|
7319 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 7320 |
]. |
7321 |
||
7322 |
Java startupJavaSystem. |
|
7323 |
"/ Java markAllClassesUninitialized. |
|
7324 |
"/ Java initAllStaticFields. |
|
7325 |
"/ Java initAllClasses. |
|
7326 |
||
7327 |
files do:[:fileName | |
|
4414 | 7328 |
|p path| |
7329 |
||
7330 |
path := fileName. |
|
7331 |
path isDirectory ifFalse:[ |
|
7332 |
p := Java |
|
7333 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
7334 |
argumentString:path pathName. |
|
7335 |
p resume. |
|
7336 |
] |
|
3892 | 7337 |
]. |
7338 |
! |
|
7339 |
||
7340 |
openCBrowser |
|
6031 | 7341 |
|dir files| |
5880 | 7342 |
|
7343 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7344 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7345 |
self withActivityIndicationDo:[ |
7560 | 7346 |
files := self currentSelectedObjects. |
6031 | 7347 |
files notEmptyOrNil ifTrue:[ |
7348 |
CBrowser::Browser openOn:files first. |
|
7349 |
] ifFalse:[ |
|
7350 |
CBrowser::Browser openIn:dir. |
|
7351 |
] |
|
3892 | 7352 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7353 |
|
7560 | 7354 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 7355 |
! |
7356 |
||
4230 | 7357 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7358 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7359 |
|
4230 | 7360 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7361 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 7362 |
with:#openOnFile: |
7363 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7364 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7365 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 7366 |
! |
7367 |
||
3892 | 7368 |
openChangesBrowser |
7369 |
"open a change browser on the selected file(s)" |
|
7370 |
||
7371 |
self openTool:(UserPreferences current changesBrowserClass) |
|
7372 |
! |
|
7373 |
||
7374 |
openDiffView |
|
7375 |
"open a diff-view" |
|
7376 |
||
6388 | 7377 |
|name1 name2 text1 text2 d err nm l1 files title |
11052 | 7378 |
defaultName defaultDir lastFile sameContents msg| |
6460 | 7379 |
|
7380 |
files := self currentSelectedObjects. |
|
3892 | 7381 |
files isEmpty ifTrue:[ |
6460 | 7382 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 7383 |
^ self. |
3892 | 7384 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7385 |
|
3892 | 7386 |
(files size == 2) ifTrue:[ |
4414 | 7387 |
name1 := files last. |
7388 |
name2 := files first. |
|
3892 | 7389 |
] ifFalse:[ |
4414 | 7390 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 7391 |
LastFileDiffFile exists ifTrue:[ |
7392 |
name1 := LastFileDiffFile. |
|
7393 |
]. |
|
7394 |
"/ | directory | |
|
7395 |
"/ directory := self currentDirectory. |
|
7396 |
"/ directory notNil ifTrue:[ |
|
7397 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
7398 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
7399 |
"/ name1 := lastFile. |
|
7400 |
"/ ] |
|
7401 |
"/ ] |
|
4414 | 7402 |
]. |
7403 |
name2 := files first. |
|
6460 | 7404 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 7405 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 7406 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 7407 |
name1 := DialogBox |
7408 |
requestFileName:title |
|
7409 |
default:defaultName |
|
6460 | 7410 |
ok:(resources string:'OK') |
7411 |
abort:(resources string:'Compare against File List') |
|
4414 | 7412 |
pattern:'*' |
11052 | 7413 |
fromDirectory:defaultDir. |
3892 | 7414 |
]. |
7415 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7416 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7417 |
(name1 isNil or:[name1 asString isEmpty]) ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7418 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7419 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7420 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7421 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7422 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7423 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7424 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7425 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7426 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7427 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7428 |
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
|
7429 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7430 |
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
|
7431 |
]. |
4414 | 7432 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7433 |
l1 := name1 pathName |
4414 | 7434 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7435 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7436 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7437 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7438 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7439 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7440 |
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
|
7441 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7442 |
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
|
7443 |
]. |
4414 | 7444 |
]. |
7445 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7446 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7447 |
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
|
7448 |
^ self |
6176 | 7449 |
]. |
7450 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7451 |
self withActivityIndicationDo:[ |
11494 | 7452 |
((name1 notNil and:[name1 fileSize > (1024*1024*32)]) |
7453 |
or:[ name2 fileSize > (1024*1024*32) ]) ifTrue:[ |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7454 |
name1 fileSize = name2 fileSize ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7455 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7456 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7457 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7458 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7459 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7460 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7461 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7462 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7463 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7464 |
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
|
7465 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7466 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7467 |
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
|
7468 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7469 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7470 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7471 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7472 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7473 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7474 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7475 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7476 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7477 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7478 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7479 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7480 |
text2 := name2 directoryContents asString. |
6460 | 7481 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7482 |
text2 := name2 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7483 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7484 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7485 |
(name1 isDirectory or:[name2 isDirectory]) ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7486 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7487 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7488 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7489 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7490 |
self information:(resources string:msg) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7491 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7492 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7493 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7494 |
and:text2 label:name2 pathName. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7495 |
d topView label:(resources string:'File Differences'). |
6460 | 7496 |
] |
4414 | 7497 |
] |
3892 | 7498 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7499 |
|
11494 | 7500 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
3892 | 7501 |
! |
7502 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7503 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7504 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7505 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7506 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7507 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7508 |
files := self currentSelectedObjects. |
11108 | 7509 |
files notEmpty ifTrue:[ |
7510 |
name1 := files first asFilename. |
|
7511 |
name1 asFilename isDirectory ifFalse:[ |
|
7512 |
name1 := name1 directory |
|
7513 |
]. |
|
7514 |
]. |
|
7515 |
||
7516 |
(files size == 2) ifTrue:[ |
|
7517 |
name2 := files second. |
|
7518 |
] ifFalse:[ |
|
7519 |
(files size ~= 1) ifTrue:[ |
|
7520 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
7521 |
^ self. |
|
7522 |
]. |
|
7523 |
name2 := Dialog |
|
7524 |
requestDirectoryName:(resources |
|
7525 |
string:'Recursive compare "%1" with folder:' |
|
7526 |
with:name1 asFilename baseName) |
|
7527 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
7528 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
7529 |
LastFileDiffDirectory := name2. |
|
7530 |
]. |
|
7531 |
name2 := name2 asFilename. |
|
7532 |
||
7533 |
name2 asFilename isDirectory ifFalse:[ |
|
7534 |
name2 := name2 directory |
|
7535 |
]. |
|
7536 |
||
7537 |
self |
|
7538 |
applicationNamed:#FileApplicationNoteBook |
|
7539 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7540 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7541 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7542 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7543 |
|
3892 | 7544 |
openEditor |
7545 |
self openTool:EditTextView |
|
7546 |
! |
|
7547 |
||
4957 | 7548 |
openGV |
7549 |
self openOSCommandWithFiles:'gv' |
|
7550 |
! |
|
7551 |
||
3892 | 7552 |
openHTMLReader |
7553 |
||
7554 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
7555 |
! |
|
7556 |
||
7557 |
openImageEditor |
|
6292 | 7558 |
[ |
7559 |
self loadImageThenDo:[:img | img edit] |
|
7560 |
] fork |
|
3892 | 7561 |
! |
7562 |
||
7563 |
openImageInspector |
|
6292 | 7564 |
[ |
7565 |
self loadImageThenDo:[:img | img inspect] |
|
7566 |
] fork |
|
3892 | 7567 |
! |
7568 |
||
7569 |
openImagePreview |
|
5778 | 7570 |
[ |
7571 |
self |
|
6292 | 7572 |
loadImageThenDo: |
5778 | 7573 |
[:img | |
7574 |
|i top viewer| |
|
7575 |
||
7576 |
top := StandardSystemView new. |
|
7577 |
||
7578 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
7579 |
i := img. |
|
7580 |
top extent:200@200. |
|
7581 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
7582 |
top openAndWait. |
|
7583 |
||
7584 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
7585 |
i := i magnifiedPreservingRatioTo:200@200. |
|
7586 |
]. |
|
7587 |
viewer image:i. |
|
7588 |
]. |
|
3892 | 7589 |
] fork |
7590 |
! |
|
7591 |
||
7592 |
openMP3Player |
|
7593 |
|file| |
|
7594 |
||
3982 | 7595 |
file := self currentSelectedFiles. |
3892 | 7596 |
(file isEmpty) ifTrue:[ |
4414 | 7597 |
^ self. |
3892 | 7598 |
]. |
7599 |
file := file first. |
|
7600 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
7601 |
! |
|
7602 |
||
4957 | 7603 |
openOSCommandWithFiles:command |
7604 |
|files fileNames| |
|
7605 |
||
7606 |
files := self currentSelectedFiles. |
|
7607 |
(files isEmpty) ifTrue:[ |
|
7608 |
^ self. |
|
7609 |
]. |
|
7610 |
||
7611 |
fileNames := files collect:[:each | |
|
7612 |
'"' , each asFilename pathName , '"' |
|
7613 |
]. |
|
7614 |
||
7615 |
[ |
|
7616 |
OperatingSystem |
|
4959 | 7617 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
7618 |
inDirectory:(files first asFilename directory). |
|
4957 | 7619 |
] fork |
7620 |
! |
|
7621 |
||
4820 | 7622 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7623 |
|files fileNames cmd arg| |
4820 | 7624 |
|
7625 |
files := self currentSelectedFiles. |
|
7626 |
(files isEmpty) ifTrue:[ |
|
7627 |
^ self. |
|
7628 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7629 |
cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7630 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7631 |
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
|
7632 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7633 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7634 |
|
4820 | 7635 |
fileNames := |
7636 |
files |
|
7637 |
collect: |
|
7638 |
[:each | |
|
7639 |
'"' , each asFilename pathName , '"' |
|
7640 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7641 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7642 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7643 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7644 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7645 |
]. |
4820 | 7646 |
|
4950 | 7647 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7648 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 7649 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7650 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7651 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 7652 |
! |
7653 |
||
4958 | 7654 |
openRP |
7655 |
self openOSCommandWithFiles:'realplay' |
|
7656 |
! |
|
7657 |
||
8426 | 7658 |
openResourceFileEditor |
7659 |
||
7660 |
self |
|
7661 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
7662 |
with: #openOnFile: |
|
7663 |
! |
|
7664 |
||
3892 | 7665 |
openSlideShow |
5880 | 7666 |
|dir| |
7667 |
||
7668 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7669 |
dir isNil ifTrue:[^ self]. |
|
7670 |
||
3892 | 7671 |
CodingExamples_GUI::SlideShow openIn:dir. |
7672 |
! |
|
7673 |
||
7674 |
openSnapshotImageBrowser |
|
4491 | 7675 |
"Sorry, for now, only the old browser can handle snapShotImages." |
7676 |
||
3892 | 7677 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
7678 |
! |
|
7679 |
||
7680 |
openTerminal |
|
5880 | 7681 |
|dir| |
7682 |
||
7683 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 7684 |
|
5300 | 7685 |
TerminalApplication notNil ifTrue:[ |
7686 |
TerminalApplication openIn:dir |
|
7687 |
] ifFalse:[ |
|
7688 |
VT100TerminalView openShellIn:dir. |
|
7689 |
]. |
|
3892 | 7690 |
! |
7691 |
||
7692 |
openTool:aToolClass |
|
7693 |
"open a tool on the selected file(s)" |
|
7694 |
||
7695 |
^ self openTool:aToolClass ignoreDirectories:true |
|
7696 |
! |
|
7697 |
||
7698 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
7699 |
"open a tool on the selected file(s)" |
|
7700 |
||
7701 |
^ self |
|
4414 | 7702 |
openTool:aToolClass |
7703 |
with:#openOn: |
|
7704 |
ignoreDirectories:ignoreDirs |
|
3892 | 7705 |
! |
7706 |
||
8426 | 7707 |
openTool:aToolClass with:aSelector |
7708 |
"open a tool on the selected file(s)" |
|
7709 |
||
7710 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
7711 |
! |
|
7712 |
||
3892 | 7713 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
7714 |
"open a tool on the selected file(s)" |
|
7715 |
||
8832 | 7716 |
|tool| |
3892 | 7717 |
|
7718 |
aToolClass isNil ifTrue:[ |
|
4414 | 7719 |
Dialog warn:'Sorry, that tool seems to be not available'. |
7720 |
^ nil. |
|
3892 | 7721 |
]. |
8832 | 7722 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
7723 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 7724 |
]. |
7725 |
^ tool |
|
8832 | 7726 |
! |
7727 |
||
7728 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7729 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7730 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7731 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7732 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7733 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7734 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7735 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7736 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7737 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7738 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7739 |
]. |
3892 | 7740 |
! |
7741 |
||
6022 | 7742 |
openWorkspace |
7743 |
self |
|
7744 |
openTool:WorkspaceApplication |
|
7745 |
with:#openOnFile: |
|
7746 |
ignoreDirectories:true |
|
7747 |
! |
|
7748 |
||
4950 | 7749 |
openXV |
4957 | 7750 |
self openOSCommandWithFiles:'xv' |
4950 | 7751 |
! |
7752 |
||
3892 | 7753 |
openZipTool |
5880 | 7754 |
|zipTool| |
3892 | 7755 |
|
7756 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 7757 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 7758 |
]. |
7759 |
! |
|
7760 |
||
7761 |
readAbbrevFile |
|
7762 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
7763 |
||
5880 | 7764 |
|directories| |
3892 | 7765 |
|
3982 | 7766 |
directories := self currentSelectedDirectories. |
3892 | 7767 |
directories isEmpty ifTrue:[^ self]. |
7768 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7769 |
self withActivityIndicationDo:[ |
5880 | 7770 |
directories do:[:eachDir | |
7771 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
7772 |
] |
|
5828 | 7773 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7774 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7775 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 7776 |
! |
7777 |
||
6460 | 7778 |
readAndShowResources |
7779 |
self withActivityIndicationDo:[ |
|
7780 |
| selectedFiles| |
|
7781 |
||
7782 |
selectedFiles:= self currentSelectedFiles. |
|
7783 |
selectedFiles do:[:fileName | |
|
7784 |
resources := ResourcePack fromFile:fileName. |
|
7785 |
resources inspect. |
|
7786 |
]. |
|
7787 |
] |
|
7788 |
! |
|
7789 |
||
3892 | 7790 |
singleFileFileIn:fileName lazy:lazy |
7791 |
"fileIn the selected file(s)" |
|
7792 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7793 |
|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
|
7794 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7795 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7796 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7797 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7798 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7799 |
[ |
4345 | 7800 |
(ObjectFileLoader notNil |
5491 | 7801 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 7802 |
AbortOperationRequest catch:[ |
7803 |
|p| |
|
7804 |
||
7805 |
"/ |
|
7806 |
"/ look if already loaded ... then unload first |
|
7807 |
"/ |
|
7808 |
p := fileName pathName. |
|
7809 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
7810 |
(Dialog confirm:(resources |
|
7811 |
string:'%1 is already loaded; load anyway ?' |
|
7812 |
with:p)) ifFalse:[ |
|
7813 |
^ self |
|
7814 |
]. |
|
7815 |
notifyString := 'unloading old ' , p , ' ...'. |
|
7816 |
Transcript showCR:notifyString. |
|
4523 | 7817 |
self notify:notifyString. |
4345 | 7818 |
ObjectFileLoader unloadObjectFile:p. |
7819 |
]. |
|
7820 |
||
7821 |
notifyString := 'loading ' , p , ' ...'. |
|
7822 |
Transcript showCR:notifyString. |
|
4523 | 7823 |
self notify:notifyString. |
12426 | 7824 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
7825 |
notifyString := 'Error: could not load ' , p. |
|
7826 |
Transcript showCR:notifyString. |
|
7827 |
self notify:notifyString. |
|
7828 |
] ifFalse:[ |
|
7829 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
7830 |
]. |
|
4345 | 7831 |
] |
7832 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
7833 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
7834 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7835 |
aStream := fileName readStreamOrNil. |
4345 | 7836 |
aStream notNil ifTrue:[ |
7837 |
aStream fileInBinary. |
|
7838 |
] |
|
7839 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7840 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 7841 |
"/ loading a java class file |
7842 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 7843 |
JavaClassReader loadFile:fileName |
4345 | 7844 |
] |
7845 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
7846 |
"/ loading a sif (smalltalk interchange format) file |
|
7847 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
7848 |
SmalltalkInterchangeFileManager newForFileIn |
|
7849 |
fileName: fileName pathName; |
|
7850 |
fileIn. |
|
7851 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
7852 |
Parcel isNil ifTrue:[ |
|
7853 |
Dialog warn:'Parcel support not loaded.' |
|
7854 |
] ifFalse:[ |
|
7855 |
Parcel loadParcelFrom: fileName pathName |
|
7856 |
] |
|
7857 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7858 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7859 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7860 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7861 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7862 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7863 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7864 |
Error handle:[:ex | |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7865 |
self errorNotify:'Error on file in: ', ex description. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7866 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7867 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7868 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7869 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7870 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7871 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7872 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7873 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7874 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7875 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7876 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7877 |
] |
4345 | 7878 |
] |
7879 |
] |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7880 |
]]] |
4345 | 7881 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7882 |
] 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
|
7883 |
|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
|
7884 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7885 |
isRedef := false. |
12684 | 7886 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7887 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7888 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7889 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7890 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7891 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7892 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7893 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7894 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7895 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7896 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7897 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7898 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7899 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7900 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7901 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7902 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7903 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7904 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7905 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7906 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7907 |
sender := ex suspendedContext. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7908 |
msg := msg , '\\in ' , sender receiver class name , '>>' , sender sender selector |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7909 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7910 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7911 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7912 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7913 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7914 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7915 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7916 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7917 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7918 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7919 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7920 |
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
|
7921 |
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
|
7922 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7923 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7924 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7925 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7926 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7927 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7928 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7929 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7930 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7931 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7932 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7933 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7934 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7935 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7936 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7937 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7938 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7939 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7940 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7941 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7942 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7943 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7944 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7945 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7946 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7947 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7948 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7949 |
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
|
7950 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7951 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7952 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7953 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7954 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7955 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7956 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7957 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7958 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7959 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
7960 |
(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
|
7961 |
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
|
7962 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7963 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7964 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7965 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7966 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7967 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7968 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7969 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7970 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7971 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7972 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7973 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7974 |
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
|
7975 |
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
|
7976 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7977 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7978 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7979 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7980 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7981 |
] |
7040 | 7982 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7983 |
"Modified: / 22-11-2011 / 13:52:17 / cg" |
4531 | 7984 |
! |
7985 |
||
4558 | 7986 |
splitFile:infile intoPiecesOfSize:kiloBytes |
7987 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
7988 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
7989 |
||
7990 |
bufferSize := 32*1024. |
|
7991 |
||
7992 |
inStream := infile readStream. |
|
7993 |
||
7994 |
bytesPerSplit := kiloBytes * 1024. |
|
7995 |
||
7996 |
remaining := infile fileSize. |
|
7997 |
splitIndex := 1. |
|
7998 |
[remaining > 0] whileTrue:[ |
|
7999 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8000 |
outStream := outFile asFilename writeStream. |
|
8001 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
8002 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
8003 |
buffer := ByteArray new:bufferSize. |
|
8004 |
n := inStream |
|
8005 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
8006 |
into:buffer |
|
8007 |
startingAt:1. |
|
8008 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
8009 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
8010 |
remaining := remaining - n. |
|
8011 |
]. |
|
8012 |
outStream close. |
|
8013 |
splitIndex := splitIndex + 1. |
|
8014 |
]. |
|
8015 |
inStream close. |
|
8016 |
! |
|
8017 |
||
8018 |
splitSelectedFiles |
|
6264 | 8019 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8020 |
|
7560 | 8021 |
selectedFiles := self currentSelectedObjects. |
4558 | 8022 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8023 |
||
6265 | 8024 |
msg := (numFiles > 1) |
8025 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8026 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8027 |
|
6352 | 8028 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8029 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8030 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8031 |
kiloBytes isNil ifTrue:[^ self]. |
8032 |
||
8033 |
selectedFiles do:[:fileName | |
|
8034 |
self notify:('Splitting:', fileName baseName). |
|
8035 |
fileName isDirectory ifFalse:[ |
|
8036 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8037 |
] |
|
8038 |
]. |
|
6190 | 8039 |
self notify:nil. |
6265 | 8040 |
|
7560 | 8041 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8042 |
! |
8043 |
||
4531 | 8044 |
truncateSelectedFilesToZeroSize |
4554 | 8045 |
|selectedFiles numFiles msg| |
4531 | 8046 |
|
7560 | 8047 |
selectedFiles := self currentSelectedObjects. |
4554 | 8048 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8049 |
||
4930 | 8050 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 8051 |
numFiles > 1 ifTrue:[ |
4930 | 8052 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 8053 |
]. |
4531 | 8054 |
|
8055 |
(Dialog |
|
6352 | 8056 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 8057 |
initialAnswer:false |
8058 |
) ifFalse:[ |
|
8059 |
^ self |
|
8060 |
]. |
|
8061 |
||
8062 |
selectedFiles do:[:fileName | |
|
8063 |
|s| |
|
8064 |
||
8065 |
self notify:('Truncating:', fileName baseName). |
|
8066 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8067 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8068 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8069 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8070 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 8071 |
self warn:('Cannot truncate "%1".' bindWith:fileName baseName allBold). |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8072 |
]. |
4531 | 8073 |
] |
8074 |
]. |
|
6190 | 8075 |
self notify:nil. |
7560 | 8076 |
|
8077 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 8078 |
! ! |
8079 |
||
4849 | 8080 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 8081 |
|
8082 |
canCvsAddAndCommit |
|
8083 |
||
3982 | 8084 |
|selectedFiles| |
8085 |
||
8086 |
selectedFiles := self currentSelectedFiles. |
|
8087 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 8088 |
! |
8089 |
||
8090 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
8091 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8092 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8093 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8094 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8095 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8096 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 8097 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8098 |
]. |
3892 | 8099 |
! ! |
8100 |
||
4849 | 8101 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8102 |
|
6521 | 8103 |
anySTFilesOrDirectoriesPresent |
8104 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
8105 |
! |
|
8106 |
||
3892 | 8107 |
anySTFilesPresent |
8108 |
^ self anyFilesPresentWithSuffix:'st' |
|
8109 |
! |
|
8110 |
||
8111 |
canCreateNewProject |
|
8112 |
||
3982 | 8113 |
| selectedFiles | |
3892 | 8114 |
|
8115 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
3982 | 8116 |
selectedFiles := self currentSelectedFiles. |
3892 | 8117 |
^ [ |
4414 | 8118 |
((selectedFiles detect:[:fileName| | suffix| |
8119 |
suffix := fileName suffix asLowercase. |
|
8120 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8121 |
] ifNone:[nil]) notNil) |
|
3982 | 8122 |
] |
3892 | 8123 |
! |
8124 |
||
8125 |
canDoTerminal |
|
8126 |
||
8127 |
^ OperatingSystem isUNIXlike |
|
8128 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8129 |
! |
|
8130 |
||
8131 |
canDoTerminalAndSystemIsDOS |
|
8132 |
||
8133 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8134 |
! |
|
8135 |
||
8136 |
canDoTerminalAndSystemIsUnix |
|
8137 |
||
8138 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8139 |
! |
|
8140 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8141 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8142 |
"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
|
8143 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8144 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8145 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8146 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8147 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8148 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8149 |
|
3892 | 8150 |
canReadAbbrevFile |
8151 |
||
5960 | 8152 |
|currentDirectory| |
3892 | 8153 |
|
8154 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 8155 |
currentDirectory := self currentDirectory. |
8156 |
^ currentDirectory notNil |
|
8157 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 8158 |
! |
8159 |
||
8160 |
canRemoveFromSourcePath |
|
8161 |
||
8162 |
^ false |
|
8163 |
! |
|
8164 |
||
8165 |
hasASN1 |
|
8166 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 8167 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 8168 |
|
8169 |
! |
|
8170 |
||
8171 |
hasASN1AndSelection |
|
8172 |
^ [ self hasSelection value |
|
4414 | 8173 |
and:[self currentSelectedFiles size > 0 |
8174 |
and:[OSI::ASN1Parser notNil |
|
8175 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 8176 |
! |
8177 |
||
8178 |
hasCBrowser |
|
8179 |
^ [ CBrowser::Browser notNil ] |
|
8180 |
! |
|
8181 |
||
8182 |
hasJava |
|
8183 |
||
8184 |
^ [ JavaClassReader notNil |
|
4414 | 8185 |
and:[JavaClassReader isLoaded]] |
3892 | 8186 |
! |
8187 |
||
8188 |
hasJavaAndSelection |
|
8189 |
||
3982 | 8190 |
^ [ self currentSelectedFiles size > 0 |
4414 | 8191 |
and:[JavaClassReader notNil |
8192 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 8193 |
! |
8194 |
||
8195 |
hasMP3Player |
|
8196 |
||
8197 |
^ [ MP3PlayerApplication notNil |
|
4414 | 8198 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 8199 |
! |
8200 |
||
8201 |
hasMP3PlayerAndSelection |
|
8202 |
||
3982 | 8203 |
^ [ self currentSelectedFiles size > 0 |
4414 | 8204 |
and:[ self hasMP3Player value]] |
3892 | 8205 |
! |
8206 |
||
8426 | 8207 |
hasResourceFileSelected |
8208 |
||
8209 |
^ [ |
|
8210 |
|sel| |
|
8211 |
||
8212 |
sel := self currentSelectedFiles. |
|
8213 |
sel notEmptyOrNil ifTrue:[ |
|
8214 |
sel conform:[:fn | fn suffix asLowercase = 'rs']. |
|
8215 |
] ifFalse:[ |
|
8216 |
false |
|
8217 |
] |
|
8218 |
] |
|
8219 |
! |
|
8220 |
||
3892 | 8221 |
hasSlideShow |
8222 |
||
8223 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
8224 |
! |
|
8225 |
||
8226 |
hasSnapshotSelection |
|
8227 |
||
8228 |
^ [ |
|
4414 | 8229 |
| files | |
8426 | 8230 |
|
4414 | 8231 |
files := self currentSelectedFiles. |
8232 |
((files size == 1) |
|
8233 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 8234 |
] |
8235 |
! |
|
8236 |
||
7869 | 8237 |
hasXml |
9206 | 8238 |
^ [ XML::XMLParser notNil ] |
7869 | 8239 |
! |
8240 |
||
8241 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8242 |
"/ 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
|
8243 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 8244 |
|
8426 | 8245 |
^ [ |
8246 |
|sel fileName| |
|
7869 | 8247 |
|
8248 |
sel := self currentSelectedFiles. |
|
8249 |
sel size == 1 ifTrue:[ |
|
8250 |
fileName := sel first. |
|
8251 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8252 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 8253 |
] ifFalse:[ |
8254 |
false |
|
8255 |
] |
|
8256 |
] ifFalse:[ |
|
8257 |
false |
|
8258 |
] |
|
8259 |
] |
|
8260 |
! |
|
8261 |
||
3892 | 8262 |
hasZipFileSelected |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8263 |
|sel fileName suff| |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8264 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8265 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8266 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8267 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8268 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8269 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8270 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8271 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8272 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8273 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8274 |
^ fileName mimeTypeOfContents = 'application/x-zip-compressed' |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8275 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8276 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8277 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8278 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8279 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8280 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8281 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8282 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 8283 |
! |
8284 |
||
8285 |
javaSupportLoaded |
|
8286 |
||
8287 |
^ false |
|
8288 |
! ! |
|
8289 |
||
3906 | 8290 |
!AbstractFileBrowser methodsFor:'presentation'! |
8291 |
||
8292 |
getModeString:modeBits |
|
8293 |
"convert file-mode bits into a more user-friendly string. |
|
8294 |
This is wrong here - should be moved into OperatingSystem." |
|
8295 |
||
8296 |
^ self getModeString:modeBits |
|
4414 | 8297 |
with:#( 'owner:' $r $w $x |
8298 |
' group:' $r $w $x |
|
8299 |
' others:' $r $w $x ) |
|
3906 | 8300 |
! |
8301 |
||
8302 |
getModeString:modeBits with:texts |
|
8303 |
"convert file-mode bits into a more user-friendly string. |
|
8304 |
This is wrong here - should be moved into OperatingSystem." |
|
8305 |
||
8306 |
|bits modeString| |
|
8307 |
||
8308 |
bits := modeBits bitAnd:8r777. |
|
8309 |
modeString := ''. |
|
8310 |
||
8311 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
8312 |
with: texts do:[:bitMask :access | |
|
4414 | 8313 |
|ch| |
8314 |
||
8315 |
bitMask isNil ifTrue:[ |
|
8316 |
modeString := modeString , access |
|
8317 |
] ifFalse:[ |
|
8318 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
8319 |
ch := $- |
|
8320 |
] ifFalse:[ |
|
8321 |
ch := access |
|
8322 |
]. |
|
8323 |
modeString := modeString copyWith:ch |
|
8324 |
] |
|
3906 | 8325 |
]. |
8326 |
^ modeString |
|
8327 |
! ! |
|
8328 |
||
5880 | 8329 |
!AbstractFileBrowser methodsFor:'private'! |
8330 |
||
8331 |
theSingleSelectedDirectoryOrHomeDir |
|
8332 |
|dir| |
|
8333 |
||
5888 | 8334 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 8335 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
8336 |
^ dir. |
|
8337 |
! |
|
8338 |
||
8339 |
theSingleSelectedDirectoryOrNil |
|
8340 |
|dirs| |
|
8341 |
||
8342 |
dirs := self currentSelectedDirectories. |
|
8343 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
8344 |
^ dirs anElement. |
|
8345 |
! ! |
|
8346 |
||
3892 | 8347 |
!AbstractFileBrowser methodsFor:'queries'! |
8348 |
||
8256 | 8349 |
cBrowserLoaded |
8350 |
^ CBrowser::Browser notNil |
|
8351 |
! |
|
8352 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8353 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8354 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8355 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8356 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8357 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8358 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8359 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8360 |
"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
|
8361 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8362 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8363 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8364 |
|
3906 | 8365 |
getFileInfoStringForFirstSelectedFile:longInfo |
8366 |
"get stat info on selected file - return a string which can be |
|
8367 |
shown in a box" |
|
8368 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
8369 |
|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
|
8370 |
sizeString fileSize tAccess tModification buffer| |
3906 | 8371 |
|
7560 | 8372 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8373 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 8374 |
filename := selFiles first. |
8375 |
||
8364 | 8376 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8377 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8378 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8379 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8380 |
]. |
8364 | 8381 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
8382 |
buffer := Text writeStream. |
4765 | 8383 |
|
8384 |
buffer |
|
8385 |
nextPutAll:'filename: '; |
|
8386 |
nextPutLine:filename asString. |
|
8387 |
||
8364 | 8388 |
OperatingSystem isMSDOSlike ifTrue: [ |
8389 |
(info alternativeName notNil |
|
8390 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
8391 |
buffer nextPutAll:'shortname: '. |
|
8392 |
buffer nextPutLine:info alternativeName. |
|
8393 |
] |
|
8394 |
]. |
|
8395 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8396 |
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
|
8397 |
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
|
8398 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8399 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8400 |
]. |
4765 | 8401 |
buffer |
8402 |
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
|
8403 |
nextPutLine:(info path ? '???'). |
3906 | 8404 |
] 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
|
8405 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8406 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8407 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8408 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8409 |
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
|
8410 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8411 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8412 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8413 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8414 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8415 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8416 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8417 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8418 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8419 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8420 |
fileSize > 1024 ifTrue:[ |
8172 | 8421 |
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
|
8422 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8423 |
]. |
4765 | 8424 |
buffer nextPutLine:sizeString. |
3906 | 8425 |
|
8426 |
modeBits := info mode. |
|
8427 |
modeString := self getModeString:modeBits. |
|
4765 | 8428 |
|
8429 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 8430 |
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
|
8431 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 8432 |
]. |
4765 | 8433 |
buffer |
8434 |
cr; |
|
8435 |
nextPutAll:'owner: '; |
|
8436 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
8437 |
||
3906 | 8438 |
longInfo ifTrue:[ |
4765 | 8439 |
buffer |
8440 |
nextPutAll:'group: '; |
|
8441 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
8442 |
||
8443 |
tAccess := info accessTime. |
|
8444 |
buffer |
|
8445 |
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
|
8446 |
nextPutAll:tAccess asDate printString; |
4765 | 8447 |
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
|
8448 |
nextPutLine:tAccess asTime printString. |
4765 | 8449 |
|
8450 |
tModification := info modificationTime. |
|
8451 |
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
|
8452 |
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
|
8453 |
nextPutAll:tModification asDate printString; |
4765 | 8454 |
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
|
8455 |
nextPutLine:tModification asTime printString. |
3906 | 8456 |
]. |
4765 | 8457 |
^ buffer contents |
7560 | 8458 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
8459 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 8460 |
! |
8461 |
||
8510 | 8462 |
hasImageColorHistogram |
8463 |
^ ImageColorHistogram notNil |
|
8464 |
! |
|
8465 |
||
10258 | 8466 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
8467 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 8468 |
|
8469 |
"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
|
8470 |
"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
|
8471 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 8472 |
! |
8473 |
||
3892 | 8474 |
initialCommandFor:fileName into:aBox |
8475 |
"set a useful initial command for execute box." |
|
8476 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
8477 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 8478 |
! |
8479 |
||
8480 |
isAbstractFileBrowser |
|
8481 |
||
8482 |
^ true |
|
8483 |
! |
|
8484 |
||
8485 |
systemIsDOS |
|
8486 |
||
8487 |
^ OperatingSystem isMSDOSlike |
|
8488 |
! |
|
8489 |
||
12473 | 8490 |
systemIsOSX |
8491 |
||
8492 |
^ OperatingSystem isOSXlike |
|
8493 |
! |
|
8494 |
||
3892 | 8495 |
systemIsUnix |
8496 |
^ OperatingSystem isUNIXlike |
|
8497 |
! ! |
|
8498 |
||
8499 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
8500 |
||
8501 |
allItemsOfCurrentDirectory |
|
5009 | 8502 |
self |
4774 | 8503 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 8504 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
8505 |
||
8506 |
^ nil |
|
3892 | 8507 |
! |
8508 |
||
8509 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 8510 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8511 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
8512 |
(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
|
8513 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 8514 |
]. |
8515 |
^ false. |
|
8516 |
! |
|
8517 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8518 |
commonPrefixOfSelectedFiles |
4773 | 8519 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8520 |
|
7560 | 8521 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8522 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8523 |
|
4772 | 8524 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 8525 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8526 |
stringCol from:2 do:[:el| |
4773 | 8527 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8528 |
]. |
4773 | 8529 |
^ firstPre asFilename |
7560 | 8530 |
|
8531 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8532 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8533 |
|
12481 | 8534 |
compressTabsOnSave |
8535 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
8536 |
when saving. |
|
8537 |
Default is true" |
|
8538 |
||
8539 |
^ true |
|
8540 |
! |
|
8541 |
||
3892 | 8542 |
currentFilesAreInSameDirectory |
8543 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8544 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 8545 |
! |
8546 |
||
8547 |
currentFilesHasDirectories |
|
8548 |
||
6725 | 8549 |
^ self currentSelectedDirectories notEmpty. |
3892 | 8550 |
! |
8551 |
||
3982 | 8552 |
directoriesForFiles:aFileCol |
11743 | 8553 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 8554 |
! |
8555 |
||
3892 | 8556 |
fileListIsEmpty |
5009 | 8557 |
self |
8558 |
applicationNamed:#DirectoryContentsBrowser |
|
8559 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
8560 |
||
8561 |
^ nil. |
|
3892 | 8562 |
! |
8563 |
||
8564 |
fileListIsNotEmpty |
|
8565 |
||
8566 |
^ self fileListIsEmpty not. |
|
8567 |
! |
|
8568 |
||
8569 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 8570 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 8571 |
|
8572 |
| file1 file2 | |
|
8573 |
||
6284 | 8574 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 8575 |
file1 := aFilename1 asFilename. |
8576 |
file2 := aFilename2 asFilename. |
|
6284 | 8577 |
|
3892 | 8578 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 8579 |
|
3892 | 8580 |
((file1 isDirectory) |
8581 |
and:[(file2 isDirectory) |
|
8582 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 8583 |
^ file1 baseName = file2 baseName |
3892 | 8584 |
]. |
3982 | 8585 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 8586 |
! |
8587 |
||
8588 |
getAllFilesAsStringCollection |
|
5009 | 8589 |
self |
8590 |
applicationNamed:#DirectoryContentsBrowser |
|
8591 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
8592 |
||
8593 |
^ nil |
|
3892 | 8594 |
! |
8595 |
||
8596 |
getBestDirectory |
|
8597 |
||
8598 |
|selFiles stringCol firstPre| |
|
8599 |
||
6725 | 8600 |
selFiles := self currentSelectedDirectories. |
3892 | 8601 |
selFiles isEmpty ifTrue:[^ nil]. |
8602 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 8603 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 8604 |
firstPre := stringCol at:1. |
8605 |
stringCol from:2 do:[:el| |
|
4414 | 8606 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 8607 |
]. |
8608 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 8609 |
firstPre removeLast. |
3892 | 8610 |
]. |
8611 |
^ firstPre asFilename |
|
8612 |
! |
|
8613 |
||
8614 |
getDirWithoutFileName:aFileName |
|
8615 |
||
8616 |
| dir | |
|
8617 |
aFileName isNil ifTrue:[ |
|
4414 | 8618 |
^ aFileName. |
3892 | 8619 |
]. |
8620 |
dir := aFileName asFilename. |
|
8621 |
dir isDirectory ifFalse:[ |
|
4414 | 8622 |
dir := dir directory. |
3892 | 8623 |
]. |
8624 |
^ dir. |
|
8625 |
! |
|
8626 |
||
8627 |
getInfoItem |
|
8628 |
"get filename of a description-file (.dir.info, README etc.); |
|
8629 |
This file is automatically shown when a directory is enterred. |
|
8630 |
You can add more names below if you like." |
|
8631 |
||
5880 | 8632 |
|dir| |
8633 |
||
8634 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8635 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 8636 |
|
8637 |
#( |
|
8638 |
'.dir.info' |
|
8639 |
'README' |
|
8640 |
'ReadMe' |
|
8641 |
'Readme' |
|
8642 |
'readme' |
|
8643 |
'read.me' |
|
8644 |
'Read.me' |
|
8645 |
'READ.ME' |
|
8646 |
'README.TXT' |
|
8647 |
'readme.txt' |
|
8648 |
'Readme.txt' |
|
8649 |
'Info.txt' |
|
8650 |
'info.txt' |
|
8651 |
'INFO.TXT' |
|
8652 |
) do:[:f | |
|
5883 | 8653 |
|n| |
4414 | 8654 |
|
5880 | 8655 |
n := dir construct:f. |
4414 | 8656 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
8657 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
8658 |
] |
|
3892 | 8659 |
]. |
8660 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8661 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8662 |
|
12497 | 8663 |
hasPackageDirectorySelected |
8664 |
|dir| |
|
8665 |
||
8666 |
dir := self currentDirectory. |
|
8667 |
^ dir notNil |
|
8668 |
and:[ dir exists |
|
8669 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
8670 |
! |
|
8671 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8672 |
parentDirectoriesOfCurrentFiles |
11743 | 8673 |
^ self currentSelectedObjects |
8674 |
collect:[:file | file directory] as:Set |
|
7560 | 8675 |
|
8676 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 8677 |
! |
8678 |
||
8679 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 8680 |
^ true. "/ the code below is too slow for a menu enabling operation |
8681 |
||
8682 |
"/ |directories| |
|
8683 |
"/ |
|
8684 |
"/ directories := self currentDirectories value. |
|
8685 |
"/ directories do:[:dir| |
|
8686 |
"/ [ |
|
8687 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
8688 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
8689 |
"/ ] |
|
8690 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
8691 |
"/ ]. |
|
8692 |
"/ ^ false. |
|
6586 | 8693 |
! |
8694 |
||
8695 |
recursiveAnySTFilesPresent |
|
8696 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 8697 |
! ! |
8698 |
||
8699 |
!AbstractFileBrowser methodsFor:'selection'! |
|
8700 |
||
8701 |
currentSelectedDirectories |
|
6725 | 8702 |
^ self currentDirectoriesValue. |
3982 | 8703 |
! |
8704 |
||
8705 |
currentSelectedFiles |
|
7560 | 8706 |
^ self currentSelectedObjects select:[:file | file isDirectory not]. |
8707 |
||
8708 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 8709 |
! |
8710 |
||
6460 | 8711 |
currentSelectedObjects |
8712 |
^ self currentFileNameHolder value |
|
8713 |
! |
|
8714 |
||
3982 | 8715 |
firstSelectedFile |
7560 | 8716 |
^ self currentSelectedObjects |
12102 | 8717 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8718 |
ifNone:[]. |
7560 | 8719 |
|
8720 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 8721 |
! |
8722 |
||
9490 | 8723 |
hasOnlyDirectoriesSelected |
8724 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
8725 |
||
8726 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
8727 |
! |
|
8728 |
||
4414 | 8729 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8730 |
|
7560 | 8731 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
8732 |
||
8733 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 8734 |
! |
8735 |
||
9490 | 8736 |
hasTwoDirectoriesSelected |
8737 |
||
8738 |
^ self currentSelectedObjects size == 2 |
|
8739 |
and:[self hasOnlyDirectoriesSelected] |
|
8740 |
||
8741 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
8742 |
! |
|
8743 |
||
4414 | 8744 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8745 |
|
7560 | 8746 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8747 |
and:[self hasOnlyFilesSelected] |
7560 | 8748 |
|
8749 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
3892 | 8750 |
! ! |
8751 |
||
3964 | 8752 |
!AbstractFileBrowser methodsFor:'sorting'! |
8753 |
||
3989 | 8754 |
currentSortOrder |
4027 | 8755 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 8756 |
! |
8757 |
||
8758 |
sortBlockHolder |
|
8759 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 8760 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8761 |
selector:#fileName |
|
8762 |
sortCaseless:self sortCaseless value |
|
8763 |
sortReverse:false) asValue. |
|
3989 | 8764 |
]. |
8765 |
! |
|
8766 |
||
8767 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8768 |
|v| |
4027 | 8769 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8770 |
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
|
8771 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8772 |
^ v. |
3989 | 8773 |
! |
8774 |
||
8775 |
sortCaseless |
|
4201 | 8776 |
" aspect for sort caseless " |
3989 | 8777 |
|
8778 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
9393 | 8779 |
(Filename isCaseSensitive not) asValue. |
8780 |
] |
|
3989 | 8781 |
! |
8782 |
||
4074 | 8783 |
sortDirectoriesBeforeFiles |
8784 |
||
4201 | 8785 |
" aspect for sort directories always before files" |
4074 | 8786 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
8787 |
! |
|
8788 |
||
3989 | 8789 |
sortFileListsBy:instanceName |
8790 |
||
8791 |
self sortFileListsBy:instanceName withReverse:true |
|
8792 |
! |
|
8793 |
||
8794 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
8795 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 8796 |
|
8797 |
aSymbol := instanceName asSymbol. |
|
4027 | 8798 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 8799 |
sortCaselessLocal := self sortCaseless value. |
4027 | 8800 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8801 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8802 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 8803 |
currentSortOrder at:#column put:aSymbol. |
8804 |
currentSortOrder at:#reverse put:false. |
|
8805 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 8806 |
] ifFalse:[ |
4343 | 8807 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
8808 |
"/ sort caseless changed |
|
8809 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
8810 |
] ifFalse:[ |
|
8811 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
8812 |
"/ same column like before - change sort order ifReverse is true |
|
8813 |
aBoolean ifTrue:[ |
|
8814 |
isReverse := currentSortOrder at:#reverse. |
|
8815 |
currentSortOrder at:#reverse put:(isReverse not). |
|
8816 |
]. |
|
8817 |
] ifFalse:[ |
|
8818 |
"/ another column - remark column |
|
8819 |
currentSortOrder at:#column put:aSymbol. |
|
8820 |
] |
|
8821 |
] |
|
3964 | 8822 |
]. |
4027 | 8823 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8824 |
|
5383 | 8825 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8826 |
selector:instanceName |
|
8827 |
sortCaseless:sortCaselessLocal |
|
8828 |
sortReverse:(currentSortOrder at:#reverse). |
|
8829 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8830 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8831 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 8832 |
! ! |
8833 |
||
3892 | 8834 |
!AbstractFileBrowser methodsFor:'startup & release'! |
8835 |
||
8836 |
makeDependent |
|
4074 | 8837 |
self filterModel addDependent:self. |
4004 | 8838 |
self currentFileNameHolder addDependent:self. |
4074 | 8839 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 8840 |
self sortCaseless addDependent:self. |
4011 | 8841 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
8842 |
self rootHolder addDependent:self. |
3892 | 8843 |
! |
8844 |
||
8845 |
masterApplication:anApplication |
|
8846 |
||
8847 |
masterApplication isNil ifTrue:[ |
|
4414 | 8848 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
8849 |
aspects := anApplication aspects |
|
8850 |
] ifFalse:[ |
|
8851 |
aspects isNil ifTrue:[ |
|
8852 |
aspects := IdentityDictionary new. |
|
8853 |
aspects at:#applications put:(IdentityDictionary new). |
|
8854 |
] |
|
8855 |
]. |
|
8856 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8857 |
"/ self makeDependent. |
3892 | 8858 |
]. |
3952 | 8859 |
^ super masterApplication:anApplication. |
3892 | 8860 |
! |
8861 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8862 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8863 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8864 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8865 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8866 |
|
3892 | 8867 |
postOpenWith:aBuilder |
8868 |
||
8869 |
super postOpenWith:aBuilder. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8870 |
self windowGroup showWaitCursorWhenBusyForMillis:100. |
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8871 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8872 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 8873 |
! ! |
8874 |
||
8875 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
8876 |
||
8877 |
files |
|
8878 |
"return the value of the instance variable 'files' (automatically generated)" |
|
8879 |
||
8880 |
^ files |
|
8881 |
! |
|
8882 |
||
8883 |
files:something |
|
8884 |
"set the value of the instance variable 'files' (automatically generated)" |
|
8885 |
||
8886 |
files := something. |
|
8887 |
! |
|
8888 |
||
8889 |
method |
|
8890 |
"return the value of the instance variable 'method' (automatically generated)" |
|
8891 |
||
8892 |
^ method |
|
8893 |
! |
|
8894 |
||
8895 |
method:something |
|
8896 |
"set the value of the instance variable 'method' (automatically generated)" |
|
8897 |
||
8898 |
method := something. |
|
8899 |
! ! |
|
8900 |
||
8901 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
8902 |
||
8903 |
locked |
|
8904 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
8905 |
||
8906 |
locked isNil ifTrue:[ |
|
4414 | 8907 |
locked := false. |
3892 | 8908 |
]. |
8909 |
^ locked |
|
8910 |
! ! |
|
8911 |
||
8912 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
8913 |
||
8914 |
doIfUnLocked:aBlock |
|
8915 |
||
8916 |
self locked ifFalse:[ |
|
4414 | 8917 |
aBlock value. |
3892 | 8918 |
]. |
8919 |
! |
|
8920 |
||
8921 |
doLocked:aBlock |
|
8922 |
||
8923 |
locked := true. |
|
4004 | 8924 |
aBlock ensure:[ |
4414 | 8925 |
locked := false. |
4004 | 8926 |
] |
3892 | 8927 |
! ! |
8928 |
||
3952 | 8929 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
8930 |
||
6369 | 8931 |
defaultHistorySize |
8932 |
^ 50 |
|
3892 | 8933 |
! ! |
8934 |
||
6371 | 8935 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 8936 |
|
8937 |
new |
|
6371 | 8938 |
^ (super new) initializeHistory. |
6369 | 8939 |
! ! |
8940 |
||
8941 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
8942 |
||
8943 |
historySize |
|
8944 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
8945 |
^ historySize |
|
8946 |
! |
|
8947 |
||
8948 |
historySize:aNumber |
|
8949 |
historySize := aNumber |
|
4032 | 8950 |
! ! |
8951 |
||
3892 | 8952 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
8953 |
||
3952 | 8954 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8955 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8956 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8957 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8958 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8959 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
8960 |
pathToAdd := pathToAdd copyButLast:(Filename separator asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8961 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8962 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8963 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8964 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8965 |
self backForwardListAdd:pathToAdd. |
3952 | 8966 |
item isNil ifTrue:[ |
4347 | 8967 |
" not already in history" |
6369 | 8968 |
self size >= self historySize ifTrue:[ |
4347 | 8969 |
self removeLast. |
8970 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8971 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 8972 |
] ifFalse:[ |
4347 | 8973 |
"already been there before; move the entry to |
8974 |
the beginning, so it will fall out later." |
|
8975 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8976 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8977 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8978 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8979 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 8980 |
! |
8981 |
||
4347 | 8982 |
backForwardListAdd:aPath |
8983 |
|pathIndex| |
|
8984 |
||
8985 |
pathIndex := backForwardList indexOf:aPath. |
|
8986 |
pathIndex == 0 ifTrue:[ |
|
8987 |
" a new path comes in remove forward paths " |
|
8988 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
8989 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
8990 |
]. |
|
8991 |
] ifFalse:[ |
|
8992 |
backForwardList remove:aPath. |
|
8993 |
pathIndex <= backForwardIndex ifTrue:[ |
|
8994 |
backForwardIndex := backForwardIndex - 1. |
|
8995 |
] |
|
4022 | 8996 |
]. |
4347 | 8997 |
backForwardList add:aPath afterIndex:backForwardIndex. |
8998 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 8999 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 9000 |
backForwardList removeFirst. |
9001 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 9002 |
]. |
4347 | 9003 |
! |
9004 |
||
9005 |
goBackward |
|
4288 | 9006 |
"return the first path of the backward list; |
9007 |
remove it from the back list and add it ti the forward list." |
|
4022 | 9008 |
|
4347 | 9009 |
|retPath| |
9010 |
||
9011 |
self canBackward ifTrue:[ |
|
9012 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
9013 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 9014 |
]. |
4022 | 9015 |
^ retPath. |
9016 |
! |
|
9017 |
||
9018 |
goForward |
|
4288 | 9019 |
"return the first path of the forward list; |
9020 |
remove it from the list." |
|
4022 | 9021 |
|
4347 | 9022 |
|retPath| |
9023 |
||
9024 |
self canForward ifTrue:[ |
|
9025 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9026 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9027 |
]. |
4022 | 9028 |
^ retPath. |
9029 |
! |
|
9030 |
||
9031 |
resetForwardBackward |
|
9032 |
||
4347 | 9033 |
self initialize |
4022 | 9034 |
! |
9035 |
||
9036 |
setPosition:aPosition for:aPath |
|
9037 |
||
9038 |
self do:[:item| |
|
4414 | 9039 |
item path = aPath ifTrue:[ |
9040 |
item position:aPosition. |
|
9041 |
] |
|
4022 | 9042 |
]. |
3892 | 9043 |
! ! |
9044 |
||
4870 | 9045 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9046 |
|
6371 | 9047 |
initializeHistory |
4032 | 9048 |
|
4347 | 9049 |
backForwardList := OrderedCollection new. |
9050 |
self reverseDo:[:el| |
|
9051 |
backForwardList add:el path. |
|
9052 |
]. |
|
9053 |
backForwardIndex := backForwardList size. |
|
4032 | 9054 |
! ! |
9055 |
||
3892 | 9056 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9057 |
||
4288 | 9058 |
canBackward |
4347 | 9059 |
|
9060 |
^ backForwardIndex > 1 |
|
4288 | 9061 |
! |
9062 |
||
3892 | 9063 |
canForward |
4347 | 9064 |
|
9065 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9066 |
! |
|
9067 |
||
9068 |
getBackCollection |
|
9069 |
||
9070 |
| backCol | |
|
9071 |
||
9072 |
backCol := OrderedCollection new. |
|
9073 |
self canBackward ifTrue:[ |
|
9074 |
| tmpCol | |
|
9075 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9076 |
tmpCol reverseDo:[ :el| |
|
9077 |
backCol add:el. |
|
9078 |
] |
|
9079 |
]. |
|
9080 |
^ backCol |
|
3952 | 9081 |
! |
9082 |
||
9083 |
getForwardCollection |
|
9084 |
||
4347 | 9085 |
| forwCol | |
9086 |
||
9087 |
forwCol := OrderedCollection new. |
|
9088 |
self canForward ifTrue:[ |
|
9089 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9090 |
]. |
|
9091 |
^ forwCol |
|
3952 | 9092 |
! |
9093 |
||
9094 |
getItemFor:aPath |
|
6627 | 9095 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9096 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9097 |
"/ ^ nil. |
|
3952 | 9098 |
! |
9099 |
||
9100 |
getPositionFor:aPath |
|
9101 |
||
9102 |
|item| |
|
9103 |
||
9104 |
item := self getItemFor:aPath. |
|
9105 |
||
9106 |
item notNil ifTrue:[ |
|
4414 | 9107 |
^ item position. |
3952 | 9108 |
]. |
9109 |
^ nil |
|
9110 |
! |
|
9111 |
||
9112 |
includesPath:aPath |
|
6627 | 9113 |
^ self contains:[:item | item path = aPath]. |
9114 |
||
9115 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
9116 |
"/ ^ false. |
|
4347 | 9117 |
! |
9118 |
||
9119 |
nextBackwardItem |
|
9120 |
"return the first path of the backward list" |
|
9121 |
||
9122 |
|retPath| |
|
9123 |
||
9124 |
self canBackward ifTrue:[ |
|
9125 |
retPath := backForwardList at:backForwardIndex. |
|
9126 |
]. |
|
9127 |
^ retPath. |
|
9128 |
! |
|
9129 |
||
9130 |
nextForwardItem |
|
9131 |
"return the first path of the forward list" |
|
9132 |
||
9133 |
|retPath| |
|
9134 |
||
9135 |
self canForward ifTrue:[ |
|
9136 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9137 |
]. |
|
9138 |
^ retPath. |
|
3952 | 9139 |
! ! |
9140 |
||
9141 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
9142 |
||
9143 |
path:aPath |
|
9144 |
||
9145 |
^ self new path:aPath |
|
9146 |
! ! |
|
9147 |
||
9148 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
9149 |
||
6433 | 9150 |
asFilename |
9151 |
^ path asFilename |
|
9152 |
! |
|
9153 |
||
3952 | 9154 |
path |
9155 |
"return the value of the instance variable 'path' (automatically generated)" |
|
9156 |
||
9157 |
^ path |
|
9158 |
! |
|
9159 |
||
9160 |
path:something |
|
9161 |
"set the value of the instance variable 'path' (automatically generated)" |
|
9162 |
||
9163 |
path := something. |
|
9164 |
! |
|
9165 |
||
9166 |
position |
|
9167 |
"return the value of the instance variable 'position' (automatically generated)" |
|
9168 |
||
9169 |
^ position |
|
9170 |
! |
|
9171 |
||
9172 |
position:something |
|
9173 |
"set the value of the instance variable 'position' (automatically generated)" |
|
9174 |
||
9175 |
position := something. |
|
9176 |
! |
|
9177 |
||
9178 |
printString |
|
9179 |
||
9180 |
^ self path asString |
|
3892 | 9181 |
! ! |
9182 |
||
9183 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
9184 |
||
9185 |
withValue:aValue isHolder:aBoolean |
|
9186 |
||
9187 |
| instance | |
|
9188 |
||
9189 |
instance := self basicNew. |
|
9190 |
instance value:aValue. |
|
9191 |
instance isHolder:aBoolean. |
|
9192 |
^ instance |
|
9193 |
! ! |
|
9194 |
||
9195 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
9196 |
||
9197 |
isHolder |
|
9198 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
9199 |
||
9200 |
^ isHolder |
|
9201 |
! |
|
9202 |
||
9203 |
isHolder:something |
|
9204 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
9205 |
||
9206 |
isHolder := something. |
|
9207 |
! |
|
9208 |
||
9209 |
value |
|
9210 |
"return the value of the instance variable 'value' (automatically generated)" |
|
9211 |
||
9212 |
^ value |
|
9213 |
! |
|
9214 |
||
9215 |
value:something |
|
9216 |
"set the value of the instance variable 'value' (automatically generated)" |
|
9217 |
||
9218 |
value := something. |
|
9219 |
! ! |
|
9220 |
||
9221 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
9222 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9223 |
version |
12777 | 9224 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.521 2013-05-28 10:34:21 cg Exp $' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9225 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9226 |
|
8832 | 9227 |
version_CVS |
12777 | 9228 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.521 2013-05-28 10:34:21 cg Exp $' |
3892 | 9229 |
! ! |
12094 | 9230 |