author | Stefan Vogel <sv@exept.de> |
Wed, 04 Dec 2013 15:27:39 +0100 | |
changeset 13704 | 38fe95ecc120 |
parent 13683 | e31bd21c4760 |
child 13714 | d5583c9b5ddb |
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 |
|
13683 | 275 |
|bookmarkStream fileName coder| |
4679 | 276 |
|
277 |
fileName := aFileNameOrString asFilename. |
|
278 |
fileName exists ifTrue:[ |
|
13683 | 279 |
fileName renameTo:(fileName addSuffix:'sav'). |
4679 | 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 |
13011 | 560 |
"/ useCodeView2InTools true -- vanishes |
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 |
||
13089 | 1810 |
|
4930 | 1811 |
" |
1812 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1813 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1814 |
" |
|
1815 |
||
1816 |
<resource: #menu> |
|
1817 |
||
1818 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1819 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1820 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1821 |
(MenuItem |
13089 | 1822 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1823 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1824 |
itemValue: splitSelectedFiles |
13089 | 1825 |
) |
1826 |
(MenuItem |
|
12871 | 1827 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1828 |
label: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1829 |
itemValue: joinSelectedFiles |
13089 | 1830 |
) |
1831 |
(MenuItem |
|
12871 | 1832 |
enabled: hasFileSelection |
7635 | 1833 |
label: 'Copy Corrupted File To...' |
1834 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1835 |
) |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1836 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1837 |
label: '-' |
4930 | 1838 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1839 |
(MenuItem |
13089 | 1840 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1841 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1842 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1843 |
argument: rot13 |
4930 | 1844 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1845 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1846 |
label: '-' |
4930 | 1847 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1848 |
(MenuItem |
12871 | 1849 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1850 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1851 |
itemValue: truncateSelectedFilesToZeroSize |
4930 | 1852 |
) |
9490 | 1853 |
(MenuItem |
1854 |
label: '-' |
|
1855 |
) |
|
1856 |
(MenuItem |
|
13089 | 1857 |
label: 'Load Signature Support Package' |
1858 |
itemValue: loadSignatureSupport |
|
1859 |
isVisible: cannotGenerateSignatureFiles |
|
1860 |
) |
|
1861 |
(MenuItem |
|
1862 |
enabled: canGenerateSignatureFiles |
|
9490 | 1863 |
label: 'Generate Signed Files' |
1864 |
itemValue: generateSignaturesForSelectedFiles |
|
13089 | 1865 |
) |
1866 |
(MenuItem |
|
9490 | 1867 |
enabled: canGenerateSignatureFiles |
1868 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1869 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1870 |
) |
|
9596 | 1871 |
(MenuItem |
1872 |
label: '-' |
|
1873 |
) |
|
1874 |
(MenuItem |
|
12871 | 1875 |
enabled: hasFileSelection |
9596 | 1876 |
label: 'File Differences' |
1877 |
itemValue: openDiffView |
|
1878 |
isVisible: hasTwoFilesSelectedHolder |
|
1879 |
) |
|
1880 |
(MenuItem |
|
12871 | 1881 |
enabled: hasFileSelection |
9596 | 1882 |
label: 'File Differences...' |
1883 |
itemValue: openDiffView |
|
1884 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1885 |
) |
|
1886 |
(MenuItem |
|
1887 |
enabled: hasSelection |
|
1888 |
label: 'Directory Differences' |
|
1889 |
itemValue: openDirectoryDiffView |
|
1890 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
1891 |
) |
|
1892 |
(MenuItem |
|
1893 |
enabled: hasSelection |
|
1894 |
label: 'Directory Differences...' |
|
1895 |
itemValue: openDirectoryDiffView |
|
1896 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
1897 |
) |
|
4930 | 1898 |
) |
1899 |
nil |
|
1900 |
nil |
|
1901 |
) |
|
1902 |
! |
|
1903 |
||
3892 | 1904 |
newMenu |
1905 |
"This resource specification was automatically generated |
|
1906 |
by the MenuEditor of ST/X." |
|
1907 |
||
1908 |
"Do not manually edit this!! If it is corrupted, |
|
1909 |
the MenuEditor may not be able to read the specification." |
|
1910 |
||
1911 |
" |
|
1912 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1913 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1914 |
" |
|
1915 |
||
1916 |
<resource: #menu> |
|
1917 |
||
1918 |
^ |
|
1919 |
#(#Menu |
|
4414 | 1920 |
#( |
1921 |
#(#MenuItem |
|
1922 |
#label: 'Directory...' |
|
1923 |
#translateLabel: true |
|
1924 |
#value: #newDirectory |
|
1925 |
) |
|
1926 |
#(#MenuItem |
|
1927 |
#label: 'File...' |
|
1928 |
#translateLabel: true |
|
1929 |
#value: #newFile |
|
1930 |
) |
|
1931 |
#(#MenuItem |
|
1932 |
#label: 'Hard Link...' |
|
1933 |
#translateLabel: true |
|
1934 |
#isVisible: #systemIsUnix |
|
1935 |
#value: #newHardLink |
|
1936 |
) |
|
1937 |
#(#MenuItem |
|
1938 |
#label: 'Symbolic Link...' |
|
1939 |
#translateLabel: true |
|
1940 |
#isVisible: #systemIsUnix |
|
1941 |
#value: #newSoftLink |
|
1942 |
) |
|
1943 |
) |
|
1944 |
nil |
|
1945 |
nil |
|
3892 | 1946 |
) |
3906 | 1947 |
! |
1948 |
||
4201 | 1949 |
showMenuSpec |
1950 |
"This resource specification was automatically generated |
|
1951 |
by the MenuEditor of ST/X." |
|
1952 |
||
1953 |
"Do not manually edit this!! If it is corrupted, |
|
1954 |
the MenuEditor may not be able to read the specification." |
|
1955 |
||
1956 |
" |
|
1957 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
1958 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
1959 |
" |
|
1960 |
||
1961 |
<resource: #menu> |
|
1962 |
||
1963 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1964 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1965 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1966 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1967 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1968 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1969 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1970 |
indication: showHiddenFiles |
4201 | 1971 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1972 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1973 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1974 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1975 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1976 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1977 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1978 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1979 |
indication: showDirectoryTree |
4201 | 1980 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1981 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1982 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1983 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1984 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1985 |
indication: viewFilesInDirectoryTree |
4201 | 1986 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1987 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1988 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1989 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1990 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1991 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1992 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1993 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1994 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1995 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1996 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1997 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1998 |
indication: viewNoteBookApplicationHolder |
4201 | 1999 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2000 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2001 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2002 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2003 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2004 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2005 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2006 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2007 |
indication: showDiskUsageHolder |
4201 | 2008 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2009 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2010 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2011 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2012 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2013 |
! |
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 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2016 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2017 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2018 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2019 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2020 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2021 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2022 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2023 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2024 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2025 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2026 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2027 |
<resource: #menu> |
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 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2030 |
#(Menu |
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 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2033 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2034 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2035 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2036 |
indication: showHiddenFiles |
4554 | 2037 |
) |
4201 | 2038 |
) |
2039 |
nil |
|
2040 |
nil |
|
2041 |
) |
|
2042 |
! |
|
2043 |
||
3906 | 2044 |
sortMenu |
2045 |
"This resource specification was automatically generated |
|
2046 |
by the MenuEditor of ST/X." |
|
2047 |
||
2048 |
"Do not manually edit this!! If it is corrupted, |
|
2049 |
the MenuEditor may not be able to read the specification." |
|
2050 |
||
2051 |
" |
|
3907 | 2052 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
2053 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 2054 |
" |
2055 |
||
2056 |
<resource: #menu> |
|
2057 |
||
2058 |
^ |
|
2059 |
#(#Menu |
|
4414 | 2060 |
#( |
2061 |
#(#MenuItem |
|
2062 |
#label: 'By Filename' |
|
2063 |
#translateLabel: true |
|
2064 |
#hideMenuOnActivated: false |
|
2065 |
#choice: #sortBlockProperty |
|
2066 |
#choiceValue: #baseName |
|
2067 |
) |
|
2068 |
#(#MenuItem |
|
5122 | 2069 |
#label: 'By Extension' |
4414 | 2070 |
#translateLabel: true |
2071 |
#hideMenuOnActivated: false |
|
2072 |
#choice: #sortBlockProperty |
|
2073 |
#choiceValue: #suffix |
|
2074 |
) |
|
2075 |
#(#MenuItem |
|
2076 |
#label: 'By Permissions' |
|
2077 |
#translateLabel: true |
|
2078 |
#hideMenuOnActivated: false |
|
2079 |
#choice: #sortBlockProperty |
|
2080 |
#choiceValue: #permissions |
|
2081 |
) |
|
2082 |
#(#MenuItem |
|
2083 |
#label: 'By Owner' |
|
2084 |
#translateLabel: true |
|
2085 |
#isVisible: #viewOwner |
|
2086 |
#hideMenuOnActivated: false |
|
2087 |
#choice: #sortBlockProperty |
|
2088 |
#choiceValue: #owner |
|
2089 |
) |
|
2090 |
#(#MenuItem |
|
2091 |
#label: 'By Group' |
|
2092 |
#translateLabel: true |
|
2093 |
#isVisible: #viewOwner |
|
2094 |
#hideMenuOnActivated: false |
|
2095 |
#choice: #sortBlockProperty |
|
2096 |
#choiceValue: #group |
|
2097 |
) |
|
2098 |
#(#MenuItem |
|
2099 |
#label: 'By Size' |
|
2100 |
#translateLabel: true |
|
2101 |
#hideMenuOnActivated: false |
|
2102 |
#choice: #sortBlockProperty |
|
2103 |
#choiceValue: #fileSize |
|
2104 |
) |
|
2105 |
#(#MenuItem |
|
2106 |
#label: 'By Date && Time' |
|
2107 |
#translateLabel: true |
|
2108 |
#hideMenuOnActivated: false |
|
2109 |
#choice: #sortBlockProperty |
|
2110 |
#choiceValue: #modificationTime |
|
2111 |
) |
|
2112 |
#(#MenuItem |
|
2113 |
#label: '-' |
|
2114 |
) |
|
2115 |
#(#MenuItem |
|
2116 |
#label: 'Ignore Case in Sort' |
|
2117 |
#translateLabel: true |
|
2118 |
#hideMenuOnActivated: false |
|
2119 |
#indication: #sortCaseless |
|
2120 |
) |
|
2121 |
#(#MenuItem |
|
2122 |
#label: 'Directories before Files' |
|
2123 |
#translateLabel: true |
|
2124 |
#hideMenuOnActivated: false |
|
2125 |
#indication: #sortDirectoriesBeforeFiles |
|
2126 |
) |
|
2127 |
) |
|
2128 |
nil |
|
2129 |
nil |
|
3906 | 2130 |
) |
4018 | 2131 |
! |
2132 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2133 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2134 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2135 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2136 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2137 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2138 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2139 |
|
11286 | 2140 |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2141 |
" |
4367 | 2142 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
2143 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2144 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2145 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2146 |
<resource: #menu> |
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 |
^ |
5830 | 2149 |
#(Menu |
2150 |
( |
|
2151 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2152 |
label: 'Open (Win32-Shell)' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2153 |
itemValue: doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2154 |
isVisible: systemIsDOS |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2155 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2156 |
(MenuItem |
6528 | 2157 |
label: 'Execute UNIX Command...' |
5830 | 2158 |
itemValue: doExecuteCommand |
6528 | 2159 |
isVisible: systemIsUnix |
2160 |
) |
|
2161 |
(MenuItem |
|
2162 |
label: 'Execute DOS Command...' |
|
2163 |
itemValue: doExecuteCommand |
|
2164 |
isVisible: systemIsDOS |
|
4230 | 2165 |
) |
5830 | 2166 |
(MenuItem |
5880 | 2167 |
label: 'Execute Script...' |
2168 |
itemValue: doExecuteScript |
|
2169 |
) |
|
2170 |
(MenuItem |
|
5830 | 2171 |
enabled: canDoTerminal |
2172 |
label: 'Shell Terminal' |
|
2173 |
itemValue: openTerminal |
|
2174 |
isVisible: canDoTerminalAndSystemIsUnix |
|
11286 | 2175 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal') |
4230 | 2176 |
) |
5830 | 2177 |
(MenuItem |
2178 |
enabled: canDoTerminal |
|
2179 |
label: 'DOS Terminal' |
|
2180 |
itemValue: openTerminal |
|
2181 |
isVisible: canDoTerminalAndSystemIsDOS |
|
11286 | 2182 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal') |
4230 | 2183 |
) |
5830 | 2184 |
(MenuItem |
2185 |
label: '-' |
|
4230 | 2186 |
) |
5830 | 2187 |
(MenuItem |
2188 |
enabled: hasFileSelection |
|
2189 |
label: 'Changes Browser' |
|
2190 |
itemValue: openChangesBrowser |
|
4230 | 2191 |
) |
5830 | 2192 |
(MenuItem |
2193 |
enabled: hasFileSelection |
|
2194 |
label: 'ChangeSet Browser' |
|
2195 |
itemValue: openChangeSetBrowser |
|
6602 | 2196 |
isVisible: changeSetBrowserItemVisible |
4230 | 2197 |
) |
5830 | 2198 |
(MenuItem |
6022 | 2199 |
enabled: hasFileSelection |
2200 |
label: 'Workspace' |
|
2201 |
itemValue: openWorkspace |
|
2202 |
) |
|
2203 |
(MenuItem |
|
2204 |
label: '-' |
|
2205 |
) |
|
2206 |
(MenuItem |
|
5830 | 2207 |
enabled: canReadAbbrevFile |
2208 |
label: 'Install Autoloaded' |
|
2209 |
itemValue: readAbbrevFile |
|
4230 | 2210 |
) |
5830 | 2211 |
(MenuItem |
2212 |
enabled: anySTFilesPresent |
|
6521 | 2213 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 2214 |
itemValue: installAllAsAutoloaded |
4230 | 2215 |
) |
5830 | 2216 |
(MenuItem |
6586 | 2217 |
enabled: recursiveAnySTFilesPresent |
6521 | 2218 |
label: 'Recursive Install All ST-Files as Autoloaded' |
2219 |
itemValue: installAllAsAutoloadedRecursive |
|
2220 |
) |
|
2221 |
(MenuItem |
|
5830 | 2222 |
label: '-' |
4230 | 2223 |
) |
5830 | 2224 |
(MenuItem |
6593 | 2225 |
label: 'File Operations' |
2226 |
submenuChannel: fileOpMenu |
|
2227 |
) |
|
2228 |
(MenuItem |
|
5830 | 2229 |
label: 'File Utilities' |
2230 |
submenu: |
|
2231 |
(Menu |
|
2232 |
( |
|
2233 |
(MenuItem |
|
2234 |
enabled: hasFileSelection |
|
2235 |
label: 'Editor' |
|
2236 |
itemValue: openEditor |
|
4820 | 2237 |
) |
5830 | 2238 |
(MenuItem |
2239 |
enabled: hasFileSelection |
|
2240 |
label: 'HTML Reader' |
|
2241 |
itemValue: openHTMLReader |
|
4820 | 2242 |
) |
5830 | 2243 |
(MenuItem |
8832 | 2244 |
enabled: hasFileSelection |
2245 |
label: 'Web Browser' |
|
2246 |
itemValue: openWebBrowser |
|
2247 |
) |
|
2248 |
(MenuItem |
|
7869 | 2249 |
label: 'XML Inspector' |
9784 | 2250 |
itemValue: inspectXmlFile |
7869 | 2251 |
isVisible: hasXml |
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2252 |
showBusyCursorWhilePerforming: true |
7869 | 2253 |
) |
2254 |
(MenuItem |
|
5830 | 2255 |
enabled: hasFileSelection |
2256 |
label: 'Acroread (PDF Viewer)' |
|
2257 |
itemValue: openPDFViewer |
|
4820 | 2258 |
) |
5830 | 2259 |
(MenuItem |
2260 |
enabled: hasASN1AndSelection |
|
2261 |
label: 'ASN1 Browser' |
|
2262 |
itemValue: openASN1Browser |
|
2263 |
isVisible: hasASN1 |
|
4820 | 2264 |
) |
5830 | 2265 |
(MenuItem |
2266 |
enabled: hasCBrowser |
|
2267 |
label: 'C Browser' |
|
2268 |
itemValue: openCBrowser |
|
2269 |
isVisible: hasCBrowser |
|
4820 | 2270 |
) |
12871 | 2271 |
(MenuItem |
2272 |
enabled: canOpenMonticelloBrowser |
|
12811 | 2273 |
label: 'Monticello Browser' |
2274 |
itemValue: doOpenMonticelloBrowser |
|
2275 |
) |
|
2276 |
(MenuItem |
|
5830 | 2277 |
enabled: hasJavaAndSelection |
2278 |
label: 'Applet Viewer' |
|
2279 |
itemValue: openAppletViewer |
|
2280 |
isVisible: hasJava |
|
4820 | 2281 |
) |
5830 | 2282 |
(MenuItem |
2283 |
enabled: hasMP3PlayerAndSelection |
|
2284 |
label: 'MP3 Player' |
|
2285 |
itemValue: openMP3Player |
|
2286 |
isVisible: hasMP3Player |
|
4820 | 2287 |
) |
5830 | 2288 |
(MenuItem |
2289 |
enabled: hasFileSelection |
|
2290 |
label: 'xv (Image Viewer)' |
|
2291 |
itemValue: openXV |
|
6460 | 2292 |
isVisible: systemIsUnix |
4950 | 2293 |
) |
5830 | 2294 |
(MenuItem |
2295 |
enabled: currentFilesAreInSameDirectory |
|
2296 |
label: 'Slide Show' |
|
2297 |
itemValue: openSlideShow |
|
2298 |
isVisible: hasSlideShow |
|
4820 | 2299 |
) |
5830 | 2300 |
(MenuItem |
2301 |
enabled: hasFileSelection |
|
2302 |
label: 'gv (Postscript Viewer)' |
|
2303 |
itemValue: openGV |
|
6460 | 2304 |
isVisible: systemIsUnix |
2305 |
) |
|
2306 |
(MenuItem |
|
2307 |
enabled: hasMP3PlayerAndSelection |
|
2308 |
label: 'MP3 Player' |
|
2309 |
itemValue: openMP3Player |
|
2310 |
isVisible: hasMP3Player |
|
4957 | 2311 |
) |
5830 | 2312 |
(MenuItem |
2313 |
enabled: hasFileSelection |
|
9509 | 2314 |
label: 'Realplay (avi viewer)' |
5830 | 2315 |
itemValue: openRP |
6460 | 2316 |
isVisible: systemIsUnix |
2317 |
) |
|
2318 |
(MenuItem |
|
2319 |
label: '-' |
|
2320 |
) |
|
2321 |
(MenuItem |
|
2322 |
label: 'Smalltalk' |
|
2323 |
submenu: |
|
2324 |
(Menu |
|
2325 |
( |
|
2326 |
(MenuItem |
|
2327 |
enabled: hasSnapshotSelection |
|
2328 |
label: 'Snapshot Image Browser' |
|
2329 |
itemValue: openSnapshotImageBrowser |
|
2330 |
) |
|
2331 |
(MenuItem |
|
2332 |
enabled: canCreateNewProject |
|
2333 |
label: 'Create Smalltalk Project' |
|
2334 |
itemValue: createProjectAndOpenProjectBrowser |
|
2335 |
) |
|
2336 |
(MenuItem |
|
2337 |
label: '-' |
|
2338 |
) |
|
2339 |
(MenuItem |
|
8426 | 2340 |
enabled: hasResourceFileSelected |
6460 | 2341 |
label: 'Show Contents of Resourcefile' |
2342 |
itemValue: readAndShowResources |
|
2343 |
) |
|
8426 | 2344 |
(MenuItem |
2345 |
enabled: hasResourceFileSelected |
|
2346 |
label: 'Resource File Editor' |
|
2347 |
itemValue: openResourceFileEditor |
|
2348 |
showBusyCursorWhilePerforming: true |
|
2349 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2350 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2351 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2352 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2353 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2354 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2355 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2356 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2357 |
) |
6460 | 2358 |
) |
2359 |
nil |
|
2360 |
nil |
|
2361 |
) |
|
2362 |
) |
|
2363 |
(MenuItem |
|
2364 |
label: 'Image' |
|
2365 |
submenu: |
|
2366 |
(Menu |
|
2367 |
( |
|
2368 |
(MenuItem |
|
2369 |
enabled: hasFileSelection |
|
2370 |
label: 'Image Editor' |
|
2371 |
itemValue: openImageEditor |
|
2372 |
) |
|
2373 |
(MenuItem |
|
2374 |
enabled: hasFileSelection |
|
2375 |
label: 'Image Preview' |
|
2376 |
itemValue: openImagePreview |
|
2377 |
) |
|
2378 |
(MenuItem |
|
2379 |
enabled: hasFileSelection |
|
2380 |
label: 'Image Inspector' |
|
2381 |
itemValue: openImageInspector |
|
2382 |
) |
|
2383 |
(MenuItem |
|
2384 |
label: '-' |
|
2385 |
) |
|
2386 |
(MenuItem |
|
2387 |
enabled: hasFileSelection |
|
2388 |
label: 'Convert to GIF' |
|
2389 |
itemValue: convertImageToGIF |
|
2390 |
) |
|
2391 |
(MenuItem |
|
2392 |
enabled: hasFileSelection |
|
2393 |
label: 'Convert to PNG' |
|
2394 |
itemValue: convertImageToPNG |
|
2395 |
) |
|
2396 |
(MenuItem |
|
2397 |
enabled: hasFileSelection |
|
2398 |
label: 'Convert to XPM' |
|
2399 |
itemValue: convertImageToXPM |
|
2400 |
) |
|
2401 |
(MenuItem |
|
2402 |
enabled: hasFileSelection |
|
2403 |
label: 'Convert to JPG' |
|
2404 |
itemValue: convertImageToJPG |
|
2405 |
) |
|
2406 |
) |
|
2407 |
nil |
|
2408 |
nil |
|
2409 |
) |
|
2410 |
) |
|
2411 |
(MenuItem |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
2412 |
enabled: hasZipFileSelectedHolder |
6460 | 2413 |
label: 'ZipFile Tool' |
2414 |
itemValue: openZipTool |
|
2415 |
) |
|
2416 |
(MenuItem |
|
2417 |
enabled: hasFileSelection |
|
2418 |
label: 'Hex Dump' |
|
2419 |
itemValue: fileHexDump |
|
4958 | 2420 |
) |
4820 | 2421 |
) |
2422 |
nil |
|
2423 |
nil |
|
2424 |
) |
|
4230 | 2425 |
) |
5830 | 2426 |
(MenuItem |
2427 |
label: 'Find' |
|
2428 |
submenu: |
|
2429 |
(Menu |
|
2430 |
( |
|
2431 |
(MenuItem |
|
2432 |
label: 'File...' |
|
2433 |
itemValue: fileFindFile |
|
4367 | 2434 |
) |
5830 | 2435 |
(MenuItem |
10306 | 2436 |
label: 'Same Contents as Selected...' |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2437 |
itemValue: fileFindDuplicateFile |
12871 | 2438 |
enabled: hasFileSelection |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2439 |
) |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2440 |
(MenuItem |
5830 | 2441 |
label: 'Duplicate Files' |
2442 |
itemValue: fileFindDuplicates |
|
5082 | 2443 |
) |
5830 | 2444 |
(MenuItem |
2445 |
enabled: hasSelection |
|
2446 |
label: 'All Duplicate Files (Recursive)' |
|
2447 |
itemValue: fileFindAllDuplicates |
|
4367 | 2448 |
) |
8510 | 2449 |
(MenuItem |
2450 |
label: 'Similar Image Files' |
|
2451 |
itemValue: fileFindSimilarImages |
|
2452 |
isVisible: hasImageColorHistogram |
|
2453 |
) |
|
4367 | 2454 |
) |
2455 |
nil |
|
2456 |
nil |
|
2457 |
) |
|
4230 | 2458 |
) |
2459 |
) |
|
2460 |
nil |
|
2461 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2462 |
) |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2463 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2464 |
|
4018 | 2465 |
viewDetailsMenuSpec |
2466 |
"This resource specification was automatically generated |
|
2467 |
by the MenuEditor of ST/X." |
|
2468 |
||
2469 |
"Do not manually edit this!! If it is corrupted, |
|
2470 |
the MenuEditor may not be able to read the specification." |
|
2471 |
||
2472 |
" |
|
4648 | 2473 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2474 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2475 |
" |
2476 |
||
2477 |
<resource: #menu> |
|
2478 |
||
2479 |
^ |
|
2480 |
#(#Menu |
|
4414 | 2481 |
#( |
2482 |
#(#MenuItem |
|
2483 |
#label: '-' |
|
2484 |
) |
|
2485 |
#(#MenuItem |
|
2486 |
#label: 'Hidden Files' |
|
2487 |
#translateLabel: true |
|
2488 |
#indication: #showHiddenFiles |
|
2489 |
) |
|
2490 |
) |
|
2491 |
nil |
|
2492 |
nil |
|
4018 | 2493 |
) |
3892 | 2494 |
! ! |
2495 |
||
11144 | 2496 |
!AbstractFileBrowser class methodsFor:'menu specs-scm'! |
2497 |
||
2498 |
cvsMenu |
|
2499 |
"This resource specification was automatically generated |
|
2500 |
by the MenuEditor of ST/X." |
|
2501 |
||
2502 |
"Do not manually edit this!! If it is corrupted, |
|
2503 |
the MenuEditor may not be able to read the specification." |
|
2504 |
||
11149 | 2505 |
|
11144 | 2506 |
" |
2507 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
2508 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
2509 |
" |
|
2510 |
||
2511 |
<resource: #menu> |
|
2512 |
||
2513 |
^ |
|
11149 | 2514 |
#(Menu |
2515 |
( |
|
2516 |
(MenuItem |
|
2517 |
label: 'Commit (CVS)...' |
|
2518 |
itemValue: cvsCommit |
|
2519 |
translateLabel: true |
|
2520 |
) |
|
2521 |
(MenuItem |
|
2522 |
enabled: canCvsAddAndCommit |
|
2523 |
label: 'Add && Commit...' |
|
2524 |
itemValue: cvsAddAndCommit |
|
2525 |
translateLabel: true |
|
2526 |
) |
|
2527 |
(MenuItem |
|
2528 |
enabled: canCvsAddAndCommit |
|
2529 |
label: 'Add as Binary && Commit...' |
|
2530 |
itemValue: cvsAddBinaryAndCommit |
|
2531 |
translateLabel: true |
|
2532 |
) |
|
2533 |
(MenuItem |
|
2534 |
label: '-' |
|
2535 |
) |
|
2536 |
(MenuItem |
|
2537 |
enabled: hasSelection |
|
2538 |
label: 'Update selected Files/Directories' |
|
2539 |
itemValue: cvsUpdateSelection |
|
2540 |
translateLabel: true |
|
2541 |
) |
|
2542 |
(MenuItem |
|
2543 |
label: 'Update Directory Local' |
|
2544 |
itemValue: cvsUpdateAll |
|
2545 |
translateLabel: true |
|
2546 |
) |
|
2547 |
(MenuItem |
|
2548 |
label: 'Update Directory Recursive' |
|
2549 |
itemValue: cvsUpdateAllRecursive |
|
2550 |
translateLabel: true |
|
2551 |
) |
|
2552 |
(MenuItem |
|
2553 |
label: '-' |
|
2554 |
) |
|
2555 |
(MenuItem |
|
2556 |
enabled: hasSelection |
|
2557 |
label: 'Tag...' |
|
2558 |
itemValue: cvsTagSelection |
|
2559 |
translateLabel: true |
|
2560 |
) |
|
2561 |
(MenuItem |
|
2562 |
enabled: hasSelection |
|
2563 |
label: 'Revision Log' |
|
2564 |
itemValue: cvsRevisionLog |
|
2565 |
translateLabel: true |
|
2566 |
) |
|
2567 |
(MenuItem |
|
2568 |
enabled: hasSelection |
|
2569 |
label: 'Compare with newest in Repository' |
|
2570 |
itemValue: cvsCompareWithNewest |
|
2571 |
translateLabel: true |
|
2572 |
) |
|
2573 |
(MenuItem |
|
2574 |
label: '-' |
|
2575 |
) |
|
2576 |
(MenuItem |
|
2577 |
enabled: canRemoveCVSContainer |
|
2578 |
label: 'Remove File && CVS Container...' |
|
2579 |
itemValue: cvsRemoveFileAndCVSContainer |
|
2580 |
translateLabel: true |
|
11144 | 2581 |
) |
2582 |
) |
|
2583 |
nil |
|
2584 |
nil |
|
2585 |
) |
|
2586 |
! |
|
2587 |
||
2588 |
mercurialMenu |
|
2589 |
"This resource specification was automatically generated |
|
2590 |
by the MenuEditor of ST/X." |
|
2591 |
||
2592 |
"Do not manually edit this!! If it is corrupted, |
|
2593 |
the MenuEditor may not be able to read the specification." |
|
2594 |
||
2595 |
||
2596 |
" |
|
2597 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu |
|
2598 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp |
|
2599 |
" |
|
2600 |
||
2601 |
<resource: #menu> |
|
2602 |
||
2603 |
^ |
|
2604 |
#(Menu |
|
2605 |
( |
|
2606 |
(MenuItem |
|
2607 |
label: 'Add' |
|
2608 |
itemValue: mercurialAdd |
|
2609 |
translateLabel: true |
|
2610 |
) |
|
2611 |
(MenuItem |
|
2612 |
label: 'Commit Changes' |
|
2613 |
itemValue: mercurialCommit |
|
2614 |
translateLabel: true |
|
2615 |
) |
|
2616 |
(MenuItem |
|
2617 |
label: 'Push...' |
|
2618 |
itemValue: mercurialPush |
|
2619 |
translateLabel: true |
|
2620 |
) |
|
2621 |
(MenuItem |
|
2622 |
label: 'Status' |
|
2623 |
itemValue: mercurialStatus |
|
2624 |
translateLabel: true |
|
2625 |
) |
|
2626 |
(MenuItem |
|
2627 |
label: '-' |
|
2628 |
) |
|
2629 |
(MenuItem |
|
2630 |
label: 'Init' |
|
2631 |
itemValue: mercurialInit |
|
2632 |
translateLabel: true |
|
2633 |
) |
|
2634 |
) |
|
2635 |
nil |
|
2636 |
nil |
|
2637 |
) |
|
2638 |
||
2639 |
"Modified: / 17-01-2012 / 15:57:40 / cg" |
|
2640 |
! |
|
2641 |
||
2642 |
perforceMenu |
|
2643 |
"This resource specification was automatically generated |
|
2644 |
by the MenuEditor of ST/X." |
|
2645 |
||
2646 |
"Do not manually edit this!! If it is corrupted, |
|
2647 |
the MenuEditor may not be able to read the specification." |
|
2648 |
||
2649 |
||
2650 |
" |
|
2651 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu |
|
2652 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp |
|
2653 |
" |
|
2654 |
||
2655 |
<resource: #menu> |
|
2656 |
||
2657 |
^ |
|
2658 |
#(Menu |
|
2659 |
( |
|
2660 |
(MenuItem |
|
2661 |
label: 'Commit' |
|
2662 |
itemValue: perforceCommit |
|
2663 |
translateLabel: true |
|
2664 |
) |
|
2665 |
) |
|
2666 |
nil |
|
2667 |
nil |
|
2668 |
) |
|
2669 |
||
2670 |
"Created: / 15-01-2012 / 13:12:30 / cg" |
|
2671 |
! ! |
|
2672 |
||
3892 | 2673 |
!AbstractFileBrowser class methodsFor:'misc'! |
2674 |
||
2675 |
newLock |
|
2676 |
^ CodeExecutionLock new |
|
2677 |
! ! |
|
2678 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2679 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2680 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2681 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2682 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2683 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2684 |
|
4610 | 2685 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2686 |
||
11262 | 2687 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart |
2688 |
"utility helper: generate a hexDump with addresses" |
|
2689 |
||
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2690 |
|lines nHexLines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2691 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2692 |
"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
|
2693 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2694 |
nHexLines := (data size + 15) // 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2695 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2696 |
lines := VirtualArray new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2697 |
lines setSize:nHexLines + (nHexLines // 16). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2698 |
lines |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2699 |
generator:[:lineNr | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2700 |
|blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2701 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2702 |
blockNr := (lineNr - 1) // 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2703 |
lineNrInBlock := (lineNr - 1) \\ 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2704 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2705 |
lineNrInBlock == 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2706 |
line := '' |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2707 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2708 |
startOffset := ((blockNr * 16) + lineNrInBlock) * 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2709 |
lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2710 |
asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2711 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2712 |
lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2713 |
lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2714 |
1 to:16 do:[:i | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2715 |
i ~~ 1 ifTrue:[ lineStream space ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2716 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2717 |
(startOffset + i) > data size ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2718 |
asciiLineStream nextPut:(Character space). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2719 |
lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2720 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2721 |
byte := data at:startOffset + i. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2722 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2723 |
lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2724 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2725 |
(byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2726 |
asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2727 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2728 |
asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2729 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2730 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2731 |
]. |
12421 | 2732 |
line := (lineStream contents paddedTo:(addrDigits + 1 + (3*16)+ 8)) |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2733 |
, asciiLineStream contents. |
11262 | 2734 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2735 |
line |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2736 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2737 |
^ lines. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2738 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2739 |
"/ |offs |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2740 |
"/ col line lineStream asciiLineStream lines| |
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 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2743 |
"/ offs := virtualStart. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2744 |
"/ lines := StringCollection new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2745 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2746 |
"/ lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2747 |
"/ asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2748 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2749 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2750 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2751 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2752 |
"/ data do:[:byte | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2753 |
"/ lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2754 |
"/ (byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2755 |
"/ asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2756 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2757 |
"/ asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2758 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2759 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2760 |
"/ offs := offs + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2761 |
"/ col := col + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2762 |
"/ col > 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2763 |
"/ lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2764 |
"/ lineStream nextPutAll:asciiLineStream contents. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2765 |
"/ lines add:(lineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2766 |
"/ (offs bitAnd:16rFF) == 0 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2767 |
"/ lines add:nil |
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 reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2770 |
"/ asciiLineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2771 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2772 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2773 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2774 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2775 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2776 |
"/ lineStream space |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2777 |
"/ ] |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2778 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2779 |
"/ line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2780 |
"/ lines add:(line , ' ' , asciiLineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2781 |
"/ ^ lines |
11262 | 2782 |
|
2783 |
"Created: / 13-02-2012 / 15:01:46 / cg" |
|
2784 |
! |
|
2785 |
||
4610 | 2786 |
contentsOfFileAsHexDump:f |
8472 | 2787 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2788 |
! |
|
2789 |
||
2790 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2791 |
|resources fileName stream data offs |
11262 | 2792 |
addrDigits col lines answer sizeLimit showLastPart| |
4610 | 2793 |
|
2794 |
resources := self classResources. |
|
2795 |
||
2796 |
fileName := f baseName. |
|
2797 |
f isDirectory ifTrue:[ |
|
2798 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2799 |
^ nil |
|
2800 |
]. |
|
2801 |
f exists ifFalse:[ |
|
2802 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2803 |
^ nil |
|
2804 |
]. |
|
2805 |
f isReadable ifFalse:[ |
|
2806 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2807 |
^ nil |
|
2808 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2809 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2810 |
limitOrNil notNil ifTrue:[ |
2811 |
sizeLimit := limitOrNil. |
|
2812 |
showLastPart := showLastPartOrNil |
|
2813 |
] ifFalse:[ |
|
2814 |
answer := Dialog |
|
2815 |
confirmWithCancel:(resources |
|
2816 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2817 |
with:(fileName contractTo:40) allBold |
|
2818 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2819 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2820 |
||
2821 |
answer isNil ifTrue:[^ nil]. |
|
2822 |
answer ifTrue:[ |
|
2823 |
sizeLimit := 4 * 1024 * 1024 |
|
2824 |
]. |
|
8436 | 2825 |
]. |
4610 | 2826 |
]. |
2827 |
||
2828 |
stream := f readStream binary. |
|
8436 | 2829 |
sizeLimit notNil ifTrue:[ |
8472 | 2830 |
showLastPart == true ifTrue:[ |
2831 |
stream position:(f fileSize - sizeLimit). |
|
2832 |
]. |
|
8436 | 2833 |
data := stream nextBytes:sizeLimit. |
2834 |
] ifFalse:[ |
|
2835 |
data := stream contents. |
|
2836 |
]. |
|
4610 | 2837 |
stream close. |
2838 |
||
2839 |
col := 1. |
|
2840 |
offs := 0. |
|
2841 |
lines := StringCollection new. |
|
2842 |
||
2843 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2844 |
||
11262 | 2845 |
^ self |
2846 |
contentsOfBytesAsHexDump:data |
|
2847 |
numberOfAddressDigits:addrDigits |
|
2848 |
addressStart:0 |
|
2849 |
||
2850 |
"Modified: / 13-02-2012 / 15:01:19 / cg" |
|
4610 | 2851 |
! ! |
2852 |
||
3892 | 2853 |
!AbstractFileBrowser methodsFor:'actions'! |
2854 |
||
2855 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2856 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2857 |
Then evaluate aBlock passing the command-string as argument." |
2858 |
||
4523 | 2859 |
|box osName commandString| |
3892 | 2860 |
|
2861 |
osName := OperatingSystem platformName. |
|
2862 |
||
2863 |
box := FilenameEnterBox |
|
4414 | 2864 |
title:(resources string:'Execute %1 command:' with:osName) |
2865 |
okText:(resources string:'Execute') |
|
4523 | 2866 |
action:[:cmd | commandString := cmd]. |
3892 | 2867 |
|
2868 |
fileName notNil ifTrue:[ |
|
4414 | 2869 |
self initialCommandFor:fileName into:box. |
3892 | 2870 |
]. |
2871 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2872 |
box show. |
3892 | 2873 |
box destroy. |
2874 |
||
4523 | 2875 |
commandString notNil ifTrue:[ |
2876 |
aBlock value:commandString |
|
2877 |
]. |
|
2878 |
||
3892 | 2879 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2880 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2881 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2882 |
! |
|
2883 |
||
2884 |
changeFileBrowserTitleTo:aString |
|
4774 | 2885 |
self |
2886 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2887 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2888 |
! |
2889 |
||
2890 |
copyFileList |
|
4774 | 2891 |
"copy the fileList to the clipBoard" |
2892 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2893 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2894 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2895 |
fileList := self |
4774 | 2896 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2897 |
ifPresentDo:[:app | app browserFileList]. |
2898 |
||
2899 |
fileList notNil ifTrue:[ |
|
2900 |
self copyFileListToClipBoard:fileList. |
|
2901 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2902 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2903 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2904 |
copyFileListToClipBoard:fileList |
4774 | 2905 |
"copy the itemList to the clipBoard" |
2906 |
||
2907 |
|stream| |
|
2908 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2909 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2910 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2911 |
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
|
2912 |
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
|
2913 |
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
|
2914 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2915 |
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
|
2916 |
(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
|
2917 |
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
|
2918 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2919 |
]. |
3892 | 2920 |
]. |
6034 | 2921 |
self window setClipboardText:stream contents. |
3892 | 2922 |
! |
2923 |
||
2924 |
copySelectedFilenames |
|
4774 | 2925 |
"copy the selected fileNames to the clipBoard" |
2926 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2927 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2928 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2929 |
fileList := self |
4774 | 2930 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2931 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2932 |
fileList notNil ifTrue:[ |
|
2933 |
self copyFileListToClipBoard:fileList. |
|
2934 |
]. |
|
3892 | 2935 |
! |
2936 |
||
10923 | 2937 |
doAddArchiver |
2938 |
|files| |
|
2939 |
||
2940 |
files := self currentSelectedFiles. |
|
2941 |
files size == 1 ifFalse:[ |
|
2942 |
Dialog information:'Select exactly one archive.'. |
|
2943 |
^ self |
|
2944 |
]. |
|
2945 |
||
2946 |
self |
|
2947 |
applicationNamed:#FileApplicationNoteBook |
|
2948 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
2949 |
||
2950 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
2951 |
! |
|
2952 |
||
3892 | 2953 |
doAddTerminal |
5960 | 2954 |
|dir| |
2955 |
||
2956 |
dir := self currentDirectory. |
|
3892 | 2957 |
|
5960 | 2958 |
dir isNil ifTrue:[ |
4414 | 2959 |
dir := Filename homeDirectory |
3892 | 2960 |
]. |
4774 | 2961 |
|
5009 | 2962 |
self |
2963 |
applicationNamed:#FileApplicationNoteBook |
|
2964 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 2965 |
! |
2966 |
||
2967 |
doOpenSearchFile |
|
5961 | 2968 |
|item file| |
2969 |
||
2970 |
file := self firstSelectedFileName. |
|
2971 |
file isNil ifTrue:[ |
|
2972 |
file := Filename homeDirectory asAbsoluteFilename. |
|
2973 |
]. |
|
2974 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 2975 |
self openSearchFileOn:item. |
2976 |
! |
|
2977 |
||
2978 |
doShowFileContents |
|
5009 | 2979 |
self |
2980 |
applicationNamed:#DirectoryContentsBrowser |
|
2981 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
2982 |
||
2983 |
^ nil |
|
3892 | 2984 |
! |
2985 |
||
2986 |
doShowProperties |
|
2987 |
"show long stat (file)-info" |
|
2988 |
||
2989 |
self fileGetInfo:true |
|
2990 |
! |
|
2991 |
||
5528 | 2992 |
fileEncodingDialog |
2993 |
"open a dialog to allow change of the files character encoding. |
|
2994 |
Files are converted to internal encoding when read, and converted back |
|
2995 |
to this encoding when saved. |
|
2996 |
Notice: currently, not too many encodings are supported by the system." |
|
2997 |
||
2998 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
2999 |
||
3000 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
3001 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
3002 |
||
3003 |
bindings := IdentityDictionary new. |
|
3004 |
bindings at:#encodingList put:encodingDescr. |
|
3005 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 3006 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
3007 |
||
5528 | 3008 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
3009 |
ifTrue:[ |
|
3010 |
idx := (bindings at:#selectedEncoding) value. |
|
3011 |
selectedEncoding := encodings at:idx. |
|
3012 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 3013 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 3014 |
]. |
5737 | 3015 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 3016 |
]. |
3017 |
||
3018 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
3019 |
! |
|
3020 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3021 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3022 |
"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
|
3023 |
|
5959 | 3024 |
|currentFileNameHolder currentSel| |
3025 |
||
3026 |
currentFileNameHolder := self currentFileNameHolder. |
|
3027 |
||
3028 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3029 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 3030 |
self withWaitCursorDo:[ |
3031 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
3032 |
] |
|
3033 |
]. |
|
3034 |
||
3035 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 3036 |
! |
3037 |
||
11053 | 3038 |
lineEndConventionDialog |
3039 |
"open a dialog to allow change of the line end conventions |
|
3040 |
(when writing files)" |
|
3041 |
||
3042 |
|bindings| |
|
3043 |
||
3044 |
bindings := IdentityDictionary new. |
|
3045 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
3046 |
||
3047 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
3048 |
ifTrue:[ |
|
3049 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value |
|
3050 |
]. |
|
3051 |
||
3052 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
3053 |
! |
|
3054 |
||
4392 | 3055 |
newTextEditor |
5009 | 3056 |
self |
3057 |
applicationNamed:#FileApplicationNoteBook |
|
3058 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
3059 |
||
3060 |
^ nil. |
|
3061 |
! |
|
3062 |
||
3063 |
openApplByFileItem:anItem |
|
8490 | 3064 |
"/ q: is the following always wanted ? |
9267 | 3065 |
self window sensor shiftDown ifFalse:[ |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3066 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3067 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3068 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3069 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3070 |
"/ ]. |
9267 | 3071 |
|
8490 | 3072 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
3073 |
"/ Error handle:[:ex | |
|
3074 |
"/ ] do:[ |
|
3075 |
"/ OperatingSystem |
|
3076 |
"/ shellExecute:nil |
|
3077 |
"/ lpOperation:'open' |
|
3078 |
"/ lpFile:(anItem fileName pathName) |
|
3079 |
"/ lpParameters:nil |
|
3080 |
"/ lpDirectory:(self directory pathName) |
|
3081 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
3082 |
"/ ^ self. |
|
3083 |
"/ ] |
|
3084 |
"/ ] |
|
9267 | 3085 |
]. |
5306 | 3086 |
^ self |
5009 | 3087 |
applicationNamed:#FileApplicationNoteBook |
5306 | 3088 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3089 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3090 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
3892 | 3091 |
! |
3092 |
||
4392 | 3093 |
openApplForFile:aFilename |
5306 | 3094 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 3095 |
! |
3096 |
||
3892 | 3097 |
openCommandResultApplication |
3098 |
||
5009 | 3099 |
self |
3100 |
applicationNamed:#FileApplicationNoteBook |
|
3101 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
3102 |
||
3103 |
^ nil |
|
3892 | 3104 |
! |
3105 |
||
5010 | 3106 |
openNewTextEditorOn:anItem |
5009 | 3107 |
self |
3108 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3109 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3110 |
|
3111 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3112 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3113 |
|
5010 | 3114 |
openSearchFileOn:anItem |
5009 | 3115 |
self |
3116 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3117 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3118 |
|
3119 |
^ nil. |
|
3892 | 3120 |
! |
3121 |
||
5162 | 3122 |
openTextEditorForFile:aFilename |
3123 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3124 |
! |
|
3125 |
||
5010 | 3126 |
openTextEditorOn:anItem |
5009 | 3127 |
self |
3128 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3129 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3130 |
|
3131 |
^ nil. |
|
3892 | 3132 |
! |
3133 |
||
5010 | 3134 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3135 |
self |
3136 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3137 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3138 |
|
3139 |
^ nil. |
|
4618 | 3140 |
! |
3141 |
||
5959 | 3142 |
setCurrentFileName:aFilename |
3143 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3144 |
! |
|
3145 |
||
3146 |
setCurrentFileNames:aCollectionOfFilenames |
|
3147 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3148 |
! |
|
3149 |
||
11053 | 3150 |
tabStopConversionDialog |
3151 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3152 |
||
3153 |
|bindings| |
|
3154 |
||
3155 |
bindings := IdentityDictionary new. |
|
3156 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3157 |
||
3158 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3159 |
ifTrue:[ |
|
3160 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3161 |
]. |
|
3162 |
||
3163 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3164 |
! |
|
3165 |
||
3892 | 3166 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3167 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3168 |
aColOfFiles notNil ifTrue:[ |
5959 | 3169 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3170 |
]. |
3892 | 3171 |
! |
3172 |
||
3173 |
updateCurrentDirectory |
|
5739 | 3174 |
self updateCurrentDirectory:false |
3175 |
! |
|
3176 |
||
3177 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3178 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3179 |
|
5009 | 3180 |
self |
3181 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3182 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3183 |
self |
3184 |
applicationNamed:#DirectoryTreeBrowser |
|
3185 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3186 |
! |
3187 |
||
5739 | 3188 |
updateCurrentDirectoryWithReread |
3189 |
self updateCurrentDirectory:true |
|
3190 |
! |
|
3191 |
||
4345 | 3192 |
withActivityIndicationDo:aBlock |
3193 |
||
3194 |
self activityVisibilityChannel value:true. |
|
3195 |
[ |
|
9361 | 3196 |
self withWaitCursorDo:[ |
3197 |
aBlock value. |
|
3198 |
] |
|
4345 | 3199 |
] ensure:[ |
3200 |
self activityVisibilityChannel value:false. |
|
3201 |
] |
|
3892 | 3202 |
! ! |
3203 |
||
3204 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3205 |
||
3206 |
addBookmark |
|
3207 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3208 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3209 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3210 |
! |
3211 |
||
3212 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3213 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3214 |
self class addBookmark:path |
3892 | 3215 |
]. |
3216 |
! |
|
3217 |
||
8013 | 3218 |
editBookmarks |
3219 |
||
3220 |
| default selectedDirectories | |
|
3221 |
||
3222 |
selectedDirectories := self currentSelectedDirectories. |
|
3223 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
3224 |
self class editBookmarksWithDefault: default. |
|
3225 |
! |
|
3226 |
||
3892 | 3227 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3228 |
^ self class hasBookmarks |
3892 | 3229 |
! |
3230 |
||
3231 |
hasBookmarksToRemove |
|
3232 |
|bookmarks directories| |
|
3233 |
||
3982 | 3234 |
directories := self currentSelectedDirectories. |
3892 | 3235 |
bookmarks := self class directoryBookmarks. |
3236 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
3237 |
! |
|
3238 |
||
3239 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3240 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3241 |
self class removeBookmark:dir |
3892 | 3242 |
]. |
4679 | 3243 |
! |
3244 |
||
3245 |
saveBookmarks |
|
3246 |
self class saveBookmarks |
|
3892 | 3247 |
! ! |
3248 |
||
3249 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3250 |
||
3251 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3252 |
|cmd suffix cmdHist historySize| |
3892 | 3253 |
|
3254 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3255 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3256 |
cmdHist notNil ifTrue:[ |
3257 |
cmdHist addFirst:aCommandString. |
|
6369 | 3258 |
historySize := self class commandHistorySize. |
3259 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3260 |
cmdHist removeLast |
3261 |
] |
|
3262 |
]. |
|
3263 |
aFilename notNil ifTrue:[ |
|
3264 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3265 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3266 |
DefaultCommandPerSuffix := Dictionary new. |
|
3267 |
]. |
|
3268 |
suffix := aFilename asFilename suffix. |
|
3269 |
suffix notNil ifTrue:[ |
|
3270 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3271 |
] |
|
3272 |
] |
|
3892 | 3273 |
] |
3274 |
! |
|
3275 |
||
3276 |
doBack |
|
6286 | 3277 |
"go backward in the history" |
3892 | 3278 |
|
4022 | 3279 |
| fileName| |
3280 |
||
6369 | 3281 |
fileName := self directoryHistory goBackward. |
3892 | 3282 |
fileName notNil ifTrue:[ |
4347 | 3283 |
self gotoFile:(fileName asFilename). |
3892 | 3284 |
] |
3285 |
! |
|
3286 |
||
3287 |
doForward |
|
6286 | 3288 |
"go forward in the history" |
3892 | 3289 |
|
3964 | 3290 |
| fileName| |
3291 |
||
6369 | 3292 |
fileName := self directoryHistory goForward. |
3892 | 3293 |
fileName notNil ifTrue:[ |
4414 | 3294 |
self gotoFile:(fileName asFilename). |
4022 | 3295 |
] ifFalse:[ |
4414 | 3296 |
self enableForward value:false. |
4022 | 3297 |
|
3298 |
]. |
|
3892 | 3299 |
! ! |
3300 |
||
3301 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3302 |
||
5009 | 3303 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3304 |
|appl| |
|
3305 |
||
3306 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3307 |
appl notNil ifTrue:[ |
|
3308 |
^ aBlock value:appl |
|
3309 |
]. |
|
3310 |
^ nil. |
|
3311 |
! |
|
3312 |
||
4004 | 3313 |
directoryContentsBrowser |
3314 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3315 |
! ! |
3316 |
||
3317 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3318 |
||
3319 |
applications |
|
3320 |
^ aspects at:#applications |
|
3321 |
! |
|
3322 |
||
3323 |
backgroundProcesses |
|
3324 |
||
3325 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3326 |
! |
|
3327 |
||
4230 | 3328 |
canMake |
6095 | 3329 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 3330 |
! |
3331 |
||
3892 | 3332 |
currentDirectories |
6725 | 3333 |
" returns a holder on a Collection of all currently selected directories |
3334 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3335 |
" |
3336 |
||
3337 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3338 |
! |
|
3339 |
||
6725 | 3340 |
currentDirectoriesValue |
3341 |
" returns a Collection of all currently selected directories |
|
3342 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3343 |
" |
|
3344 |
||
3345 |
^ self currentDirectories value |
|
3346 |
! |
|
3347 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3348 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3349 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3350 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3351 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3352 |
|
6725 | 3353 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3354 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3355 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3356 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3357 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3358 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3359 |
|
3892 | 3360 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3361 |
"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
|
3362 |
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
|
3363 |
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
|
3364 |
|
6589 | 3365 |
^ self aspectFor:#currentFileNameHolder |
3366 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3367 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3368 |
|
4692 | 3369 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3370 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3371 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3372 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3373 |
currentSel asValue |
6589 | 3374 |
] |
3375 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3376 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3377 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3378 |
newFilenames := Set new. |
6589 | 3379 |
filenames do:[:eachFilename| |
3380 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3381 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3382 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3383 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3384 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3385 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3386 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3387 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3388 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3389 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3390 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3391 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3392 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3393 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3394 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3395 |
! |
3396 |
||
5528 | 3397 |
defaultFileEncoding |
3398 |
^ #'iso8859-1' "/ #'utf-8' |
|
3399 |
! |
|
3400 |
||
3892 | 3401 |
enableDirectoryUp |
3402 |
||
3403 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
3404 |
! |
|
3405 |
||
6456 | 3406 |
enableGotoDefaultDirectory |
3407 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 3408 |
! |
3409 |
||
8168 | 3410 |
enableGotoDesktop |
3411 |
^ self aspectFor:#enableGotoDesktop ifAbsent:[ true asValue ]. |
|
3412 |
! |
|
3413 |
||
9572 | 3414 |
enableGotoDesktopDirectory |
3415 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ true asValue ]. |
|
3416 |
||
3417 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3418 |
! |
|
3419 |
||
6434 | 3420 |
enableGotoSmalltalkDirectory |
6456 | 3421 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3422 |
! |
3423 |
||
9677 | 3424 |
enableGotoTempDirectory |
3425 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3426 |
||
3427 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3428 |
! |
|
3429 |
||
3892 | 3430 |
enableHome |
3431 |
||
3432 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3433 |
! |
|
3434 |
||
9596 | 3435 |
enableMakeCurrentDirectory |
3436 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3437 |
||
3438 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3439 |
! |
|
3440 |
||
3892 | 3441 |
enableViewNoteBookApplication |
3442 |
||
3443 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3444 |
! |
|
3445 |
||
5528 | 3446 |
fileEncoding |
3447 |
^ self fileEncodingHolder value |
|
3448 |
! |
|
3449 |
||
3450 |
fileEncoding:newEncoding |
|
5533 | 3451 |
self fileEncodingHolder value:newEncoding. |
3452 |
||
3453 |
self |
|
3454 |
applicationNamed:#FileApplicationNoteBook |
|
3455 |
ifPresentDo:[:nb | |
|
3456 |
|appl| |
|
3457 |
||
3458 |
appl := nb selectedApplication. |
|
5535 | 3459 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3460 |
appl fileEncoding:newEncoding |
3461 |
] |
|
3462 |
]. |
|
5528 | 3463 |
! |
3464 |
||
5737 | 3465 |
fileEncodingHolder |
3466 |
^ self |
|
3467 |
aspectFor:#fileEncodingHolder |
|
3468 |
ifAbsent:[ |
|
3469 |
self |
|
3470 |
applicationNamed:#FileApplicationNoteBook |
|
3471 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3472 |
] |
|
3473 |
! |
|
3474 |
||
5961 | 3475 |
firstSelectedFileName |
3476 |
|files| |
|
3477 |
||
7560 | 3478 |
files := self currentSelectedObjects. |
5961 | 3479 |
files notEmpty ifTrue:[ |
3480 |
^ files first |
|
3481 |
]. |
|
3482 |
^ nil |
|
7560 | 3483 |
|
3484 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3485 |
! |
3486 |
||
6456 | 3487 |
gotoDefaultDirectoryIsVisible |
9596 | 3488 |
^ true. |
3489 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3490 |
||
3491 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3492 |
! |
3493 |
||
9572 | 3494 |
gotoDesktopDirectoryIsVisible |
3495 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3496 |
||
3497 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3498 |
||
3499 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3500 |
! |
|
3501 |
||
4618 | 3502 |
hasFileSelection |
3503 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3504 |
! |
|
3505 |
||
9490 | 3506 |
hasNotTwoDirectoriesSelectedHolder |
3507 |
^ self |
|
3508 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3509 |
ifAbsent:[ |
|
3510 |
BlockValue |
|
3511 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3512 |
argument:self currentFileNameHolder |
|
3513 |
]. |
|
3514 |
||
3515 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
3516 |
! |
|
3517 |
||
5830 | 3518 |
hasNotTwoFilesSelectedHolder |
9490 | 3519 |
^ self |
3520 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 3521 |
ifAbsent:[ |
3522 |
BlockValue |
|
3523 |
with:[:m | self hasTwoFilesSelected not] |
|
3524 |
argument:self currentFileNameHolder |
|
3525 |
]. |
|
9490 | 3526 |
|
3527 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 3528 |
! |
3529 |
||
3892 | 3530 |
hasSelection |
3531 |
||
3532 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
3533 |
! |
|
3534 |
||
9490 | 3535 |
hasTwoDirectoriesSelectedHolder |
3536 |
^ self |
|
3537 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
3538 |
ifAbsent:[ |
|
3539 |
BlockValue |
|
3540 |
with:[:m | self hasTwoDirectoriesSelected] |
|
3541 |
argument:self currentFileNameHolder |
|
3542 |
]. |
|
3543 |
||
3544 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
3545 |
! |
|
3546 |
||
4414 | 3547 |
hasTwoFilesSelectedHolder |
9490 | 3548 |
^ self |
3549 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3550 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3551 |
BlockValue |
5830 | 3552 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3553 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3554 |
]. |
9490 | 3555 |
|
3556 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 3557 |
! |
3558 |
||
11053 | 3559 |
inputTabColumnConversion |
3560 |
^ self inputTabColumnConversionHolder value |
|
3561 |
||
3562 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
3563 |
! |
|
3564 |
||
3565 |
inputTabColumnConversionHolder |
|
3566 |
^ self |
|
3567 |
aspectFor:#inputTabColumnConversionHolder |
|
3568 |
ifAbsent:[ |
|
3569 |
self |
|
3570 |
applicationNamed:#FileApplicationNoteBook |
|
3571 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
3572 |
] |
|
3573 |
||
3574 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
3575 |
! |
|
3576 |
||
3577 |
lineEndConvention |
|
3578 |
^ self lineEndConventionHolder value |
|
3579 |
||
3580 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
3581 |
! |
|
3582 |
||
11591 | 3583 |
lineEndConvention: aSymbol |
3584 |
self lineEndConventionHolder value: aSymbol |
|
3585 |
||
3586 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
3587 |
! |
|
3588 |
||
11053 | 3589 |
lineEndConventionHolder |
3590 |
^ self |
|
3591 |
aspectFor:#lineEndConventionHolder |
|
3592 |
ifAbsent:[ |
|
3593 |
self |
|
3594 |
applicationNamed:#FileApplicationNoteBook |
|
3595 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
3596 |
] |
|
3597 |
||
3598 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
3599 |
! |
|
3600 |
||
5737 | 3601 |
lockFileEncoding:aBoolean |
3602 |
self lockFileEncodingHolder value:aBoolean. |
|
3603 |
||
3604 |
self |
|
3605 |
applicationNamed:#FileApplicationNoteBook |
|
3606 |
ifPresentDo:[:nb | |
|
3607 |
|appl| |
|
3608 |
||
3609 |
appl := nb selectedApplication. |
|
3610 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
3611 |
appl lockFileEncoding:aBoolean |
|
3612 |
] |
|
3613 |
]. |
|
3614 |
! |
|
3615 |
||
3616 |
lockFileEncodingHolder |
|
3617 |
^ self |
|
3618 |
aspectFor:#lockFileEncodingHolder |
|
3619 |
ifAbsent:[ |
|
3620 |
self |
|
3621 |
applicationNamed:#FileApplicationNoteBook |
|
3622 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
3623 |
] |
|
3624 |
! |
|
3625 |
||
4523 | 3626 |
notify:aString |
11108 | 3627 |
"aString is shown in the lower pane" |
3628 |
||
4523 | 3629 |
self notifyChannel value:aString |
11108 | 3630 |
|
3631 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 3632 |
! |
3633 |
||
3892 | 3634 |
notifyChannel |
3635 |
||
3636 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3637 |
! |
3638 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3639 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3640 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3641 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3642 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3643 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3644 |
|
4071 | 3645 |
rootHolder |
3646 |
"holder, which keeps the rootHolder of the treeView |
|
3647 |
" |
|
3648 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3649 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3650 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3651 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3652 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3653 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3654 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3655 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3656 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3657 |
! ! |
3658 |
||
3659 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3660 |
||
3661 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3662 |
"returns the model for an aspect; these are stored in a common dictionary" |
3663 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3664 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3665 |
! |
3666 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3667 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3668 |
"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
|
3669 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3670 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3671 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3672 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3673 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3674 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3675 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3676 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3677 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3678 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3679 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3680 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3681 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3682 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3683 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3684 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3685 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3686 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3687 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3688 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3689 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3690 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3691 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3692 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3693 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3694 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3695 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3696 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3697 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3698 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3699 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3700 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3701 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3702 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3703 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3704 |
aspectFor:something put:aValueHolder |
6284 | 3705 |
"stores the model for an aspect; these are stored in a common dictionary" |
3706 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3707 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3708 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3709 |
|
3892 | 3710 |
aspects |
6284 | 3711 |
"returns the common aspect dictionary" |
3712 |
||
3892 | 3713 |
^ aspects |
3714 |
! |
|
3715 |
||
3716 |
runtimeAspectValueFor:something |
|
3717 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3718 |
" |
|
3719 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3720 |
! |
|
3721 |
||
4201 | 3722 |
saveAspectValues |
3723 |
|saveAspects aspectValue| |
|
3724 |
||
3725 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3726 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3727 |
saveAspects do:[ :aspectKey | |
4201 | 3728 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3729 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3730 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3731 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3732 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3733 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3734 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3735 |
! |
3736 |
||
3892 | 3737 |
saveRuntimeAspectValues |
3738 |
|savedAspects dictionary value isHolder aspect| |
|
3739 |
||
5941 | 3740 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3741 |
dictionary := Dictionary new. |
5941 | 3742 |
savedAspects do:[:aspectKey | |
4414 | 3743 |
aspect := self perform:aspectKey. |
3744 |
isHolder := aspect isValueModel. |
|
5941 | 3745 |
isHolder ifTrue:[ |
3746 |
value := aspect value |
|
3747 |
] ifFalse:[ |
|
3748 |
value := aspect |
|
3749 |
]. |
|
3750 |
dictionary at:aspectKey |
|
3751 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3752 |
]. |
|
3753 |
RuntimeAspects := dictionary. |
|
3892 | 3754 |
! |
3755 |
||
4201 | 3756 |
userPreferencesAspectValueFor:something |
3757 |
"returns the default aspect from the Userpreferences |
|
3892 | 3758 |
" |
4201 | 3759 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3760 |
(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
|
3761 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3762 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3763 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3764 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3765 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 3766 |
! ! |
3767 |
||
4011 | 3768 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3769 |
||
9015 | 3770 |
filter:aString |
3771 |
self filterModel value:aString |
|
3772 |
! |
|
3773 |
||
4018 | 3774 |
filterBackgroundColor |
3775 |
||
3776 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3777 |
! |
|
3778 |
||
4011 | 3779 |
filterBlockHolder |
3780 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3781 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3782 |
! |
3783 |
||
3784 |
filterListModel |
|
3785 |
||
3786 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3787 |
! |
|
3788 |
||
3789 |
filterModel |
|
5941 | 3790 |
|m| |
3791 |
||
3792 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3793 |
^ m |
|
4011 | 3794 |
! |
3795 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3796 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3797 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3798 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3799 |
|
4018 | 3800 |
filterValueBox |
3801 |
||
3802 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3803 |
! |
|
3804 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3805 |
makeFilterBlock |
9102 | 3806 |
"return a two-arg filterblock on the files path- and base-name. This block should return true for files |
3807 |
to be shown" |
|
3808 |
||
12760 | 3809 |
| filterString filterStrings filters notFilters showHidden filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3810 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3811 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3812 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3813 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3814 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3815 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 3816 |
filterStrings := filterStrings |
3817 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
3818 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3819 |
filters := filterStrings |
12760 | 3820 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
3821 |
thenCollect: |
|
3822 |
[:eachPattern | |
|
3823 |
|pattern| |
|
3824 |
||
3825 |
pattern := eachPattern withoutSeparators. |
|
13439 | 3826 |
[:name :baseName | pattern match:baseName caseSensitive:ignoreCase not] |
12760 | 3827 |
]. |
3828 |
||
3829 |
notFilters := filterStrings |
|
3830 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
3831 |
thenCollect: |
|
3832 |
[:eachPattern | |
|
9296 | 3833 |
|pattern| |
3834 |
||
3835 |
pattern := eachPattern withoutSeparators. |
|
12760 | 3836 |
pattern := (pattern copyFrom:2) withoutSeparators. |
13439 | 3837 |
[:name :baseName | pattern match:baseName caseSensitive:ignoreCase not] |
9296 | 3838 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3839 |
|
12760 | 3840 |
|
3841 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3842 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3843 |
] ifFalse:[ |
12760 | 3844 |
filters isEmpty ifTrue:[ |
3845 |
filterBlock := [:name :baseName | |
|
3846 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
3847 |
]. |
|
3848 |
] ifFalse:[ |
|
3849 |
notFilters isEmpty ifTrue:[ |
|
3850 |
filterBlock := [:name :baseName | |
|
3851 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3852 |
]. |
|
3853 |
] ifFalse:[ |
|
3854 |
filterBlock := [:name :baseName | |
|
3855 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3856 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
3857 |
]. |
|
3858 |
] |
|
3859 |
] |
|
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 |
|
4011 | 3862 |
showHidden := self showHiddenFiles value. |
3863 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3864 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3865 |
]. |
9296 | 3866 |
^ [:name :baseName | |
3867 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
4018 | 3868 |
! |
3869 |
||
3870 |
shownFiles |
|
3871 |
||
3872 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 3873 |
! ! |
3874 |
||
3892 | 3875 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
3876 |
||
3877 |
dirHistory |
|
6369 | 3878 |
"obsolete" |
3879 |
^ self directoryHistory |
|
3880 |
! |
|
3881 |
||
3882 |
directoryHistory |
|
3952 | 3883 |
^ self class directoryHistory |
3892 | 3884 |
! |
3885 |
||
3886 |
enableBack |
|
3887 |
||
3888 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
3889 |
! |
|
3890 |
||
3891 |
enableFileHistory |
|
3892 |
||
3893 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
3894 |
! |
|
3895 |
||
3896 |
enableForward |
|
3897 |
||
3898 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
3899 |
! |
|
3900 |
||
3901 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
3902 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 3903 |
! ! |
3904 |
||
3905 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
3906 |
||
4345 | 3907 |
activityVisibilityChannel |
6284 | 3908 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 3909 |
|
3910 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
3911 |
! |
|
3912 |
||
6602 | 3913 |
changeSetBrowserItemVisible |
3914 |
^ Screen current ctrlDown. |
|
3915 |
! |
|
3916 |
||
11135 | 3917 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
3918 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 3919 |
|
3920 |
"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
|
3921 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 3922 |
! |
3923 |
||
3924 |
mercurialMenusAreShown |
|
11147 | 3925 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 3926 |
|
3927 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
3928 |
! |
|
3929 |
||
4110 | 3930 |
openAlwaysInTextEditor |
4201 | 3931 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 3932 |
|
3933 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
3934 |
! |
|
3935 |
||
3892 | 3936 |
openMultipleApplicationsForType |
3937 |
||
4201 | 3938 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
3939 |
open TextEditor " |
|
3940 |
||
3892 | 3941 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
3942 |
! |
|
3943 |
||
11137 | 3944 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
3945 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
3946 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 3947 |
|
3948 |
"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
|
3949 |
"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
|
3950 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 3951 |
! |
3952 |
||
4201 | 3953 |
showDirectoryTree |
3954 |
||
3955 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 3956 |
! |
3957 |
||
4554 | 3958 |
showDiskUsageHolder |
3959 |
|holder| |
|
3960 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
3961 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 3962 |
holder addDependent:self. |
4554 | 3963 |
^ holder |
3964 |
! |
|
3965 |
||
3892 | 3966 |
showHiddenFiles |
3967 |
||
9582 | 3968 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
3969 |
||
3970 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 3971 |
! |
3972 |
||
9108 | 3973 |
showHiddenFiles:aHolder |
3974 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
3975 |
! |
|
3976 |
||
3977 |
shownFiles:aHolder |
|
3978 |
self aspectFor:#shownFiles put:aHolder. |
|
3979 |
! |
|
3980 |
||
11135 | 3981 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
3982 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 3983 |
|
3984 |
"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
|
3985 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 3986 |
! |
3987 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3988 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3989 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
3990 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3991 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
3992 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3993 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3994 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3995 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
3996 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3997 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3998 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
3999 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4000 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4001 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4002 |
|
4648 | 4003 |
userContextAvailable |
4004 |
||
4005 |
" aspect for show group and user columns in contents view |
|
4006 |
windows provides no user context" |
|
4007 |
||
4008 |
^ OperatingSystem isMSWINDOWSlike not |
|
4009 |
! |
|
4010 |
||
3892 | 4011 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4012 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4013 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4014 |
^ self directoryContentsBrowser viewDescription |
3892 | 4015 |
! |
4016 |
||
4017 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4018 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4019 |
" |
3892 | 4020 |
|
6121 | 4021 |
|directoryContentsBrowser| |
4022 |
||
4023 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4024 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4025 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4026 |
! |
4027 |
||
4028 |
viewDirectoryDescription |
|
4029 |
||
4201 | 4030 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4031 |
on change directory " |
|
4032 |
||
3892 | 4033 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4034 |
! |
|
4035 |
||
4201 | 4036 |
viewDirsInContentsBrowser |
4037 |
||
4038 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4039 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4040 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4041 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4042 |
" |
4201 | 4043 |
! |
4044 |
||
5870 | 4045 |
viewFilesInContentsBrowser |
4046 |
||
4047 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4048 |
! |
|
4049 |
||
3892 | 4050 |
viewFilesInDirectoryTree |
4051 |
||
4201 | 4052 |
" aspect for view files in tree view (not only directories) " |
4053 |
||
3892 | 4054 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4055 |
! |
|
4056 |
||
4057 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4058 |
" aspect for show group information 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 viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4061 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4062 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4063 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4064 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4065 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4066 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4067 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4068 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4069 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4070 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4071 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4072 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4073 |
! |
4074 |
||
4075 |
viewNoteBookApplicationHolder |
|
4076 |
||
4077 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4078 |
! |
|
4079 |
||
4080 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4081 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4082 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4083 |
^ self directoryContentsBrowser viewOwner |
3892 | 4084 |
! |
4085 |
||
4086 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4087 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4088 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4089 |
^ self directoryContentsBrowser viewPermissions |
3892 | 4090 |
! |
4091 |
||
4092 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4093 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4094 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4095 |
^ self directoryContentsBrowser viewPreview |
3892 | 4096 |
! |
4097 |
||
4098 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4099 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4100 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4101 |
^ self directoryContentsBrowser viewSize |
3892 | 4102 |
! |
4103 |
||
4974 | 4104 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4105 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4106 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4107 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4108 |
! |
4109 |
||
5312 | 4110 |
viewSizeInKiloBytes |
4111 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4112 |
||
4113 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4114 |
! |
|
4115 |
||
3892 | 4116 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4117 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4118 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4119 |
^ self directoryContentsBrowser viewTime |
3892 | 4120 |
! |
4121 |
||
4122 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4123 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4124 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4125 |
^ self directoryContentsBrowser viewType |
3892 | 4126 |
! ! |
4127 |
||
4128 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4129 |
||
4130 |
executeCommand:cmd |
|
4131 |
||
4132 |
self executeCommand:cmd inDirectory:nil |
|
4133 |
! |
|
4134 |
||
5880 | 4135 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4136 |
| nameString executionBlock| |
4137 |
||
5880 | 4138 |
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
|
4139 |
nameString := 'Execute: ', cmd. |
3892 | 4140 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4141 |
! |
|
4142 |
||
4143 |
getExecutionBlockForCommand:cmd |
|
4144 |
||
4145 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4146 |
! |
|
4147 |
||
5880 | 4148 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4149 |
| dir| |
|
4150 |
||
4151 |
dir := directoryOrNil. |
|
4152 |
directoryOrNil isNil ifTrue:[ |
|
4153 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4154 |
dir isNil ifTrue:[ |
12493 | 4155 |
Dialog warn:(resources string:'Please select a single directory.'). |
6671 | 4156 |
AbortSignal raise. |
4157 |
^ nil |
|
4158 |
]. |
|
3892 | 4159 |
]. |
4523 | 4160 |
|
4161 |
^ [:stream| |
|
4162 |
stream notNil ifTrue:[ |
|
4414 | 4163 |
OperatingSystem |
4164 |
executeCommand:cmd |
|
4165 |
inputFrom:nil |
|
4166 |
outputTo:stream |
|
4167 |
errorTo:stream |
|
4168 |
inDirectory:dir |
|
4169 |
onError:[:status| false]. |
|
4170 |
] |
|
4523 | 4171 |
]. |
3892 | 4172 |
! |
4173 |
||
4174 |
killAllRunningBackgroundProcesses |
|
4175 |
||
4176 |
self backgroundProcesses do:[ : process | |
|
4523 | 4177 |
self notify:'kill ', process name. |
4414 | 4178 |
process terminate. |
3892 | 4179 |
]. |
4180 |
! |
|
4181 |
||
4182 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4183 |
| stream process appl nameString| |
|
4184 |
||
4185 |
appl := self openCommandResultApplication. |
|
4186 |
stream := appl resultStream. |
|
4187 |
nameString := aString ? 'Execution Result'. |
|
4188 |
appl changeTabTo:nameString. |
|
4523 | 4189 |
|
8355 | 4190 |
process := [ |
4191 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
4192 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4193 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4194 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4195 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4196 |
"/ close automatically, if there was no output. |
4571 | 4197 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4198 |
"/ appl doClose. |
|
4199 |
"/ ] |
|
8355 | 4200 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4201 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4202 |
] newProcess. |
3892 | 4203 |
process priority:(Processor userBackgroundPriority). |
4204 |
process name:nameString. |
|
4205 |
self backgroundProcesses add:process. |
|
4206 |
appl process value:process. |
|
4207 |
process resume. |
|
4208 |
! ! |
|
4209 |
||
4210 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4211 |
||
4915 | 4212 |
currentFileNameHolderChanged |
4213 |
"/ self currentFileNameHolderChangedForCommon |
|
4214 |
! |
|
4215 |
||
4577 | 4216 |
currentFileNameHolderChangedForCommon |
5476 | 4217 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4218 |
|
7560 | 4219 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4220 |
self class currentSelection:selection. |
4734 | 4221 |
|
13521 | 4222 |
selectionNotEmpty := selection notEmptyOrNil. |
5476 | 4223 |
self hasSelection value:selectionNotEmpty. |
4224 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 4225 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4226 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4227 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4228 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4229 |
self currentDirectories value:newDirectories. |
4230 |
size := newDirectories size. |
|
4774 | 4231 |
rootInTreeView := self |
4232 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4233 |
ifPresentDo:[:appl | appl rootHolder]. |
4234 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4235 |
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
|
4236 |
|
4347 | 4237 |
newDirectories notEmpty ifTrue:[ |
6369 | 4238 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4239 |
]. |
5074 | 4240 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
8168 | 4241 |
self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4242 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4243 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4244 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4245 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4246 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4247 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4248 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4249 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4250 |
self enableForward value:self canForward. |
4734 | 4251 |
self enableBack value:self canBackward. |
6095 | 4252 |
|
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
4253 |
"/ self updateCanMake. |
7560 | 4254 |
|
9677 | 4255 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
4011 | 4256 |
! |
4257 |
||
4258 |
filterModelChanged |
|
4259 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4260 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4261 |
! |
4262 |
||
3892 | 4263 |
update:something with:aParameter from:changedObject |
4264 |
||
4265 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4266 |
and the things that have to be done if it runs standalone " |
|
4267 |
||
4268 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4269 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4270 |
^ self |
3892 | 4271 |
]. |
3989 | 4272 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4273 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4274 |
^ self |
3989 | 4275 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4276 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4277 |
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
|
4278 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4279 |
]. |
4011 | 4280 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4281 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4282 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4283 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4284 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4285 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4286 |
^ self |
4004 | 4287 |
]. |
4781 | 4288 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4289 |
self notify:nil. |
4781 | 4290 |
^ self |
4291 |
]. |
|
3989 | 4292 |
|
3892 | 4293 |
super update:something with:aParameter from:changedObject |
5543 | 4294 |
! |
4295 |
||
6095 | 4296 |
updateCanMake |
4297 |
|dir can| |
|
4298 |
||
4299 |
can := false. |
|
4300 |
dir := self currentDirectory. |
|
4301 |
dir notNil ifTrue:[ |
|
4302 |
can := (dir asFilename construct:'Makefile') exists. |
|
4303 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
4304 |
can ifFalse:[ |
|
4305 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
4306 |
] |
|
4307 |
]. |
|
4308 |
]. |
|
4309 |
self canMake value:can. |
|
4310 |
! |
|
4311 |
||
5543 | 4312 |
updateListAfterDelete:colOfFiles |
4313 |
self updateCurrentDirectory |
|
3892 | 4314 |
! ! |
4315 |
||
4316 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4317 |
||
4318 |
canPaste |
|
4319 |
||
4320 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
4321 |
! |
|
4322 |
||
4323 |
clipboard |
|
4324 |
||
4325 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4326 |
! |
|
4327 |
||
4328 |
copyFilesToClipBoard:colOfFiles |
|
4329 |
self putInClipBoard:colOfFiles as:#copy. |
|
4330 |
! |
|
4331 |
||
4332 |
cutFilesToClipBoard:colOfFiles |
|
4333 |
"defete current selected files/directories |
|
4334 |
" |
|
4335 |
self putInClipBoard:colOfFiles as:#cut. |
|
4336 |
! |
|
4337 |
||
4338 |
emptyClipBoard |
|
4339 |
||
4340 |
self clipboard files:nil. |
|
4341 |
self canPaste value:false. |
|
4342 |
! |
|
4343 |
||
4344 |
putInClipBoard:colOfFiles as:aSymbol |
|
4345 |
| stream clp| |
|
4346 |
||
4347 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4348 |
clp := self clipboard. |
|
4349 |
clp files:nil. |
|
4350 |
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
|
4351 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4352 |
stream := String writeStream. |
3892 | 4353 |
stream nextPutAll:aSymbol asString. |
4354 |
stream nextPutAll:' <'. |
|
4355 |
stream nextPutAll:colOfFiles first asString. |
|
4356 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4357 |
stream nextPutAll:' ...'. |
3892 | 4358 |
]. |
4359 |
stream nextPutAll:'> to clipboard'. |
|
4360 |
||
4523 | 4361 |
self notify:stream contents. |
3892 | 4362 |
clp files:colOfFiles. |
4363 |
self canPaste value:true. |
|
4364 |
! ! |
|
4365 |
||
4366 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4367 |
||
4368 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4369 |
|filenameDirString filenameDir| |
3892 | 4370 |
|
4371 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4372 |
|
3892 | 4373 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4374 |
filenameDir isNil ifTrue:[^ false ]. |
13232 | 4375 |
filenameDir isWritableDirectory ifFalse:[^ false]. |
6284 | 4376 |
|
3892 | 4377 |
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
|
4378 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4379 |
dropedObjects do:[:aDropObject | |
6284 | 4380 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4381 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4382 |
"/ |
|
4383 |
"/ dropFileName := aDropObject theObject. |
|
4384 |
"/ dropFileNameString := dropFileName asString. |
|
4385 |
"/ dropFileName isDirectory ifTrue:[ |
|
4386 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4387 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4388 |
"/ ^ false |
|
4389 |
"/ ] |
|
4390 |
"/ ] ifFalse:[ |
|
4391 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4392 |
"/ (filenameDirString = dropFileName directory asString |
|
4393 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4394 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4395 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4396 |
"/ ^ false |
|
4397 |
"/ ] |
|
4398 |
"/ ] |
|
4399 |
]. |
|
4400 |
self notify:nil. |
|
4401 |
^ true |
|
4402 |
! |
|
4403 |
||
4404 |
canDropObject:aDropObject into:aDirectory |
|
4405 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4406 |
||
4407 |
dropFileName := aDropObject theObject. |
|
4408 |
dropFileNameString := dropFileName asString. |
|
4409 |
dropFileName isDirectory ifTrue:[ |
|
4410 |
filenameDirString := aDirectory asString. |
|
4411 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4412 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4413 |
^ false |
|
4414 | 4414 |
] |
6284 | 4415 |
] ifFalse:[ |
4416 |
physicalPathName := dropFileName physicalPathName. |
|
4417 |
(aDirectory = dropFileName directory |
|
4418 |
or:[ aDropObject isFileInArchive not |
|
4419 |
and:[physicalPathName notNil |
|
4420 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4421 |
self notify:'Cannot drop a file into same directory'. |
|
4422 |
^ false |
|
4423 |
] |
|
4424 |
]. |
|
4425 |
^ true. |
|
3892 | 4426 |
! |
4427 |
||
7406 | 4428 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
4429 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
4430 |
||
4431 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4432 |
! |
|
4433 |
||
3892 | 4434 |
doStartDrag:aDropSource in:aView |
7829 | 4435 |
"set the cursors before starting the drag & drop operation" |
4436 |
||
3892 | 4437 |
|hdl| |
4438 |
||
4439 |
hdl := DragAndDropManager new. |
|
4440 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4441 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4442 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 4443 |
hdl alienCursor:nil. |
4444 |
||
4745 | 4445 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
4446 |
||
7829 | 4447 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 4448 |
! |
4449 |
||
7408 | 4450 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 4451 |
|fileEntryFieldHolder destDir dropObject fn d| |
4452 |
||
4453 |
fileEntryFieldHolder := self masterApplication notNil |
|
4454 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
4455 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
4456 |
||
4457 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4458 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4459 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4460 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4461 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4462 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4463 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4464 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4465 |
]. |
7990 | 4466 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4467 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4468 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4469 |
]. |
6479 | 4470 |
|
4471 |
destDir := self currentDirectory. |
|
4472 |
destDir isNil ifTrue:[^ self]. |
|
4473 |
||
8601 | 4474 |
self withWaitCursorDo:[ |
4475 |
aCollectionOfDropObjects do:[:dropObject | |
|
4476 |
|fn| |
|
4477 |
||
4478 |
dropObject isFileObject ifTrue:[ |
|
4479 |
fn := dropObject theObject asFilename. |
|
4480 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
4481 |
fn recursiveCopyTo:destDir |
8601 | 4482 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
4483 |
fn copyTo:(destDir / fn baseName ) |
8601 | 4484 |
] |
6479 | 4485 |
] |
8601 | 4486 |
]. |
4487 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4488 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4489 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4490 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4491 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4492 |
]. |
7408 | 4493 |
|
4494 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 4495 |
! ! |
4496 |
||
4497 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
4498 |
||
4499 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 4500 |
"copy to" |
4501 |
||
7635 | 4502 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
4503 |
||
4504 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
4505 |
! |
|
4506 |
||
4507 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
4508 |
"copy to" |
|
4509 |
||
4510 |
|copyOperation msg| |
|
4511 |
||
4512 |
repairCorruptedFiles ifTrue:[ |
|
4513 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
4514 |
] ifFalse:[ |
|
4515 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
4516 |
]. |
|
4517 |
copyOperation result ifTrue:[ |
|
6190 | 4518 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 4519 |
] ifFalse:[ |
7635 | 4520 |
msg := copyOperation errorString. |
6190 | 4521 |
]. |
4522 |
self notify:msg. |
|
7635 | 4523 |
^ copyOperation result |
4524 |
||
4525 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 4526 |
! |
4527 |
||
4528 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 4529 |
|copy result| |
3892 | 4530 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4531 |
self withActivityIndicationDo:[ |
5961 | 4532 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 4533 |
copy result ifTrue:[ |
4534 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
4535 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4536 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4537 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4538 |
self updateCurrentDirectory. |
3892 | 4539 |
]. |
6374 | 4540 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4541 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4542 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 4543 |
! |
4544 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4545 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
12850 | 4546 |
|size msg answer file| |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4547 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4548 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4549 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4550 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4551 |
"/ 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
|
4552 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4553 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4554 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4555 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4556 |
"/ 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
|
4557 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4558 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4559 |
"/ 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
|
4560 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4561 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4562 |
"/ 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
|
4563 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4564 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4565 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4566 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4567 |
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
|
4568 |
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
|
4569 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4570 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4571 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4572 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4573 |
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
|
4574 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4575 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 4576 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4577 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4578 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4579 |
request:msg |
8127 | 4580 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
4581 |
image:(WarningBox iconBitmap) |
8127 | 4582 |
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
|
4583 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4584 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4585 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4586 |
^ answer. |
3892 | 4587 |
! |
4588 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4589 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 4590 |
"copy or move aColOfSourceFiles to aDirectory. |
4591 |
Asks the used if a move or a copy is wanted. |
|
4592 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
4593 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4594 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4595 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4596 |
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
|
4597 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4598 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4599 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4600 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4601 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4602 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4603 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4604 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4605 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4606 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4607 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4608 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 4609 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4610 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4611 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4612 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4613 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4614 |
|
4745 | 4615 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4616 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4617 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4618 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4619 |
^ true. |
3892 | 4620 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4621 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4622 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4623 |
^ true. |
3892 | 4624 |
]. |
4745 | 4625 |
^ false. |
3892 | 4626 |
! |
4627 |
||
6107 | 4628 |
copySelectionTo |
4629 |
"copy the selected file(s) to another directory" |
|
4630 |
||
13704 | 4631 |
self copySelectionToRepairingCorruptedFiles:false. |
4632 |
self updateCurrentDirectoryWithReread. |
|
7635 | 4633 |
|
4634 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
4635 |
! |
|
4636 |
||
4637 |
copySelectionToRepairingCorruptedFiles |
|
4638 |
"copy the selected file(s) to another directory" |
|
4639 |
||
13704 | 4640 |
self copySelectionToRepairingCorruptedFiles:true. |
4641 |
self updateCurrentDirectoryWithReread. |
|
7635 | 4642 |
|
4643 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
4644 |
! |
|
4645 |
||
4646 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
4647 |
"copy the selected file(s) to another directory" |
|
4648 |
||
6299 | 4649 |
|selectedFiles msg destination directory| |
4650 |
||
7560 | 4651 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 4652 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
4653 |
||
4654 |
msg := (selectedFiles size > 1) |
|
4655 |
ifTrue:[ 'Copy Selected Items To Directory:' ] |
|
4656 |
ifFalse:[ 'Copy "%1" To Directory:' ]. |
|
4657 |
||
4658 |
destination := Dialog |
|
7635 | 4659 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first pathName) |
4660 |
default:(LastMoveDestination ? self currentDirectory) |
|
4661 |
ok:(resources string:'Copy') |
|
4662 |
abort:nil. |
|
4663 |
||
6299 | 4664 |
destination isEmptyOrNil ifTrue:[^ self]. |
4665 |
destination := destination asFilename. |
|
4666 |
||
4667 |
destination isDirectory ifFalse:[ |
|
4668 |
selectedFiles size == 1 ifTrue:[ |
|
4669 |
directory := destination directory. |
|
4670 |
directory isDirectory ifTrue:[ |
|
4671 |
LastMoveDestination := directory. |
|
7635 | 4672 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 4673 |
^ self. |
4674 |
] |
|
4675 |
] |
|
4676 |
]. |
|
4677 |
||
4678 |
LastMoveDestination := destination. |
|
7635 | 4679 |
repairingCorruptedFiles ifTrue:[ |
4680 |
selectedFiles do:[:eachFile | |
|
4681 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
4682 |
]. |
|
4683 |
^ self. |
|
4684 |
] ifFalse:[ |
|
4685 |
self copyFiles:selectedFiles to:destination |
|
4686 |
] |
|
4687 |
||
4688 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 4689 |
! |
4690 |
||
3892 | 4691 |
deleteFile:aFile |
6373 | 4692 |
"delete the selected files/directories" |
3892 | 4693 |
|
4694 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
4695 |
! |
|
4696 |
||
4697 |
deleteFiles:colOfFiles |
|
6373 | 4698 |
"delete some files/directories" |
4699 |
||
5081 | 4700 |
^ self deleteFiles:colOfFiles confirm:true. |
4701 |
! |
|
4702 |
||
4703 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 4704 |
"delete some files/directories" |
4705 |
||
5673 | 4706 |
|delete result| |
3892 | 4707 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4708 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4709 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4710 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4711 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4712 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4713 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4714 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4715 |
]. |
5673 | 4716 |
result notNil ifTrue:[ |
4717 |
result ifFalse:[ |
|
4718 |
self notify:delete errorString. |
|
5753 | 4719 |
] ifTrue:[ |
4720 |
self updateListAfterDelete:colOfFiles. |
|
4721 |
] |
|
4394 | 4722 |
]. |
5673 | 4723 |
]. |
4724 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4725 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4726 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 4727 |
! |
4728 |
||
6169 | 4729 |
eraseFiles:colOfFiles |
6373 | 4730 |
"erase (clear and delete) some files/directories" |
4731 |
||
6169 | 4732 |
^ self eraseFiles:colOfFiles confirm:true. |
4733 |
! |
|
4734 |
||
4735 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4736 |
"erase (clear and delete) some files/directories" |
4737 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4738 |
|deleteOperation result fileSize| |
6169 | 4739 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4740 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4741 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4742 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4743 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4744 |
ifTrue:[ |
4745 |
result := deleteOperation result. |
|
4746 |
] ifFalse:[ |
|
4747 |
ProgressIndicator |
|
4748 |
displayProgressNotifications:'Erasing' |
|
4749 |
abortable:true |
|
4750 |
at:nil |
|
4751 |
during:[ |
|
4752 |
result := deleteOperation result. |
|
4753 |
]. |
|
4754 |
]. |
|
4755 |
||
6169 | 4756 |
result notNil ifTrue:[ |
4757 |
result ifFalse:[ |
|
8294 | 4758 |
self notify:deleteOperation errorString. |
6169 | 4759 |
] ifTrue:[ |
4760 |
self updateListAfterDelete:colOfFiles. |
|
4761 |
] |
|
4762 |
]. |
|
4763 |
]. |
|
4764 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4765 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4766 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4767 |
! |
4768 |
||
3892 | 4769 |
moveFile:aSourceFile to:aDestFile |
6373 | 4770 |
"move a file/directory" |
3892 | 4771 |
|
4772 |
|move| |
|
4773 |
||
5961 | 4774 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4775 |
move result ifTrue:[ |
4523 | 4776 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4777 |
] ifFalse:[ |
4523 | 4778 |
self notify:move errorString. |
3892 | 4779 |
]. |
4780 |
self updateCurrentDirectory. |
|
4781 |
^ move result |
|
4782 |
! |
|
4783 |
||
4784 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4785 |
"move some files to aDirectory" |
4786 |
||
3892 | 4787 |
|move| |
4788 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4789 |
self withActivityIndicationDo:[ |
5961 | 4790 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4791 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4792 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4793 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4794 |
self updateCurrentDirectory. |
3892 | 4795 |
]. |
6373 | 4796 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4797 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4798 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4799 |
! |
4800 |
||
6107 | 4801 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4802 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4803 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4804 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4805 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4806 |
destinationDirectory := Dialog |
6352 | 4807 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items To:') |
5789 | 4808 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4809 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4810 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4811 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4812 |
|
5789 | 4813 |
LastMoveDestination := destinationDirectory. |
13704 | 4814 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename. |
4815 |
self updateCurrentDirectoryWithReread. |
|
4816 |
||
7560 | 4817 |
|
4818 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4819 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4820 |
|
3892 | 4821 |
newDirectory |
4822 |
"ask for and create a new directory" |
|
4823 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4824 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4825 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4826 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4827 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4828 |
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
|
4829 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4830 |
]. |
4521 | 4831 |
|
4832 |
"/ 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
|
4833 |
selectedFiles := self currentSelectedFiles. |
4521 | 4834 |
selectedFiles size == 1 ifTrue:[ |
4835 |
singleSelectedFile := selectedFiles first. |
|
4836 |
||
4837 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
4838 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
4839 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
4840 |
||
4841 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
4842 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 4843 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
4844 |
]. |
|
4845 |
]. |
|
4846 |
]. |
|
4847 |
||
5961 | 4848 |
|
4521 | 4849 |
defaultAnswer notNil ifTrue:[ |
5961 | 4850 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 4851 |
] ifFalse:[ |
5961 | 4852 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 4853 |
]. |
4854 |
createOp result ifFalse:[ ^ self]. |
|
4855 |
newFile := createOp createdFile. |
|
3892 | 4856 |
newFile notNil ifTrue:[ |
4414 | 4857 |
self updateCurrentDirectory. |
3892 | 4858 |
] |
4859 |
! |
|
4860 |
||
4861 |
newFile |
|
4862 |
"ask for and create a new file" |
|
4863 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4864 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4865 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4866 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4867 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4868 |
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
|
4869 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4870 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4871 |
|
3982 | 4872 |
curFile := self firstSelectedFile. |
3892 | 4873 |
curFile notNil ifTrue:[ |
4414 | 4874 |
file := curFile. |
3892 | 4875 |
] ifFalse:[ |
4414 | 4876 |
file := directory. |
3892 | 4877 |
]. |
5961 | 4878 |
create := FileOperation createFileIn:file. |
3892 | 4879 |
create result ifFalse:[ ^ self]. |
4880 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
4881 |
! |
|
4882 |
||
4883 |
newHardLink |
|
4884 |
"ask for and create a hard link (unix only)" |
|
4885 |
||
6151 | 4886 |
self newLink:#hard. |
4887 |
! |
|
4888 |
||
4889 |
newLink:typeOfLink |
|
3892 | 4890 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
4891 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4892 |
| sel dir create createdFile| |
3892 | 4893 |
|
7560 | 4894 |
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
|
4895 |
(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
|
4896 |
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
|
4897 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4898 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4899 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4900 |
|
6151 | 4901 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 4902 |
create result ifFalse:[ ^ self]. |
4903 |
createdFile := create createdFile. |
|
4904 |
createdFile notNil ifTrue:[ |
|
6151 | 4905 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4906 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4907 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4908 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
4909 |
] |
3892 | 4910 |
]. |
7560 | 4911 |
|
4912 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 4913 |
! |
4914 |
||
4915 |
newSoftLink |
|
4916 |
"ask for and create a soft link (unix only)" |
|
4917 |
||
6151 | 4918 |
self newLink:#soft. |
3892 | 4919 |
! |
4920 |
||
4921 |
pasteFiles |
|
6373 | 4922 |
"paste from clipBoard" |
4923 |
||
4924 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 4925 |
|
4926 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
4927 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 4928 |
|
4929 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
4930 |
||
3892 | 4931 |
buffer := self clipboard copy. |
3982 | 4932 |
directories := self currentSelectedDirectories. |
5880 | 4933 |
directories size ~~ 1 ifTrue:[ |
4414 | 4934 |
|box dirStringCol| |
5880 | 4935 |
|
4414 | 4936 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
4937 |
box := ListSelectionBox new. |
|
6373 | 4938 |
box title:'Paste into which directory ?'. |
4414 | 4939 |
box list:dirStringCol. |
4940 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4941 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
4942 |
box destroy. |
3892 | 4943 |
] ifFalse:[ |
5880 | 4944 |
destination := directories anElement. |
3892 | 4945 |
]. |
6373 | 4946 |
|
4947 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 4948 |
buffer files copy do:[:aFile| |
4949 |
aFile directory = destination ifTrue:[ |
|
4950 |
buffer files remove:aFile. |
|
4951 |
]. |
|
4952 |
]. |
|
4953 |
]. |
|
4954 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 4955 |
copiedFiles notEmptyOrNil ifTrue:[ |
4956 |
thisIsAFileMoveOperation ifTrue:[ |
|
4957 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
4958 |
]. |
|
4959 |
||
4960 |
"/ select those pasted files. |
|
4961 |
self updateCurrentDirectory:true. |
|
4962 |
self currentFileNameHolder value:copiedFiles values. |
|
4963 |
] |
|
3892 | 4964 |
! |
4965 |
||
4966 |
renameFile:aFile |
|
4967 |
"rename the selected file(s)" |
|
4968 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4969 |
^ self renameFiles:(Array with:aFile). |
3892 | 4970 |
! |
4971 |
||
4230 | 4972 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 4973 |
"rename filename to newFileString" |
4974 |
||
4975 |
|rename| |
|
4976 |
||
5961 | 4977 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 4978 |
rename result ifTrue:[ |
4230 | 4979 |
aBoolean ifTrue:[ |
4980 |
self updateAndSelect:(rename renamedFiles). |
|
4981 |
]. |
|
3892 | 4982 |
] ifFalse:[ |
4523 | 4983 |
self notify:rename errorString. |
3892 | 4984 |
]. |
4985 |
^ rename result |
|
4986 |
! |
|
4987 |
||
4988 |
renameFiles:aColOfFiles |
|
6373 | 4989 |
"rename some file(s)" |
3892 | 4990 |
|
4991 |
|rename| |
|
4992 |
||
5961 | 4993 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 4994 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4995 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4996 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4997 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
4998 |
^ rename |
3892 | 4999 |
! |
5000 |
||
5001 |
renameSelection |
|
5002 |
"rename the selected file(s)" |
|
5003 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5004 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5005 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5006 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5007 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5008 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5009 |
]. |
7560 | 5010 |
|
5011 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5012 |
! ! |
5013 |
||
4080 | 5014 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5015 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5016 |
bookmarksMenu |
3952 | 5017 |
<resource: #programMenu> |
5018 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5019 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5020 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5021 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
7763 | 5022 |
|
5023 |
"/ add the bookmark items ... |
|
5024 |
bookmarks := self class directoryBookmarks. |
|
5025 |
bookmarks notEmptyOrNil ifTrue:[ |
|
5026 |
menu addItem:(MenuItem labeled:'-'). |
|
5027 |
bookmarks do:[:dirName | |
|
12963 | 5028 |
menu addItem:(MenuItem |
5029 |
label:dirName asString |
|
5030 |
itemValue:[ |
|
5031 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5032 |
self setCurrentFileName:dirName. |
|
5033 |
]. |
|
5034 |
]). |
|
7763 | 5035 |
]. |
5036 |
]. |
|
4080 | 5037 |
menu findGuiResourcesIn:self. |
7763 | 5038 |
^ menu |
5039 |
||
11135 | 5040 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5041 |
! |
5042 |
||
5043 |
canBackward |
|
5044 |
^ self directoryHistory canBackward. |
|
5045 |
||
5046 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5047 |
! |
|
5048 |
||
5049 |
canForward |
|
5050 |
^ self directoryHistory canForward. |
|
5051 |
||
5052 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5053 |
! |
|
5054 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5055 |
gotoBookmarksMenu |
7763 | 5056 |
<resource: #programMenu> |
5057 |
||
5058 |
|menu bookmarks| |
|
5059 |
||
5060 |
menu := self class baseBookmarksMenuSpec2 decodeAsLiteralArray. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5061 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5062 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5063 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5064 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 5065 |
menu addItem:(MenuItem labeled:'-'). |
5066 |
bookmarks do:[:dirName | |
|
12963 | 5067 |
menu addItem:(MenuItem |
5068 |
label:dirName asString |
|
5069 |
itemValue:[ |
|
5070 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5071 |
self setCurrentFileName:dirName. |
|
5072 |
]. |
|
5073 |
]). |
|
4414 | 5074 |
]. |
3952 | 5075 |
]. |
7763 | 5076 |
menu findGuiResourcesIn:self. |
3952 | 5077 |
^ menu |
5078 |
||
11135 | 5079 |
"Modified: / 14-01-2012 / 21:13:58 / cg" |
6099 | 5080 |
! |
5081 |
||
3892 | 5082 |
menuDirHistory:backOrForward |
7763 | 5083 |
"initialize the history menu" |
5084 |
||
3892 | 5085 |
<resource: #programMenu > |
5086 |
||
7763 | 5087 |
|hist menu pathList currentSel currentPath| |
5088 |
||
5089 |
hist := self directoryHistory. |
|
5090 |
hist isEmpty ifTrue:[^ nil]. |
|
5091 |
||
3892 | 5092 |
backOrForward == #back ifTrue:[ |
6725 | 5093 |
currentSel := self currentSelectedDirectories. |
4347 | 5094 |
currentSel size == 1 ifTrue:[ |
5095 |
currentPath := currentSel first asString. |
|
5096 |
] ifFalse:[ |
|
5097 |
currentPath := nil. |
|
5098 |
]. |
|
7763 | 5099 |
pathList := hist getBackCollection. |
3892 | 5100 |
] ifFalse:[ |
7763 | 5101 |
pathList := hist getForwardCollection. |
3892 | 5102 |
]. |
4022 | 5103 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5104 |
|
6370 | 5105 |
pathList size > 30 ifTrue:[ |
5106 |
pathList := pathList copyTo:30 |
|
5107 |
]. |
|
7763 | 5108 |
|
5109 |
menu := Menu new. |
|
5110 |
||
3964 | 5111 |
pathList do:[:aPath| |
4347 | 5112 |
| menuItem | |
5113 |
menuItem := MenuItem new. |
|
5114 |
menuItem label:aPath. |
|
11783 | 5115 |
menuItem itemValue:[ self setCurrentFileName:(aPath asFilename) ]. |
4347 | 5116 |
menu addItem:menuItem. |
3952 | 5117 |
]. |
7763 | 5118 |
menu findGuiResourcesIn:self. |
3892 | 5119 |
^ menu |
7763 | 5120 |
|
11783 | 5121 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5122 |
! |
5123 |
||
5124 |
menuDirHistoryBack |
|
5125 |
"initialize the directory menu |
|
5126 |
" |
|
5127 |
<resource: #programMenu > |
|
5128 |
||
5129 |
^ self menuDirHistory:#back. |
|
5130 |
! |
|
5131 |
||
5132 |
menuDirHistoryForward |
|
5133 |
"initialize the directory menu |
|
5134 |
" |
|
5135 |
<resource: #programMenu > |
|
5136 |
||
5137 |
^ self menuDirHistory:#forward. |
|
3906 | 5138 |
! |
5139 |
||
5140 |
menuFileHistory |
|
5141 |
"initialize the file history menu |
|
5142 |
" |
|
5143 |
<resource: #programMenu > |
|
5144 |
||
7763 | 5145 |
|menu hist text removeItem| |
3906 | 5146 |
|
5147 |
hist := self fileHistory. |
|
5148 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5149 |
|
7763 | 5150 |
menu := Menu new. |
5151 |
||
5152 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5153 |
aFileItem fileName exists ifTrue:[ |
12963 | 5154 |
menu addItem:(MenuItem |
5155 |
label: aFileItem fileName asString |
|
5156 |
itemValue:[ |
|
5157 |
self setCurrentFileName:(aFileItem fileName). |
|
5158 |
self openApplByFileItem:aFileItem |
|
5159 |
]). |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5160 |
] ifFalse:[ |
7763 | 5161 |
"/ remove all not existing history entries |
5162 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5163 |
] |
3906 | 5164 |
]. |
7763 | 5165 |
menu addSeparator. |
5166 |
||
4080 | 5167 |
removeItem := MenuItem new. |
5168 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5169 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5170 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5171 |
removeItem label:text. |
11783 | 5172 |
removeItem |
5173 |
itemValue:[ |
|
5174 |
self fileHistory removeAll. |
|
5175 |
self enableFileHistory value:false. |
|
5176 |
]. |
|
3906 | 5177 |
menu addItem:removeItem. |
7763 | 5178 |
menu findGuiResourcesIn:self. |
3906 | 5179 |
^ menu |
7763 | 5180 |
|
11783 | 5181 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5182 |
! |
5183 |
||
4080 | 5184 |
sortMenu |
5185 |
<resource: #programMenu > |
|
5186 |
||
5187 |
|menu| |
|
5188 |
||
7763 | 5189 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5190 |
menu findGuiResourcesIn:self. |
5191 |
^ menu |
|
7763 | 5192 |
|
5193 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5194 |
! |
5195 |
||
5196 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5197 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5198 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5199 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5200 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5201 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5202 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5203 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5204 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5205 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5206 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5207 |
^ spec |
4080 | 5208 |
! |
5209 |
||
5210 |
viewInContentsBrowserMenu |
|
5009 | 5211 |
self |
5212 |
applicationNamed:#DirectoryContentsBrowser |
|
5213 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5214 |
||
5215 |
^ nil. |
|
4080 | 5216 |
! |
5217 |
||
3952 | 5218 |
visitedDirectoriesMenu |
5219 |
<resource: #programMenu > |
|
5220 |
||
5221 |
|menu histCopy text removeItem| |
|
5222 |
||
7763 | 5223 |
histCopy := self directoryHistory. |
5224 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5225 |
||
3952 | 5226 |
menu := Menu new. |
7763 | 5227 |
|
5228 |
histCopy do:[:aFile| |
|
12963 | 5229 |
menu addItem:(MenuItem |
5230 |
label:aFile asString |
|
5231 |
itemValue:[ |
|
5232 |
self setCurrentFileName:(aFile path asFilename). |
|
5233 |
]). |
|
7763 | 5234 |
]. |
5235 |
menu addSeparator. |
|
5236 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5237 |
"/ 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
|
5238 |
text := (resources string:'Clear History'). |
3952 | 5239 |
removeItem := MenuItem new. |
4040 | 5240 |
removeItem translateLabel:true. |
3952 | 5241 |
removeItem label:text. |
11783 | 5242 |
removeItem |
5243 |
itemValue:[ |
|
5244 |
self directoryHistory removeAll. |
|
5245 |
self enableForward value:self canForward. |
|
5246 |
self enableBack value:self canBackward. |
|
5247 |
]. |
|
7763 | 5248 |
|
3952 | 5249 |
menu addItem:removeItem. |
7763 | 5250 |
menu findGuiResourcesIn:self. |
3952 | 5251 |
^ menu |
7763 | 5252 |
|
11783 | 5253 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5254 |
! ! |
5255 |
||
5880 | 5256 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5257 |
||
5258 |
doCompareTwoFiles |
|
5259 |
self openDiffView. |
|
5260 |
! |
|
5261 |
||
5262 |
doGoDirectoryUp |
|
5960 | 5263 |
| upDir directory rootInTreeView| |
5880 | 5264 |
|
5265 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5266 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5267 |
directory := self currentDirectory. |
5268 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5269 |
] ifFalse:[ |
5270 |
rootInTreeView := self |
|
5271 |
applicationNamed:#DirectoryTreeBrowser |
|
5272 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5273 |
directory := rootInTreeView value asFilename. |
5274 |
]. |
|
5275 |
upDir := directory directory. |
|
5959 | 5276 |
self setCurrentFileName:upDir. |
5880 | 5277 |
! |
5278 |
||
5279 |
doGotoDefaultDirectory |
|
5280 |
self gotoFile:(Filename defaultDirectory). |
|
5281 |
! |
|
5282 |
||
8091 | 5283 |
doGotoDesktopDirectory |
5284 |
self gotoFile:(Filename desktopDirectory). |
|
5285 |
! |
|
5286 |
||
5880 | 5287 |
doGotoHomeDirectory |
8091 | 5288 |
self gotoFile:(Filename homeDirectory). |
5880 | 5289 |
! |
5290 |
||
6434 | 5291 |
doGotoSmalltalkDirectory |
5292 |
self gotoFile:(self smalltalkDirectory). |
|
5293 |
! |
|
5294 |
||
9677 | 5295 |
doGotoTempDirectory |
5296 |
self gotoFile:(self tempDirectory). |
|
5297 |
||
5298 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5299 |
! |
|
5300 |
||
9596 | 5301 |
doMakeCurrentDirectory |
5302 |
OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5303 |
self currentFileNameHolderChangedForCommon. |
|
5304 |
||
5305 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
5306 |
! |
|
5307 |
||
5880 | 5308 |
fileGetInfo:longInfo |
5309 |
"get info on selected file - show it in a box" |
|
5310 |
||
5311 |
|string box updater| |
|
5312 |
||
5313 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5314 |
string notNil ifTrue:[ |
|
5315 |
box := InfoBox title:string. |
|
5316 |
updater := [ |
|
5317 |
[true] whileTrue:[ |
|
5318 |
Delay waitForSeconds:2. |
|
5319 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5320 |
string isNil ifTrue:[ ^ self]. |
|
5321 |
box title:string |
|
5322 |
] |
|
5323 |
] fork. |
|
5324 |
box show. |
|
5325 |
updater terminate. |
|
5326 |
box destroy |
|
5327 |
] |
|
6434 | 5328 |
! |
5329 |
||
5330 |
smalltalkDirectory |
|
8590 | 5331 |
|stxPath| |
6434 | 5332 |
|
5333 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5334 |
stxPath isNil ifTrue:[ |
5335 |
^ Filename currentDirectory |
|
5336 |
]. |
|
5337 |
^ stxPath asFilename directory. |
|
9677 | 5338 |
! |
5339 |
||
5340 |
tempDirectory |
|
5341 |
^ Filename tempDirectory. |
|
5342 |
||
5343 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5344 |
! ! |
5345 |
||
11139 | 5346 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5347 |
||
5348 |
copyFiles |
|
5349 |
self |
|
5350 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5351 |
! |
|
5352 |
||
5353 |
cutFiles |
|
5354 |
self |
|
5355 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5356 |
! |
|
5357 |
||
5358 |
deleteFiles |
|
5359 |
self |
|
5360 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5361 |
! |
|
5362 |
||
5363 |
eraseFiles |
|
5364 |
self |
|
5365 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
5366 |
! |
|
5367 |
||
5368 |
openSettingsDialog |
|
5369 |
|dialog| |
|
5370 |
||
5371 |
dialog := FileBrowserV2SettingsDialog new. |
|
5372 |
dialog settingsDialog:self. |
|
5373 |
dialog allButOpen. |
|
5374 |
dialog doReload. |
|
5375 |
dialog openWindow |
|
5376 |
! |
|
5377 |
||
5378 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
5379 |
|files dirs| |
|
5380 |
||
5381 |
files := self currentSelectedFiles. |
|
5382 |
files notEmpty ifTrue:[ |
|
5383 |
aBlock value:files. |
|
5384 |
] ifFalse:[ |
|
5385 |
dirs := self currentSelectedDirectories. |
|
5386 |
dirs notEmpty ifTrue:[ |
|
5387 |
aBlock value:dirs. |
|
5388 |
]. |
|
5389 |
]. |
|
5390 |
! ! |
|
5391 |
||
5392 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
5393 |
||
5394 |
openAboutThisApplication |
|
5395 |
"opens an about box for this application." |
|
5396 |
||
5397 |
Dialog aboutClass:self class. |
|
5398 |
! |
|
5399 |
||
5400 |
openHTMLDocument:relativeDocPath |
|
5401 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
5402 |
! ! |
|
5403 |
||
5404 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 5405 |
|
12777 | 5406 |
commitFilesToCVS:files |
5407 |
|numFiles| |
|
5408 |
||
5409 |
(numFiles := files size) > 0 ifTrue:[ |
|
5410 |
self withActivityIndicationDo:[ |
|
5411 |
self cvsCommitFiles:files |
|
5412 |
] |
|
5413 |
] |
|
5414 |
! |
|
5415 |
||
3892 | 5416 |
cvsAddAndCommit |
4849 | 5417 |
self cvsAddAndCommitAsBinary:false |
5418 |
! |
|
5419 |
||
5420 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 5421 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 5422 |
|
5423 |
log := Dialog |
|
11139 | 5424 |
requestText:(resources string:'Enter initial log message:') |
4414 | 5425 |
lines:10 |
5426 |
columns:70 |
|
5427 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
5428 |
log isNil ifTrue:[^ self]. |
3892 | 5429 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5430 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5431 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5432 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5433 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5434 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5435 |
|
8588 | 5436 |
binArg := ''. |
5437 |
asBinary ifTrue:[ |
|
5438 |
binArg := '-kb '. |
|
5439 |
]. |
|
3982 | 5440 |
sel := self currentSelectedFiles. |
11139 | 5441 |
executionBlock := |
5442 |
[:stream | |
|
5443 |
log notNil ifTrue:[ |
|
5444 |
sel size > 0 ifTrue:[ |
|
5445 |
sel do:[:fn | |
|
5446 |
|nameArg| |
|
5447 |
||
5448 |
nameArg := '"',fn baseName,'"'. |
|
5449 |
||
5450 |
dir := self getDirWithoutFileName:fn. |
|
5451 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
5452 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5453 |
||
5454 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5455 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 5456 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
5457 |
"/ support and need the 'admin -kb' command. |
|
5458 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
5459 |
asBinary ifTrue:[ |
|
5460 |
cmd := ('cvs admin -kb ' , nameArg). |
|
5461 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5462 |
||
5463 |
cmd := ('cvs upd ' , nameArg). |
|
5464 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5465 |
]. |
|
5466 |
] |
|
5467 |
] |
|
5468 |
] |
|
5469 |
]. |
|
4107 | 5470 |
nameString := 'Command> cvs add and commit'. |
3892 | 5471 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 5472 |
|
5473 |
"Modified (format): / 15-01-2012 / 16:02:07 / cg" |
|
3892 | 5474 |
! |
5475 |
||
4849 | 5476 |
cvsAddBinaryAndCommit |
5477 |
self cvsAddAndCommitAsBinary:true |
|
5478 |
! |
|
5479 |
||
3892 | 5480 |
cvsCommit |
12777 | 5481 |
|selectedFiles| |
3892 | 5482 |
|
3982 | 5483 |
selectedFiles:= self currentSelectedFiles. |
12777 | 5484 |
self cvsCommitFiles:selectedFiles |
5485 |
! |
|
5486 |
||
5487 |
cvsCommitFiles:files |
|
5488 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
5489 |
||
5490 |
nFiles := files size. |
|
5491 |
nFiles == 0 ifTrue:[^ self]. |
|
5492 |
||
5493 |
nFiles == 1 ifTrue:[ |
|
5494 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 5495 |
] ifFalse:[ |
12777 | 5496 |
nFiles > 1 ifTrue:[ |
5497 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 5498 |
] ifFalse:[ |
6627 | 5499 |
msg := resources string:'Enter log message for checkIn' |
4414 | 5500 |
] |
3892 | 5501 |
]. |
5502 |
||
5503 |
log := Dialog |
|
4414 | 5504 |
requestText:msg |
5505 |
lines:10 |
|
5506 |
columns:70 |
|
5507 |
initialAnswer:nil. |
|
3892 | 5508 |
|
4663 | 5509 |
log isNil ifTrue:[^ self]. |
12777 | 5510 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5511 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5512 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 5513 |
"/ save the log message into another tempFile ... |
13121 | 5514 |
s := FileStream newTemporary. |
5515 |
logTmp := s fileName. |
|
12777 | 5516 |
s nextPutAll:log. |
5517 |
s close. |
|
5518 |
||
5519 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5520 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5521 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5522 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5523 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5524 |
executionBlock := [:stream | |
12777 | 5525 |
[ |
5526 |
files do:[:fn | |
|
5527 |
| dir nameArg cmd | |
|
5528 |
||
5529 |
nameArg := '"',fn baseName,'"'. |
|
5530 |
dir := fn directory. |
|
5531 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
5532 |
stream showCR:fn pathName. |
|
5533 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 5534 |
] |
12777 | 5535 |
] ensure:[ |
5536 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
5537 |
]. |
|
4107 | 5538 |
]. |
5539 |
nameString := 'Command> cvs commit'. |
|
5540 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 5541 |
! |
5542 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5543 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5544 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5545 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5546 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5547 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5548 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5549 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5550 |
out := WriteStream on:(String new:100). |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5551 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5552 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5553 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5554 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5555 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5556 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5557 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5558 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5559 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5560 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5561 |
|
3892 | 5562 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
5563 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
5564 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5565 |
|toRemove updateRunning executionBlock nameString| |
3892 | 5566 |
|
5567 |
updateRunning := self backgroundProcesses value notEmpty. |
|
5568 |
self killAllRunningBackgroundProcesses. |
|
5569 |
toRemove := OrderedCollection new. |
|
5570 |
||
12493 | 5571 |
executionBlock := |
5572 |
[:stream | |
|
5573 |
|cmd logArg prevDir prevFiles| |
|
5574 |
||
5575 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5576 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
5577 |
] ifFalse:[ |
|
5578 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
5579 |
]. |
|
5580 |
prevFiles := ''. |
|
5581 |
||
5582 |
filesToRemove do:[:fileName | |
|
5583 |
|dir file| |
|
5584 |
||
5585 |
dir := fileName directory. |
|
5586 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
5587 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
5588 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5589 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5590 |
prevFiles := ''. |
|
4414 | 5591 |
]. |
12493 | 5592 |
|
5593 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5594 |
"was not able to remove it" |
|
5595 |
| lastError msg | |
|
5596 |
lastError := OperatingSystem lastErrorString. |
|
5597 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5598 |
lastError isNil ifFalse:[ |
|
5599 |
msg := msg , '\\(' , lastError , ')' |
|
5600 |
]. |
|
5601 |
Dialog warn:msg withCRs |
|
5602 |
] do:[ |
|
5603 |
(fileName isSymbolicLink) ifFalse:[ |
|
5604 |
fileName remove. |
|
5605 |
file := fileName baseName. |
|
5606 |
cmd := ('cvs remove -f "',file,'"'). |
|
5607 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5608 |
"/ Transcript show:dir; space; showCR:cmd. |
|
5609 |
] |
|
5610 |
]. |
|
5611 |
prevDir := dir. |
|
5612 |
prevFiles := prevFiles,' ',file. |
|
4414 | 5613 |
]. |
12493 | 5614 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
5615 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5616 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5617 |
]. |
|
4107 | 5618 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 5619 |
filesToRemove size > 1 ifTrue:[ |
4414 | 5620 |
nameString := nameString, ' ...'. |
3892 | 5621 |
]. |
5622 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5623 |
! |
|
5624 |
||
5625 |
cvsRemoveFileAndCVSContainer |
|
12493 | 5626 |
|files| |
5627 |
||
5628 |
files := self currentSelectedFiles copy. |
|
5629 |
self removeFilesAndCVSContainers:files |
|
3892 | 5630 |
! |
5631 |
||
9338 | 5632 |
cvsRevisionLog |
5633 |
| cmd sel executionBlock nameString| |
|
5634 |
||
5635 |
sel := self currentSelectedObjects. |
|
5636 |
sel isEmpty ifTrue:[ ^ self ]. |
|
5637 |
||
5638 |
executionBlock := [:stream | |
|
5639 |
sel do:[:fn | |
|
5640 |
| dir nameArg | |
|
5641 |
||
5642 |
nameArg := '"',fn baseName,'"'. |
|
5643 |
dir := fn directory. |
|
5644 |
cmd := 'cvs log ' , nameArg. |
|
5645 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5646 |
] |
|
5647 |
]. |
|
5648 |
nameString := 'Command> cvs log'. |
|
5649 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5650 |
! |
|
5651 |
||
8562 | 5652 |
cvsTagSelection |
12856 | 5653 |
|tag tags cmd| |
5654 |
||
5655 |
tag := Dialog |
|
5656 |
request:(resources string:'Tag (possibly multiple, separated by ";"):') |
|
5657 |
initialAnswer:(CVSSourceCodeManager recentTag). |
|
5658 |
tag isEmptyOrNil ifTrue:[^ self ]. |
|
5659 |
||
5660 |
CVSSourceCodeManager recentTag:tag. |
|
8562 | 5661 |
|
5662 |
CVSSourceCodeManager notNil ifTrue:[ |
|
5663 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
5664 |
] ifFalse:[ |
|
5665 |
cmd := 'cvs'. |
|
5666 |
]. |
|
5667 |
||
12856 | 5668 |
tags := tag asCollectionOfSubstringsSeparatedByAny:',;'. |
5669 |
tags do:[:eachTag | |
|
5670 |
self executeCommand:('%1 tag -F "%2" %3' |
|
5671 |
bindWith:cmd |
|
12858 | 5672 |
with:(eachTag withoutSeparators) |
12856 | 5673 |
with:(self makeFileNameArgumentString)) |
5674 |
]. |
|
8562 | 5675 |
! |
5676 |
||
3892 | 5677 |
cvsUpdateAll |
5678 |
| cmd | |
|
5679 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5680 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5681 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5682 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5683 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5684 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5685 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5686 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 5687 |
! |
5688 |
||
5689 |
cvsUpdateAllRecursive |
|
5690 |
| cmd | |
|
5691 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5692 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5693 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5694 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5695 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5696 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5697 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 5698 |
! |
5699 |
||
5700 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5701 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5702 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5703 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5704 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5705 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5706 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5707 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5708 |
|
3892 | 5709 |
stream := WriteStream on:''. |
8563 | 5710 |
stream |
5711 |
nextPutAll:cmd; |
|
5712 |
nextPutAll:' upd '; |
|
5713 |
nextPutAll:(self makeFileNameArgumentString). |
|
5714 |
||
5715 |
self executeCommand:stream contents. |
|
5716 |
! |
|
5717 |
||
5718 |
makeFileNameArgumentString |
|
5719 |
|stream| |
|
5720 |
||
5721 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5722 |
self currentSelectedFiles do:[: file | |
8563 | 5723 |
stream nextPut:$". |
4414 | 5724 |
stream nextPutAll:file baseName. |
8563 | 5725 |
stream nextPutAll:'" '. |
5726 |
]. |
|
5727 |
^ stream contents. |
|
12493 | 5728 |
! |
5729 |
||
5730 |
removeFilesAndCVSContainers:files |
|
5731 |
|numFiles question aswer| |
|
5732 |
||
5733 |
(numFiles := files size) > 0 ifTrue:[ |
|
5734 |
numFiles > 1 ifTrue:[ |
|
5735 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
5736 |
] ifFalse:[ |
|
5737 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
5738 |
]. |
|
5739 |
||
5740 |
aswer := Dialog |
|
5741 |
confirm:question withCRs |
|
5742 |
yesLabel:(resources string:'Remove') |
|
5743 |
noLabel:(resources string:'Cancel'). |
|
5744 |
||
5745 |
aswer ifTrue:[ |
|
5746 |
self withActivityIndicationDo:[ |
|
5747 |
self cvsRemoveAndRemoveFromCVS:files |
|
5748 |
] |
|
5749 |
] |
|
5750 |
] |
|
3892 | 5751 |
! ! |
5752 |
||
11139 | 5753 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
5754 |
||
5755 |
mercurialAdd |
|
5756 |
|executionBlock sel maxCmdSize| |
|
5757 |
||
5758 |
maxCmdSize := 512. |
|
5759 |
||
5760 |
sel := self currentSelectedObjects. |
|
5761 |
sel isEmptyOrNil ifTrue:[ |
|
5762 |
^ self |
|
5763 |
]. |
|
5764 |
||
5765 |
executionBlock := |
|
5766 |
[:stream | |
|
5767 |
|prevDir cmd| |
|
5768 |
||
5769 |
prevDir := nil. |
|
5770 |
sel do:[:fn | |
|
5771 |
|nameArg dir| |
|
5772 |
||
5773 |
nameArg := '"',fn baseName,'"'. |
|
5774 |
dir := fn directory. |
|
5775 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
5776 |
"/ flush |
|
5777 |
cmd notNil ifTrue:[ |
|
5778 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5779 |
cmd := nil. |
|
5780 |
] |
|
5781 |
]. |
|
5782 |
cmd isNil ifTrue:[ |
|
5783 |
cmd := 'hg add'. |
|
5784 |
]. |
|
5785 |
cmd := cmd,' ',nameArg. |
|
5786 |
prevDir := dir. |
|
5787 |
]. |
|
5788 |
cmd notNil ifTrue:[ |
|
5789 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5790 |
cmd := nil. |
|
5791 |
]. |
|
5792 |
stream nextPutLine:'Commit to finish the transaction'. |
|
5793 |
]. |
|
5794 |
||
5795 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
5796 |
||
5797 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
5798 |
! |
|
5799 |
||
5800 |
mercurialCommit |
|
5801 |
|dir executionBlock| |
|
5802 |
||
5803 |
"/ dir := self currentDirectory. |
|
5804 |
dir := self directoryContentsBrowser directory. |
|
5805 |
executionBlock := |
|
5806 |
[:stream | |
|
5807 |
(self getExecutionBlockForCommand:'hg commit' |
|
5808 |
inDirectory:dir) value:stream. |
|
5809 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 5810 |
]. |
11139 | 5811 |
|
5812 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
5813 |
||
5814 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
5815 |
! |
|
5816 |
||
11144 | 5817 |
mercurialInit |
5818 |
|dir executionBlock| |
|
5819 |
||
5820 |
dir := self directoryContentsBrowser directory. |
|
5821 |
||
5822 |
(Dialog confirm:(resources |
|
5823 |
string:'Initialize new Mercurial Repository in %1?' |
|
5824 |
with:dir baseName)) ifFalse:[^ self]. |
|
5825 |
||
5826 |
executionBlock := |
|
5827 |
[:stream | |
|
5828 |
(self getExecutionBlockForCommand:('hg init') |
|
5829 |
inDirectory:dir) value:stream. |
|
5830 |
]. |
|
5831 |
||
5832 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
5833 |
||
5834 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
5835 |
! |
|
5836 |
||
11139 | 5837 |
mercurialPush |
5838 |
|destination dir executionBlock| |
|
5839 |
||
5840 |
destination := Dialog request:'Mercurial Repository' |
|
5841 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
5842 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
5843 |
||
5844 |
LastMercurialRepository := destination. |
|
5845 |
||
5846 |
dir := self directoryContentsBrowser directory. |
|
5847 |
executionBlock := |
|
5848 |
[:stream | |
|
5849 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
5850 |
inDirectory:dir) value:stream. |
|
5851 |
]. |
|
5852 |
||
5853 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
5854 |
||
5855 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
5856 |
! |
|
5857 |
||
5858 |
mercurialStatus |
|
5859 |
|executionBlock sel maxCmdSize| |
|
5860 |
||
5861 |
maxCmdSize := 512. |
|
5862 |
||
5863 |
sel := self currentSelectedObjects. |
|
5864 |
sel isEmptyOrNil ifTrue:[ |
|
5865 |
^ self |
|
5866 |
]. |
|
5867 |
||
5868 |
executionBlock := |
|
5869 |
[:stream | |
|
5870 |
|prevDir cmd| |
|
5871 |
||
5872 |
prevDir := nil. |
|
5873 |
sel do:[:fn | |
|
5874 |
|nameArg dir| |
|
5875 |
||
5876 |
nameArg := '"',fn baseName,'"'. |
|
5877 |
dir := fn directory. |
|
5878 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
5879 |
"/ flush |
|
5880 |
cmd notNil ifTrue:[ |
|
5881 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5882 |
cmd := nil. |
|
5883 |
] |
|
5884 |
]. |
|
5885 |
cmd isNil ifTrue:[ |
|
5886 |
cmd := 'hg status'. |
|
5887 |
]. |
|
5888 |
cmd := cmd,' ',nameArg. |
|
5889 |
prevDir := dir. |
|
5890 |
]. |
|
5891 |
cmd notNil ifTrue:[ |
|
5892 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5893 |
cmd := nil. |
|
5894 |
]. |
|
5895 |
]. |
|
5896 |
||
5897 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
5898 |
||
5899 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 5900 |
! ! |
5901 |
||
4849 | 5902 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 5903 |
|
8510 | 5904 |
allFilesInSelectedDirectoriesForWhich:aBlock |
5905 |
|directories allFiles| |
|
5906 |
||
5907 |
directories := self currentSelectedDirectories. |
|
5908 |
directories isEmpty ifTrue:[^ self]. |
|
5909 |
||
5910 |
allFiles := OrderedCollection new. |
|
5911 |
directories do:[:dir| |
|
5912 |
[ |
|
5913 |
|fileNames| |
|
5914 |
||
5915 |
fileNames := dir directoryContents. |
|
5916 |
fileNames notNil ifTrue:[ |
|
5917 |
fileNames := fileNames |
|
5918 |
collect:[:fn | dir construct:fn] |
|
5919 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
5920 |
allFiles addAll:fileNames. |
|
5921 |
] |
|
5922 |
] on:FileStream openErrorSignal do:[:ex| |
|
5923 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
5924 |
with:ex pathName |
|
5925 |
with:ex description). |
|
5926 |
ex proceedWith:nil. |
|
5927 |
]. |
|
5928 |
]. |
|
5929 |
||
5930 |
^ allFiles |
|
5931 |
! |
|
5932 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5933 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5934 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5935 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5936 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5937 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5938 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5939 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5940 |
"/ 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
|
5941 |
"/ 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
|
5942 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5943 |
conv := OrderedCollection new. |
4722 | 5944 |
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
|
5945 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5946 |
outSuffix = 'png' ifTrue:[ |
4722 | 5947 |
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
|
5948 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5949 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5950 |
outSuffix = 'gif' ifTrue:[ |
4722 | 5951 |
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
|
5952 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5953 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5954 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 5955 |
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
|
5956 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5957 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5958 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 5959 |
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
|
5960 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5961 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5962 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5963 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5964 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5965 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5966 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5967 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5968 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5969 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5970 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5971 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5972 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5973 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5974 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5975 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5976 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5977 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5978 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5979 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5980 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5981 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5982 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5983 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5984 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5985 |
|
4367 | 5986 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5987 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5988 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5989 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5990 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5991 |
self convertImageToSuffix:'jpg' |
4531 | 5992 |
! |
5993 |
||
5994 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5995 |
self convertImageToSuffix:'png' |
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 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
5998 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
5999 |
|outFile filesToConvert| |
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 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6002 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6003 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6004 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6005 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6006 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6007 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6008 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6009 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6010 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6011 |
outFile exists ifTrue:[ |
4722 | 6012 |
|answer| |
6013 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6014 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6015 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6016 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6017 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6018 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6019 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6020 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6021 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6022 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6023 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6024 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6025 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6026 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6027 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6028 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6029 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6030 |
] |
4721
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 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6033 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6034 |
self updateAndSelect:nil. |
4367 | 6035 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6036 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6037 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6038 |
self notify:nil. |
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 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6041 |
"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
|
6042 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6043 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6044 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6045 |
self convertImageToSuffix:'xpm' |
4367 | 6046 |
! |
6047 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6048 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
13121 | 6049 |
|inFile outFile chainOfConversions conversionStream |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6050 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6051 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6052 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
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 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6055 |
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
|
6056 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6057 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6058 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6059 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6060 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6061 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6062 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6063 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6064 |
eachConversionCommand == #readToXPM ifTrue:[ |
13121 | 6065 |
|image tempStreamXPM| |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6066 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6067 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6068 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6069 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6070 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6071 |
]. |
13121 | 6072 |
tempStreamXPM := FileStream newTemporaryWithSuffix:'xpm'. |
6073 |
XPMReader save:image onStream:tempStreamXPM. |
|
6074 |
tempStreamXPM close. |
|
6075 |
inFile := tempStreamXPM fileName. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6076 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6077 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6078 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6079 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6080 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6081 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6082 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6083 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6084 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
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 |
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
|
6087 |
|
13121 | 6088 |
outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6089 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6090 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6091 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6092 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6093 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6094 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6095 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6096 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6097 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6098 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6099 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6100 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6101 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6102 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6103 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6104 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6105 |
outFile delete. |
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 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6109 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6110 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6111 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6112 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6113 |
] ifCurtailed:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6114 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6115 |
outFile delete. |
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 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6118 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6119 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
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 |
|
3892 | 6122 |
createProjectAndOpenProjectBrowser |
6123 |
|nm f s directory| |
|
6124 |
||
6125 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6126 |
directory := self currentDirectory. |
3892 | 6127 |
nm := directory baseName. |
6128 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6129 |
f exists ifTrue:[ |
|
4414 | 6130 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6131 |
^ self. |
|
3892 | 6132 |
]. |
6133 |
s := f writeStream. |
|
6134 |
s nextPutAll:' |
|
6135 |
name ''' , nm , ''' |
|
6136 |
type #classLibrary |
|
6137 |
package #''private:' , nm , ''' |
|
6138 |
prerequisites nil |
|
6139 |
||
6140 |
classes #( ) |
|
6141 |
'. |
|
6142 |
s close. |
|
6143 |
ProjectBrowser openOnFile:f. |
|
6144 |
! |
|
6145 |
||
5880 | 6146 |
doExecuteCommand |
6147 |
"execute an OperatingSystem-command" |
|
6148 |
||
6149 |
| action fileName| |
|
6150 |
||
6151 |
fileName := self firstSelectedFile. |
|
6152 |
action := [:command | |
|
6153 |
self addToCommandHistory:command for:fileName. |
|
6154 |
self executeCommand:command. |
|
6155 |
]. |
|
6156 |
self askForCommandFor:fileName thenDo:action |
|
6157 |
! |
|
6158 |
||
6159 |
doExecuteScript |
|
6160 |
"execute a smalltalk script" |
|
6161 |
||
6162 |
|textHolder dialog template dummyClass dummyInstance| |
|
6163 |
||
6164 |
template := |
|
6165 |
'"/ Smalltalk script: |
|
6166 |
||
6167 |
"/ the following variables are accessable: |
|
6168 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
6169 |
"/ selectedFiles (= ...) |
|
6170 |
"/ |
|
6171 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6172 |
"/ |
|
6173 |
"/ Useful operations are: |
|
6174 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6175 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6176 |
"/ directory directory |
|
6177 |
"/ |
|
6178 |
"/ example: move all files which match a aarticular pattern to |
|
6179 |
"/ a separate directory: |
|
6180 |
"/ |
|
6181 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6182 |
"/ |
|
6183 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6184 |
"/ |
|
6185 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6186 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6187 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6188 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6189 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6190 |
"/ newDir := directory construct:prefix. |
|
6191 |
"/ newDir exists ifFalse:[ |
|
6192 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6193 |
"/ newDir makeDirectory. |
|
6194 |
"/ ]. |
|
6195 |
"/ ]. |
|
6196 |
"/ newDir exists ifTrue:[ |
|
6197 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6198 |
"/ newFile := newDir construct:rest. |
|
6199 |
"/ oldFile moveTo:newFile |
|
6200 |
"/ ] |
|
6201 |
"/ ] |
|
6202 |
"/ ] |
|
6203 |
'. |
|
6204 |
||
6205 |
LastScriptBlockString isNil ifTrue:[ |
|
6206 |
LastScriptBlockString := template. |
|
6207 |
]. |
|
6208 |
||
6209 |
textHolder := ValueHolder new. |
|
6210 |
dialog := Dialog |
|
6211 |
forRequestText:(resources string:'Enter script') |
|
6212 |
editViewClass:CodeView |
|
6213 |
lines:25 |
|
6214 |
columns:70 |
|
6215 |
initialAnswer:LastScriptBlockString |
|
6216 |
model:textHolder. |
|
6217 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6218 |
dialog open. |
|
6219 |
dialog accepted ifFalse:[^ self]. |
|
6220 |
||
6221 |
LastScriptBlockString := textHolder value. |
|
6222 |
||
6223 |
Class classConventionViolationConfirmationQuerySignal |
|
6224 |
answer:true |
|
6225 |
do:[ |
|
6226 |
dummyClass := Object class |
|
6227 |
name:#Dummy |
|
6228 |
inEnvironment:nil |
|
6229 |
subclassOf:Object |
|
6230 |
instanceVariableNames:'directory selectedFiles' |
|
6231 |
variable:false |
|
6232 |
words:true |
|
6233 |
pointers:true |
|
6234 |
classVariableNames:'' |
|
6235 |
poolDictionaries:'' |
|
6236 |
category:#dummyCategory |
|
6237 |
comment:nil |
|
6238 |
changed:true. |
|
6239 |
]. |
|
6240 |
||
6241 |
dummyInstance := dummyClass basicNew. |
|
6242 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6243 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6244 |
||
6245 |
Compiler |
|
6246 |
evaluate:textHolder value |
|
6247 |
in:nil |
|
6248 |
receiver:dummyInstance |
|
6249 |
notifying:nil |
|
6250 |
logged:false |
|
6251 |
ifFail:[] |
|
6252 |
compile:true. |
|
6253 |
||
6254 |
"/ fileName := self firstSelectedFile. |
|
6255 |
"/ action := [:command | |
|
6256 |
"/ self addToCommandHistory:command for:fileName. |
|
6257 |
"/ self executeCommand:command. |
|
6258 |
"/ ]. |
|
6259 |
"/ self askForCommandFor:fileName thenDo:action |
|
6260 |
! |
|
6261 |
||
4230 | 6262 |
doMake |
7938 | 6263 |
|dir cmd| |
4230 | 6264 |
|
6265 |
cmd := 'make'. |
|
7938 | 6266 |
dir := self theSingleSelectedDirectoryOrNil. |
6267 |
||
6268 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6269 |
dir notNil ifTrue:[ |
|
6270 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
6271 |
cmd := 'bmake.bat'. |
|
6272 |
] |
|
6273 |
] |
|
6274 |
]. |
|
4230 | 6275 |
self executeCommand:cmd. |
6276 |
! |
|
6277 |
||
8256 | 6278 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6279 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6280 |
(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
|
6281 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6282 |
|
8256 | 6283 |
|destDir| |
6284 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6285 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6286 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6287 |
]. |
8256 | 6288 |
destDir := self currentDirectory. |
6289 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6290 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6291 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6292 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6293 |
! |
6294 |
||
7829 | 6295 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6296 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6297 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6298 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 6299 |
! |
6300 |
||
12473 | 6301 |
doOpenFinder |
6302 |
self currentDirectory asFilename openFinder |
|
6303 |
||
6304 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
6305 |
! |
|
6306 |
||
12811 | 6307 |
doOpenMonticelloBrowser |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6308 |
MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello']. |
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6309 |
|
12811 | 6310 |
self withWaitCursorDo:[ |
6311 |
self currentSelectedFiles do:[:fn | |
|
6312 |
|version snapshot| |
|
6313 |
||
6314 |
fn suffix asLowercase = 'mcz' ifTrue:[ |
|
6315 |
version := MCMczReader versionFromFile:fn. |
|
6316 |
snapshot := version snapshot. |
|
6317 |
(Tools::ChangeSetBrowser2 |
|
6318 |
on: snapshot asChangeSet |
|
6319 |
label: version info name) |
|
6320 |
beTwoColumn; |
|
6321 |
targetNamespace:nil; |
|
6322 |
targetPackage:nil; |
|
6323 |
open |
|
6324 |
] |
|
6325 |
] |
|
6326 |
] |
|
6327 |
! |
|
6328 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6329 |
doOpenSettings |
8168 | 6330 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6331 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6332 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6333 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6334 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6335 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6336 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6337 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6338 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6339 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6340 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6341 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6342 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6343 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6344 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6345 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6346 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6347 |
|
7104 | 6348 |
editMode:aSymbol |
6349 |
self |
|
6350 |
applicationNamed:#FileApplicationNoteBook |
|
6351 |
ifPresentDo:[:appl | |
|
6352 |
|subApp| |
|
6353 |
||
6354 |
subApp := appl selectedApplication. |
|
6355 |
subApp notNil ifTrue:[ |
|
6356 |
^ subApp perform:aSymbol |
|
6357 |
] |
|
6358 |
]. |
|
6359 |
||
6360 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
6361 |
! |
|
6362 |
||
6363 |
editModeInsert |
|
6364 |
self editMode:#editModeInsert |
|
6365 |
||
6366 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
6367 |
! |
|
6368 |
||
6369 |
editModeInsertAndSelect |
|
6370 |
self editMode:#editModeInsertAndSelect |
|
6371 |
||
6372 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
6373 |
! |
|
6374 |
||
6375 |
editModeOverwrite |
|
6376 |
self editMode:#editModeOverwrite |
|
6377 |
||
6378 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
6379 |
! |
|
6380 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6381 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6382 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6383 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6384 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6385 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6386 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6387 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
11889 | 6388 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6389 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6390 |
]. |
11889 | 6391 |
(Dialog confirm:(resources string:'File is big - proceed ?')) ifFalse:[^ self]. |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6392 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6393 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6394 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6395 |
|
3892 | 6396 |
fileFileIn |
6397 |
"fileIn the selected file(s)" |
|
6398 |
||
6399 |
self fileFileInLazy:false |
|
6400 |
! |
|
6401 |
||
7324 | 6402 |
fileFileIn:aFilename lazy:lazy |
6403 |
"fileIn a file" |
|
6404 |
||
6405 |
self withActivityIndicationDo:[ |
|
6406 |
self notify:('File in:', aFilename asFilename baseName). |
|
6407 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6408 |
self notify:nil. |
|
6409 |
] |
|
6410 |
||
6411 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
6412 |
! |
|
6413 |
||
3892 | 6414 |
fileFileInLazy |
6415 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
6416 |
||
6417 |
self fileFileInLazy:true |
|
6418 |
! |
|
6419 |
||
6420 |
fileFileInLazy:lazy |
|
6421 |
"fileIn the selected file(s)" |
|
6422 |
||
7324 | 6423 |
self currentSelectedFiles do:[:fileName | |
6424 |
self fileIn:fileName lazy:lazy |
|
6425 |
]. |
|
6426 |
||
6427 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 6428 |
! |
6429 |
||
12497 | 6430 |
fileFileInPackage |
6431 |
"assuming the current directory is a package directory, load it" |
|
6432 |
||
6433 |
|packageDir dir path top packageID| |
|
6434 |
||
6435 |
"/ find a reasonable package-id (walk up until we find stx) |
|
6436 |
path := ''. |
|
6437 |
dir := packageDir := self currentDirectory. |
|
6438 |
||
6439 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
6440 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
6441 |
path := dir baseName , '/' , path. |
|
6442 |
dir := dir directory. |
|
6443 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6444 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 6445 |
"/ should ask the user for a packageID and proceed... |
6446 |
^ self. |
|
6447 |
]. |
|
6448 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6449 |
packageID := path copyButLast:1. |
12497 | 6450 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
6451 |
! |
|
6452 |
||
3892 | 6453 |
fileFileInToNameSpace |
6454 |
"fileIn the selected file(s)<into a nameSpace" |
|
6455 |
||
6456 |
|ns listOfKnownNameSpaces| |
|
6457 |
||
6458 |
listOfKnownNameSpaces := Set new. |
|
6459 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
6460 |
allNameSpaces |
4414 | 6461 |
do:[:eachNameSpace | |
6462 |
listOfKnownNameSpaces add:eachNameSpace name |
|
6463 |
]. |
|
3892 | 6464 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
6465 |
||
6466 |
ns := Dialog |
|
4414 | 6467 |
request:'During fileIn, new classes are created in nameSpace:' |
6468 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
6469 |
list:listOfKnownNameSpaces. |
|
3892 | 6470 |
ns isEmptyOrNil ifTrue:[^ self]. |
6471 |
||
6472 |
LastEnforcedNameSpace := ns. |
|
6473 |
ns := NameSpace name:ns. |
|
6474 |
||
6475 |
Class nameSpaceQuerySignal |
|
4414 | 6476 |
answer:ns |
6477 |
do:[ |
|
6478 |
self fileFileInLazy:false |
|
6479 |
] |
|
3892 | 6480 |
! |
6481 |
||
6482 |
fileFindAllDuplicates |
|
6483 |
"scan directory and all subdirs for duplicate files" |
|
6484 |
||
6485 |
|fileNames dir infoDir filesBySize |
|
6486 |
result info dirPrefix myName stream textBox maxLength directories| |
|
6487 |
||
6488 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6489 |
self withActivityIndicationDo:[ |
4414 | 6490 |
result := Dictionary new. |
6491 |
myName := self class name asString. |
|
6492 |
directories := self currentSelectedDirectories. |
|
6493 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 6494 |
|
4414 | 6495 |
dir := directories first. |
3892 | 6496 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6497 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6498 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6499 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 6500 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
6501 |
with:ex pathName |
|
6502 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6503 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6504 |
]. |
4765 | 6505 |
fileNames := fileNames |
6506 |
collect:[:fn | dir construct:fn] |
|
6507 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 6508 |
|
6509 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 6510 |
infoDir := Dictionary new. |
6511 |
fileNames do:[:fn | |
|
6512 |
infoDir at:fn put:(fn fileSize) |
|
6513 |
]. |
|
6514 |
||
6515 |
"/ for each, get the files size. |
|
6516 |
"/ in a first pass, look for files of the same size and |
|
6517 |
"/ compare them ... |
|
3892 | 6518 |
|
6519 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 6520 |
filesBySize := Dictionary new. |
6521 |
infoDir keysAndValuesDo:[:fn :sz | |
|
6522 |
|entry| |
|
6523 |
||
6524 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6525 |
entry add:fn. |
|
6526 |
]. |
|
6527 |
||
6528 |
"/ any of same size ? |
|
3892 | 6529 |
|
6530 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 6531 |
filesBySize do:[:entry | |
6532 |
|files| |
|
6533 |
||
6534 |
entry size > 1 ifTrue:[ |
|
6535 |
files := entry asArray. |
|
6536 |
1 to:files size-1 do:[:idx1 | |
|
6537 |
idx1+1 to:files size do:[:idx2 | |
|
6538 |
|fn1 fn2| |
|
6539 |
||
6540 |
fn1 := files at:idx1. |
|
6541 |
fn2 := files at:idx2. |
|
3892 | 6542 |
|
6543 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 6544 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
6545 |
"/ compare the files |
|
6546 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6547 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 6548 |
result at:fn1 put:fn2. |
6549 |
] |
|
6550 |
] |
|
6551 |
] |
|
6552 |
] |
|
6553 |
] |
|
6554 |
]. |
|
3892 | 6555 |
|
6556 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 6557 |
dirPrefix := dir pathName. |
6558 |
result := result associations. |
|
6559 |
result := result collect:[:assoc | |
|
6560 |
|f1 f2| |
|
6561 |
||
6562 |
f1 := assoc key name. |
|
6563 |
f2 := assoc value name. |
|
6564 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
6565 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
6566 |
]. |
|
6567 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
6568 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
6569 |
]. |
|
6570 |
f1 < f2 ifTrue:[ |
|
6571 |
f2 -> f1 |
|
6572 |
] ifFalse:[ |
|
6573 |
f1 -> f2 |
|
6574 |
] |
|
6575 |
]. |
|
6576 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
6577 |
||
6578 |
info := OrderedCollection new. |
|
6579 |
result do:[:assoc | |
|
6580 |
info add:(assoc key , ' same as ' , assoc value) |
|
6581 |
]. |
|
6582 |
info isEmpty ifTrue:[ |
|
11889 | 6583 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 6584 |
^ self. |
4414 | 6585 |
]. |
3892 | 6586 |
]. |
6587 |
||
6588 |
stream := WriteStream on:''. |
|
11688 | 6589 |
stream nextPutAllLines:info. |
5542 | 6590 |
|
3892 | 6591 |
textBox := TextBox new. |
6592 |
textBox initialText:(stream contents). |
|
5542 | 6593 |
stream close. |
11889 | 6594 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 6595 |
textBox readOnly:true. |
6596 |
textBox noCancel. |
|
11889 | 6597 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 6598 |
maxLength := 10. |
6599 |
info do:[: el | |
|
4414 | 6600 |
maxLength := maxLength max:(el size). |
3892 | 6601 |
]. |
6602 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 6603 |
textBox maxExtent:Screen current extent. |
6604 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6605 |
|
11688 | 6606 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 6607 |
! |
6608 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6609 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6610 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6611 |
|
10306 | 6612 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6613 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6614 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6615 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6616 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6617 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6618 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6619 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6620 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6621 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6622 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6623 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6624 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6625 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6626 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6627 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6628 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6629 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6630 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6631 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6632 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6633 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6634 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6635 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6636 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6637 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6638 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6639 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
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 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6642 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6643 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6644 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6645 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6646 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6647 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6648 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6649 |
stream := WriteStream on:''. |
10306 | 6650 |
stream nextPutLine:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6651 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6652 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6653 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6654 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6655 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6656 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6657 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6658 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6659 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6660 |
]. |
10306 | 6661 |
stream nextPutLine:'Files without duplicates:'. |
6662 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6663 |
do:[:origFile | |
|
6664 |
|sameFiles| |
|
6665 |
||
6666 |
sameFiles := samePerFile at:origFile. |
|
6667 |
sameFiles isEmpty ifTrue:[ |
|
6668 |
stream nextPutLine:origFile baseName. |
|
6669 |
]. |
|
6670 |
]. |
|
6671 |
||
6672 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
6673 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
6674 |
LastMustMatchPattern := mustHaveMatches. |
|
6675 |
||
6676 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
6677 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6678 |
do:[:origFile | |
|
6679 |
|sameFiles| |
|
6680 |
||
6681 |
sameFiles := samePerFile at:origFile. |
|
6682 |
sameFiles notEmpty ifTrue:[ |
|
6683 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
6684 |
stream nextPutLine:origFile baseName. |
|
6685 |
] |
|
6686 |
]. |
|
6687 |
]. |
|
6688 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6689 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6690 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6691 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6692 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6693 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6694 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6695 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6696 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6697 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6698 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6699 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6700 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6701 |
|
3892 | 6702 |
fileFindDuplicates |
6703 |
"scan directory for duplicate files" |
|
6704 |
||
8510 | 6705 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
6706 |
||
6707 |
directories := self currentSelectedDirectories. |
|
3892 | 6708 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6709 |
self withActivityIndicationDo:[ |
4355 | 6710 |
result := Dictionary new. |
6711 |
||
6712 |
directories := self currentSelectedDirectories. |
|
6713 |
directories isEmpty ifTrue:[^ self]. |
|
6714 |
||
8510 | 6715 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 6716 |
|
6717 |
infoDir := Dictionary new. |
|
6718 |
allFiles do:[:fn | |
|
6719 |
infoDir at:fn put:(fn info) |
|
6720 |
]. |
|
6721 |
||
6722 |
"/ for each, get the files size. |
|
6723 |
"/ in a first pass, look for files of the same size and |
|
6724 |
"/ compare them ... |
|
6725 |
||
6726 |
filesBySize := Dictionary new. |
|
6727 |
infoDir keysAndValuesDo:[:fn :info | |
|
6728 |
|sz entry| |
|
6729 |
||
6730 |
sz := info size. |
|
6731 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6732 |
entry add:fn. |
|
6733 |
]. |
|
6734 |
||
6735 |
"/ any of same size ? |
|
6736 |
||
6737 |
filesBySize do:[:entry | |
|
6738 |
|files| |
|
6739 |
||
6740 |
entry size > 1 ifTrue:[ |
|
6741 |
files := entry asArray. |
|
6742 |
1 to:files size-1 do:[:idx1 | |
|
6743 |
idx1+1 to:files size do:[:idx2 | |
|
6744 |
|fn1 fn2| |
|
6745 |
||
6746 |
fn1 := files at:idx1. |
|
6747 |
fn2 := files at:idx2. |
|
6748 |
||
6749 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
6750 |
"/ compare the files |
|
6751 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6752 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 6753 |
result at:fn1 put:fn2. |
6754 |
] |
|
6755 |
] |
|
6756 |
] |
|
6757 |
] |
|
6758 |
] |
|
6759 |
]. |
|
6760 |
||
6761 |
result := result associations. |
|
6762 |
result := result collect:[:assoc | |
|
6763 |
|f1 f2| |
|
6764 |
||
6765 |
f1 := assoc key asString. |
|
6766 |
f2 := assoc value asString. |
|
6767 |
f1 < f2 ifTrue:[ |
|
6768 |
f2 -> f1 |
|
6769 |
] ifFalse:[ |
|
6770 |
f1 -> f2 |
|
6771 |
] |
|
6772 |
]. |
|
5789 | 6773 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
6774 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 6775 |
|
6776 |
info := OrderedCollection new. |
|
6777 |
size := self getBestDirectory asString size. |
|
6778 |
result do:[:assoc | |
|
6779 |
|fn1 fn2| |
|
6780 |
||
6781 |
fn1 := assoc key. |
|
6782 |
fn2 := assoc value. |
|
6783 |
size > 1 ifTrue:[ |
|
6784 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
6785 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
6786 |
]. |
|
6787 |
(fn1 includes:Character space) ifTrue:[ |
|
6788 |
fn1 := '"' , fn1 , '"' |
|
6789 |
]. |
|
6790 |
(fn2 includes:Character space) ifTrue:[ |
|
6791 |
fn2 := '"' , fn2 , '"' |
|
6792 |
]. |
|
6793 |
info add:(fn1 , ' same as ' , fn2) |
|
6794 |
]. |
|
6795 |
info isEmpty ifTrue:[ |
|
5543 | 6796 |
Dialog information:'No duplicate files found.'. |
6797 |
^ self. |
|
4355 | 6798 |
]. |
3892 | 6799 |
]. |
6800 |
stream := WriteStream on:''. |
|
11688 | 6801 |
stream nextPutAllLines:info. |
6802 |
||
3892 | 6803 |
titleStream := WriteStream on:''. |
12602 | 6804 |
titleStream nextPutAll:'File duplicates in directory'. |
3892 | 6805 |
directories size == 1 ifTrue:[ |
12602 | 6806 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 6807 |
] ifFalse:[ |
4535 | 6808 |
titleStream nextPutLine:'ies: '. |
4355 | 6809 |
directories do:[:dir| |
6810 |
size > 1 ifTrue:[ |
|
6811 |
titleStream nextPutAll:'..'. |
|
4535 | 6812 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 6813 |
] ifFalse:[ |
4535 | 6814 |
titleStream nextPutLine:(dir asString). |
4355 | 6815 |
]. |
6816 |
] |
|
3892 | 6817 |
]. |
5543 | 6818 |
|
3892 | 6819 |
textBox := TextBox new. |
6820 |
textBox initialText:(stream contents). |
|
6821 |
textBox title:(titleStream contents). |
|
6822 |
textBox readOnly:true. |
|
6823 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6824 |
stream := WriteStream on:'Duplicates in '. |
4170 | 6825 |
directories do:[ :aDirectory | |
4355 | 6826 |
stream nextPutAll:aDirectory baseName. |
6827 |
stream space. |
|
4050 | 6828 |
]. |
4170 | 6829 |
textBox label:stream contents. |
3892 | 6830 |
maxLength := 10. |
6831 |
info do:[: el | |
|
4355 | 6832 |
maxLength := maxLength max:(el size). |
3892 | 6833 |
]. |
5092 | 6834 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
6835 |
textBox maxExtent:Screen current extent. |
|
4355 | 6836 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6837 |
|
11688 | 6838 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 6839 |
! |
6840 |
||
6841 |
fileFindFile |
|
5961 | 6842 |
|filename| |
6843 |
||
6844 |
filename := self firstSelectedFileName. |
|
6845 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6846 |
filename := Filename homeDirectory. |
3892 | 6847 |
]. |
4101 | 6848 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 6849 |
! |
6850 |
||
8510 | 6851 |
fileFindSimilarImages |
6852 |
"scan directory for similar image files" |
|
6853 |
||
8512 | 6854 |
|result stream textBox directories imageFiles histogramsV histogramsH |
6855 |
similarV similarH similar alreadyPrinted| |
|
8510 | 6856 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6857 |
self withWaitCursorDo:[ |
8510 | 6858 |
self withActivityIndicationDo:[ |
6859 |
result := Dictionary new. |
|
6860 |
||
6861 |
directories := self currentSelectedDirectories. |
|
6862 |
directories isEmpty ifTrue:[^ self]. |
|
6863 |
||
6864 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImage]. |
|
8511 | 6865 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
6866 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
6867 |
||
8510 | 6868 |
"/ for each, get the color histogram |
6869 |
histogramsV := Dictionary new. |
|
6870 |
histogramsH := Dictionary new. |
|
6871 |
imageFiles do:[:fn | |
|
6872 |
|hist image| |
|
6873 |
||
6874 |
image := Image fromFile:fn. |
|
6875 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
6876 |
hist := ImageColorHistogram new forImage:image. |
|
6877 |
histogramsV at:fn put:(hist histogramVectorV). |
|
6878 |
histogramsH at:fn put:(hist histogramVectorH). |
|
6879 |
]. |
|
6880 |
||
6881 |
similarH := Dictionary new. |
|
6882 |
similarV := Dictionary new. |
|
6883 |
similar := Dictionary new. |
|
6884 |
||
8512 | 6885 |
(self firstSelectedFile notNil |
6886 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
6887 |
ifFalse:[ imageFiles ]) |
|
6888 |
do:[:eachFile1 | |
|
8510 | 6889 |
|setOfSimilar distancesV distancesH| |
6890 |
||
6891 |
distancesV := OrderedCollection new. |
|
6892 |
distancesH := OrderedCollection new. |
|
6893 |
setOfSimilar := OrderedCollection new. |
|
6894 |
||
6895 |
imageFiles do:[:eachFile2 | |
|
6896 |
|v1 v2 dV dH| |
|
6897 |
||
6898 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
6899 |
v1 := histogramsV at:eachFile1. |
|
6900 |
v2 := histogramsV at:eachFile2. |
|
6901 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
6902 |
distancesV add:(eachFile2 -> dV). |
|
6903 |
v1 := histogramsH at:eachFile1. |
|
6904 |
v2 := histogramsH at:eachFile2. |
|
6905 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
6906 |
distancesH add:(eachFile2 -> dH). |
|
6907 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 6908 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 6909 |
]. |
6910 |
] |
|
6911 |
]. |
|
6912 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
6913 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
6914 |
similarV at:eachFile1 put:distancesV. |
|
6915 |
similarH at:eachFile1 put:distancesH. |
|
6916 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
6917 |
]. |
|
6918 |
||
6919 |
similar isEmpty ifTrue:[ |
|
6920 |
Dialog information:'No similarities found.'. |
|
6921 |
^ self. |
|
6922 |
]. |
|
6923 |
]. |
|
6924 |
||
6925 |
stream := WriteStream on:''. |
|
8512 | 6926 |
alreadyPrinted := Set new. |
6927 |
||
6928 |
imageFiles do:[:eachFile | |
|
6929 |
|eachSet| |
|
6930 |
||
6931 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
6932 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
6933 |
eachSet notNil ifTrue:[ |
|
6934 |
stream nextPutLine:eachFile pathName. |
|
6935 |
eachSet do:[:info | |
|
6936 |
|fn2 dist| |
|
6937 |
||
6938 |
fn2 := info key. |
|
6939 |
dist := info value. |
|
6940 |
stream nextPutAll:' '. |
|
6941 |
stream nextPutAll:fn2 pathName. |
|
6942 |
stream nextPutLine:' (',dist printString,')'. |
|
6943 |
alreadyPrinted add:fn2. |
|
6944 |
]. |
|
6945 |
stream cr. |
|
6946 |
]. |
|
8510 | 6947 |
]. |
6948 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6949 |
]. |
8510 | 6950 |
|
6951 |
textBox := TextBox new. |
|
6952 |
textBox initialText:(stream contents). |
|
6953 |
textBox title:'File similarities:'. |
|
6954 |
textBox readOnly:true. |
|
6955 |
textBox noCancel. |
|
6956 |
||
6957 |
textBox label:'File similarities'. |
|
6958 |
textBox extent:(400@((similar size max:40)* 10)). |
|
6959 |
textBox maxExtent:Screen current extent. |
|
6960 |
textBox openModeless. "/ showAtPointer. |
|
6961 |
||
6962 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
6963 |
! |
|
6964 |
||
4618 | 6965 |
fileHexDump |
6966 |
||
6967 |
| file item| |
|
6968 |
||
6969 |
file := self firstSelectedFile. |
|
6970 |
file notNil ifTrue:[ |
|
6971 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 6972 |
self |
6973 |
applicationNamed:#FileApplicationNoteBook |
|
6974 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 6975 |
]. |
6976 |
! |
|
6977 |
||
7324 | 6978 |
fileIn:aFilename |
6979 |
"fileIn a file" |
|
6980 |
||
6981 |
self fileIn:aFilename lazy:false |
|
6982 |
||
6983 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
6984 |
! |
|
6985 |
||
6986 |
fileIn:aFilename lazy:lazy |
|
6987 |
"fileIn a file" |
|
6988 |
||
6989 |
self withActivityIndicationDo:[ |
|
6990 |
self notify:('File in:', aFilename asFilename baseName). |
|
6991 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6992 |
self notify:nil. |
|
6993 |
] |
|
6994 |
||
6995 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
6996 |
! |
|
6997 |
||
4930 | 6998 |
filterSelectedFiles:whichFilter |
6999 |
|selectedFiles numFiles msg filterBlock| |
|
7000 |
||
7560 | 7001 |
selectedFiles := self currentSelectedObjects. |
4930 | 7002 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7003 |
||
7004 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7005 |
numFiles > 1 ifTrue:[ |
|
7006 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7007 |
]. |
|
7008 |
||
7009 |
(Dialog |
|
6352 | 7010 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7011 |
initialAnswer:false |
7012 |
) ifFalse:[ |
|
7013 |
^ self |
|
7014 |
]. |
|
7015 |
||
7016 |
whichFilter == #rot13 ifTrue:[ |
|
7017 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7018 |
]. |
|
7019 |
"/ add more here... |
|
7020 |
||
7021 |
filterBlock isNil ifTrue:[ |
|
7022 |
self information:'No such filter: ' , whichFilter. |
|
7023 |
^ self. |
|
7024 |
]. |
|
7025 |
||
7026 |
selectedFiles do:[:fileName | |
|
7027 |
|s| |
|
7028 |
||
7029 |
self notify:('Processing:', fileName baseName). |
|
7030 |
fileName isDirectory ifFalse:[ |
|
7031 |
[ |
|
7032 |
|inFile outFile in out| |
|
7033 |
||
7034 |
inFile := fileName asFilename. |
|
7035 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7036 |
||
7037 |
[ |
|
7038 |
|charIn charOut| |
|
7039 |
||
7040 |
in := inFile readStream. |
|
7041 |
out := outFile writeStream. |
|
7042 |
[in atEnd] whileFalse:[ |
|
7043 |
charIn := in next. |
|
7044 |
charOut := filterBlock value:charIn. |
|
7045 |
out nextPut:charOut. |
|
7046 |
]. |
|
13683 | 7047 |
out close. out:= nil. |
4930 | 7048 |
outFile renameTo:inFile. |
7049 |
] ensure:[ |
|
7050 |
out notNil ifTrue:[ out close ]. |
|
7051 |
in notNil ifTrue:[ in close ]. |
|
7052 |
outFile delete. |
|
7053 |
] |
|
7054 |
] on:FileStream openErrorSignal do:[:ex| |
|
7055 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7056 |
]. |
|
7057 |
] |
|
7058 |
]. |
|
6190 | 7059 |
self notify:nil. |
7560 | 7060 |
|
7061 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7062 |
! |
7063 |
||
9784 | 7064 |
forEachParsedXmlFileDo:aBlock |
7065 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7066 |
||
7067 |
self withActivityIndicationDo:[ |
|
7068 |
| selectedFiles xmlDocument | |
|
7069 |
||
7070 |
selectedFiles:= self currentSelectedFiles. |
|
7071 |
selectedFiles do:[:fileName | |
|
7072 |
XML::XMLSignal handle:[:ex | |
|
7073 |
Dialog information:('Error while reading XML:\ %1' bindWith:ex description) withCRs. |
|
7074 |
^ self. |
|
7075 |
] do:[ |
|
7076 |
|s d magic encoder document| |
|
7077 |
||
7078 |
s := fileName asFilename readStream. |
|
7079 |
s binary. |
|
7080 |
magic := (s next:2). |
|
7081 |
magic = #[254 255] ifTrue:[ |
|
7082 |
"/ UTF16BE |
|
7083 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7084 |
] ifFalse:[ |
|
7085 |
magic = #[255 254] ifTrue:[ |
|
7086 |
"/ UTF16LE |
|
7087 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7088 |
]. |
|
7089 |
]. |
|
7090 |
s close. |
|
7091 |
||
7092 |
document notNil ifTrue:[ |
|
7093 |
xmlDocument := XML::XMLParser |
|
7094 |
processDocumentString:document |
|
7095 |
beforeScanDo:[:parse| parse validate:false]. |
|
7096 |
] ifFalse:[ |
|
7097 |
xmlDocument := XML::XMLParser |
|
7098 |
processDocumentInFilename:fileName |
|
7099 |
beforeScanDo:[:parse| parse validate:false]. |
|
7100 |
] |
|
7101 |
]. |
|
7102 |
aBlock value:xmlDocument. |
|
7103 |
]. |
|
7104 |
] |
|
7105 |
||
7106 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7107 |
! |
|
7108 |
||
8832 | 7109 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7110 |
|numItems path files| |
|
7111 |
||
7112 |
files := self currentSelectedFiles. |
|
7113 |
||
7114 |
(numItems := files size) > 2 ifTrue:[ |
|
7115 |
(self |
|
7116 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7117 |
with:numItems)) ifFalse:[^ self]. |
|
7118 |
]. |
|
7119 |
||
7120 |
self withActivityIndicationDo:[ |
|
7121 |
files do:[:fileName | |
|
7122 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7123 |
fileName isAbsolute ifTrue:[ |
|
7124 |
path := fileName getName. |
|
7125 |
] ifFalse:[ |
|
7126 |
path := fileName pathName. |
|
7127 |
]. |
|
7128 |
aBlock value:path |
|
7129 |
] |
|
7130 |
]. |
|
7131 |
]. |
|
7132 |
! |
|
7133 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7134 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7135 |
"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
|
7136 |
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
|
7137 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7138 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7139 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7140 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7141 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7142 |
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
|
7143 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7144 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7145 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7146 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7147 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7148 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7149 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7150 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7151 |
]. |
13677 | 7152 |
self updateCurrentDirectoryWithReread. |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7153 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7154 |
] |
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 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7157 |
generateSignaturesForSelectedFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7158 |
"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
|
7159 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7160 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7161 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7162 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7163 |
|
8646 | 7164 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7165 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7166 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7167 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7168 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7169 |
]. |
13677 | 7170 |
self updateCurrentDirectoryWithReread. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7171 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7172 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7173 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7174 |
|
9784 | 7175 |
inspectXmlFile |
7176 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7177 |
a plain inspector on the XML tree" |
|
7178 |
||
7179 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7180 |
XML::XMLInspector notNil ifTrue:[ |
|
7181 |
XML::XMLInspector openOn:xmlDocument. |
|
7182 |
] ifFalse:[ |
|
7183 |
"fall back..." |
|
7184 |
xmlDocument inspect. |
|
7185 |
] |
|
7186 |
]. |
|
7187 |
||
7188 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7189 |
! |
|
7190 |
||
3892 | 7191 |
installAllAsAutoloaded |
7192 |
"install all classes found here as autoloaded classes" |
|
7193 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7194 |
self installAllAsAutoloadedRecursive:false |
3892 | 7195 |
! |
7196 |
||
6521 | 7197 |
installAllAsAutoloadedRecursive |
7198 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7199 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7200 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7201 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7202 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7203 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7204 |
"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
|
7205 |
|
6521 | 7206 |
[ |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7207 |
|installAction| |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7208 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7209 |
installAction := |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7210 |
[:fn | |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7211 |
(fn suffix = 'st') ifTrue:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7212 |
self notify:('Install as autoloaded: ', fn baseName). |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7213 |
self installAsAutoloaded:fn. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7214 |
] |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7215 |
]. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7216 |
|
6521 | 7217 |
self withActivityIndicationDo:[ |
6725 | 7218 |
self currentSelectedDirectories do:[:dir| |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7219 |
aBoolean ifTrue:[ |
9675
704831da3132
changed: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9674
diff
changeset
|
7220 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7221 |
] ifFalse:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7222 |
dir directoryContentsAsFilenamesDo:installAction |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7223 |
]. |
6521 | 7224 |
]. |
7225 |
self notify:nil. |
|
7226 |
] |
|
7227 |
] fork. |
|
7228 |
! |
|
7229 |
||
3892 | 7230 |
installAsAutoloaded:aFilename |
7231 |
"install aFilename as autoloaded class" |
|
7232 |
||
13292 | 7233 |
Smalltalk installAutoloadedClassFromSourceFile:aFilename |
7234 |
||
7235 |
"Modified: / 01-08-2013 / 16:58:09 / cg" |
|
3892 | 7236 |
! |
7237 |
||
4558 | 7238 |
joinSelectedFiles |
6264 | 7239 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 7240 |
|
7560 | 7241 |
selectedFiles := self currentSelectedObjects. |
4558 | 7242 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
7243 |
||
7244 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 7245 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 7246 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
7247 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 7248 |
|
7249 |
outStream := outFile writeStream. |
|
7250 |
||
7251 |
selectedFiles do:[:fileName | |
|
7252 |
|inStream| |
|
7253 |
||
7254 |
self notify:('Adding:', fileName baseName). |
|
7255 |
inStream := fileName readStream. |
|
7256 |
inStream copyToEndInto:outStream. |
|
7257 |
inStream close. |
|
7258 |
]. |
|
7259 |
outStream close. |
|
6190 | 7260 |
self notify:nil. |
7560 | 7261 |
|
7262 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 7263 |
! |
7264 |
||
6292 | 7265 |
loadImageThenDo:aBlock |
3892 | 7266 |
|img path files| |
7267 |
||
3982 | 7268 |
files := self currentSelectedFiles. |
3892 | 7269 |
files isEmpty ifTrue:[ ^ self]. |
7270 |
files do:[:fileName | |
|
4414 | 7271 |
path := fileName. |
7272 |
path isDirectory ifFalse:[ |
|
7273 |
img := Image fromFile:(path pathName). |
|
7274 |
img notNil ifTrue:[ |
|
6292 | 7275 |
aBlock value:img |
4414 | 7276 |
] ifFalse:[ |
6292 | 7277 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 7278 |
] |
7279 |
] |
|
3892 | 7280 |
]. |
7281 |
! |
|
7282 |
||
13089 | 7283 |
loadSignatureSupport |
7284 |
Expecco::KeyFileGenerator isNil ifTrue:[ |
|
7285 |
Smalltalk loadPackage:'exept:expecco:license' |
|
7286 |
]. |
|
7287 |
! |
|
7288 |
||
3892 | 7289 |
openASN1Browser |
7290 |
||
7291 |
self openTool:OSI::ASN1Browser |
|
7292 |
! |
|
7293 |
||
7294 |
openAppletViewer |
|
7295 |
|numItems files| |
|
7296 |
||
3982 | 7297 |
files := self currentSelectedFiles. |
3892 | 7298 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 7299 |
(self |
7300 |
confirm:(resources string:'open for each of the %1 items ?' |
|
7301 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 7302 |
]. |
7303 |
||
7304 |
Java startupJavaSystem. |
|
7305 |
"/ Java markAllClassesUninitialized. |
|
7306 |
"/ Java initAllStaticFields. |
|
7307 |
"/ Java initAllClasses. |
|
7308 |
||
7309 |
files do:[:fileName | |
|
4414 | 7310 |
|p path| |
7311 |
||
7312 |
path := fileName. |
|
7313 |
path isDirectory ifFalse:[ |
|
7314 |
p := Java |
|
7315 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
7316 |
argumentString:path pathName. |
|
7317 |
p resume. |
|
7318 |
] |
|
3892 | 7319 |
]. |
7320 |
! |
|
7321 |
||
7322 |
openCBrowser |
|
6031 | 7323 |
|dir files| |
5880 | 7324 |
|
7325 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7326 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7327 |
self withActivityIndicationDo:[ |
7560 | 7328 |
files := self currentSelectedObjects. |
6031 | 7329 |
files notEmptyOrNil ifTrue:[ |
7330 |
CBrowser::Browser openOn:files first. |
|
7331 |
] ifFalse:[ |
|
7332 |
CBrowser::Browser openIn:dir. |
|
7333 |
] |
|
3892 | 7334 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7335 |
|
7560 | 7336 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 7337 |
! |
7338 |
||
4230 | 7339 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7340 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7341 |
|
4230 | 7342 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7343 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 7344 |
with:#openOnFile: |
7345 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7346 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7347 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 7348 |
! |
7349 |
||
3892 | 7350 |
openChangesBrowser |
7351 |
"open a change browser on the selected file(s)" |
|
7352 |
||
7353 |
self openTool:(UserPreferences current changesBrowserClass) |
|
7354 |
! |
|
7355 |
||
7356 |
openDiffView |
|
7357 |
"open a diff-view" |
|
7358 |
||
6388 | 7359 |
|name1 name2 text1 text2 d err nm l1 files title |
12850 | 7360 |
defaultName defaultDir sameContents msg| |
6460 | 7361 |
|
7362 |
files := self currentSelectedObjects. |
|
3892 | 7363 |
files isEmpty ifTrue:[ |
6460 | 7364 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 7365 |
^ self. |
3892 | 7366 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7367 |
|
3892 | 7368 |
(files size == 2) ifTrue:[ |
4414 | 7369 |
name1 := files last. |
7370 |
name2 := files first. |
|
3892 | 7371 |
] ifFalse:[ |
4414 | 7372 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 7373 |
LastFileDiffFile exists ifTrue:[ |
7374 |
name1 := LastFileDiffFile. |
|
7375 |
]. |
|
7376 |
"/ | directory | |
|
7377 |
"/ directory := self currentDirectory. |
|
7378 |
"/ directory notNil ifTrue:[ |
|
7379 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
7380 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
7381 |
"/ name1 := lastFile. |
|
7382 |
"/ ] |
|
7383 |
"/ ] |
|
4414 | 7384 |
]. |
7385 |
name2 := files first. |
|
6460 | 7386 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 7387 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 7388 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 7389 |
name1 := DialogBox |
7390 |
requestFileName:title |
|
7391 |
default:defaultName |
|
6460 | 7392 |
ok:(resources string:'OK') |
7393 |
abort:(resources string:'Compare against File List') |
|
4414 | 7394 |
pattern:'*' |
11052 | 7395 |
fromDirectory:defaultDir. |
3892 | 7396 |
]. |
7397 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7398 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7399 |
(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
|
7400 |
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
|
7401 |
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
|
7402 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7403 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7404 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7405 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7406 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7407 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7408 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7409 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7410 |
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
|
7411 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7412 |
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
|
7413 |
]. |
4414 | 7414 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7415 |
l1 := name1 pathName |
4414 | 7416 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7417 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7418 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7419 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7420 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7421 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7422 |
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
|
7423 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7424 |
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
|
7425 |
]. |
4414 | 7426 |
]. |
7427 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7428 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7429 |
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
|
7430 |
^ self |
6176 | 7431 |
]. |
7432 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7433 |
self withActivityIndicationDo:[ |
11494 | 7434 |
((name1 notNil and:[name1 fileSize > (1024*1024*32)]) |
7435 |
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
|
7436 |
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
|
7437 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7438 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7439 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7440 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7441 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7442 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7443 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7444 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7445 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7446 |
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
|
7447 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7448 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7449 |
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
|
7450 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7451 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7452 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7453 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7454 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7455 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7456 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7457 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7458 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7459 |
] |
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 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7462 |
text2 := name2 directoryContents asString. |
6460 | 7463 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7464 |
text2 := name2 contents. |
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 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7467 |
(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
|
7468 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7469 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7470 |
msg := 'Same contents.' |
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 |
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
|
7473 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7474 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7475 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7476 |
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
|
7477 |
d topView label:(resources string:'File Differences'). |
6460 | 7478 |
] |
4414 | 7479 |
] |
3892 | 7480 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7481 |
|
11494 | 7482 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
3892 | 7483 |
! |
7484 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7485 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7486 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7487 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7488 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7489 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7490 |
files := self currentSelectedObjects. |
11108 | 7491 |
files notEmpty ifTrue:[ |
7492 |
name1 := files first asFilename. |
|
7493 |
name1 asFilename isDirectory ifFalse:[ |
|
7494 |
name1 := name1 directory |
|
7495 |
]. |
|
7496 |
]. |
|
7497 |
||
7498 |
(files size == 2) ifTrue:[ |
|
7499 |
name2 := files second. |
|
7500 |
] ifFalse:[ |
|
7501 |
(files size ~= 1) ifTrue:[ |
|
7502 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
7503 |
^ self. |
|
7504 |
]. |
|
7505 |
name2 := Dialog |
|
7506 |
requestDirectoryName:(resources |
|
7507 |
string:'Recursive compare "%1" with folder:' |
|
7508 |
with:name1 asFilename baseName) |
|
7509 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
7510 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
7511 |
LastFileDiffDirectory := name2. |
|
7512 |
]. |
|
7513 |
name2 := name2 asFilename. |
|
7514 |
||
7515 |
name2 asFilename isDirectory ifFalse:[ |
|
7516 |
name2 := name2 directory |
|
7517 |
]. |
|
7518 |
||
7519 |
self |
|
7520 |
applicationNamed:#FileApplicationNoteBook |
|
7521 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7522 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7523 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7524 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7525 |
|
3892 | 7526 |
openEditor |
7527 |
self openTool:EditTextView |
|
7528 |
! |
|
7529 |
||
4957 | 7530 |
openGV |
7531 |
self openOSCommandWithFiles:'gv' |
|
7532 |
! |
|
7533 |
||
3892 | 7534 |
openHTMLReader |
7535 |
||
7536 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
7537 |
! |
|
7538 |
||
7539 |
openImageEditor |
|
6292 | 7540 |
[ |
7541 |
self loadImageThenDo:[:img | img edit] |
|
7542 |
] fork |
|
3892 | 7543 |
! |
7544 |
||
7545 |
openImageInspector |
|
6292 | 7546 |
[ |
7547 |
self loadImageThenDo:[:img | img inspect] |
|
7548 |
] fork |
|
3892 | 7549 |
! |
7550 |
||
7551 |
openImagePreview |
|
5778 | 7552 |
[ |
7553 |
self |
|
6292 | 7554 |
loadImageThenDo: |
5778 | 7555 |
[:img | |
7556 |
|i top viewer| |
|
7557 |
||
7558 |
top := StandardSystemView new. |
|
7559 |
||
7560 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
7561 |
i := img. |
|
7562 |
top extent:200@200. |
|
7563 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
7564 |
top openAndWait. |
|
7565 |
||
7566 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
7567 |
i := i magnifiedPreservingRatioTo:200@200. |
|
7568 |
]. |
|
7569 |
viewer image:i. |
|
7570 |
]. |
|
3892 | 7571 |
] fork |
7572 |
! |
|
7573 |
||
7574 |
openMP3Player |
|
7575 |
|file| |
|
7576 |
||
3982 | 7577 |
file := self currentSelectedFiles. |
3892 | 7578 |
(file isEmpty) ifTrue:[ |
4414 | 7579 |
^ self. |
3892 | 7580 |
]. |
7581 |
file := file first. |
|
7582 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
7583 |
! |
|
7584 |
||
4957 | 7585 |
openOSCommandWithFiles:command |
7586 |
|files fileNames| |
|
7587 |
||
7588 |
files := self currentSelectedFiles. |
|
7589 |
(files isEmpty) ifTrue:[ |
|
7590 |
^ self. |
|
7591 |
]. |
|
7592 |
||
7593 |
fileNames := files collect:[:each | |
|
7594 |
'"' , each asFilename pathName , '"' |
|
7595 |
]. |
|
7596 |
||
7597 |
[ |
|
7598 |
OperatingSystem |
|
4959 | 7599 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
7600 |
inDirectory:(files first asFilename directory). |
|
4957 | 7601 |
] fork |
7602 |
! |
|
7603 |
||
4820 | 7604 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7605 |
|files fileNames cmd arg| |
4820 | 7606 |
|
7607 |
files := self currentSelectedFiles. |
|
7608 |
(files isEmpty) ifTrue:[ |
|
7609 |
^ self. |
|
7610 |
]. |
|
12972 | 7611 |
cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'. |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7612 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7613 |
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
|
7614 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7615 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7616 |
|
4820 | 7617 |
fileNames := |
7618 |
files |
|
7619 |
collect: |
|
7620 |
[:each | |
|
7621 |
'"' , each asFilename pathName , '"' |
|
7622 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7623 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7624 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7625 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7626 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7627 |
]. |
4820 | 7628 |
|
4950 | 7629 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7630 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 7631 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7632 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7633 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 7634 |
! |
7635 |
||
4958 | 7636 |
openRP |
7637 |
self openOSCommandWithFiles:'realplay' |
|
7638 |
! |
|
7639 |
||
8426 | 7640 |
openResourceFileEditor |
7641 |
||
7642 |
self |
|
7643 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
7644 |
with: #openOnFile: |
|
7645 |
! |
|
7646 |
||
3892 | 7647 |
openSlideShow |
5880 | 7648 |
|dir| |
7649 |
||
7650 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7651 |
dir isNil ifTrue:[^ self]. |
|
7652 |
||
3892 | 7653 |
CodingExamples_GUI::SlideShow openIn:dir. |
7654 |
! |
|
7655 |
||
7656 |
openSnapshotImageBrowser |
|
4491 | 7657 |
"Sorry, for now, only the old browser can handle snapShotImages." |
7658 |
||
3892 | 7659 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
7660 |
! |
|
7661 |
||
7662 |
openTerminal |
|
5880 | 7663 |
|dir| |
7664 |
||
7665 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 7666 |
|
5300 | 7667 |
TerminalApplication notNil ifTrue:[ |
7668 |
TerminalApplication openIn:dir |
|
7669 |
] ifFalse:[ |
|
7670 |
VT100TerminalView openShellIn:dir. |
|
7671 |
]. |
|
3892 | 7672 |
! |
7673 |
||
7674 |
openTool:aToolClass |
|
7675 |
"open a tool on the selected file(s)" |
|
7676 |
||
7677 |
^ self openTool:aToolClass ignoreDirectories:true |
|
7678 |
! |
|
7679 |
||
7680 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
7681 |
"open a tool on the selected file(s)" |
|
7682 |
||
7683 |
^ self |
|
4414 | 7684 |
openTool:aToolClass |
7685 |
with:#openOn: |
|
7686 |
ignoreDirectories:ignoreDirs |
|
3892 | 7687 |
! |
7688 |
||
8426 | 7689 |
openTool:aToolClass with:aSelector |
7690 |
"open a tool on the selected file(s)" |
|
7691 |
||
7692 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
7693 |
! |
|
7694 |
||
3892 | 7695 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
7696 |
"open a tool on the selected file(s)" |
|
7697 |
||
8832 | 7698 |
|tool| |
3892 | 7699 |
|
7700 |
aToolClass isNil ifTrue:[ |
|
4414 | 7701 |
Dialog warn:'Sorry, that tool seems to be not available'. |
7702 |
^ nil. |
|
3892 | 7703 |
]. |
8832 | 7704 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
7705 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 7706 |
]. |
7707 |
^ tool |
|
8832 | 7708 |
! |
7709 |
||
7710 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7711 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7712 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7713 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7714 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7715 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7716 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7717 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7718 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7719 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7720 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7721 |
]. |
3892 | 7722 |
! |
7723 |
||
6022 | 7724 |
openWorkspace |
7725 |
self |
|
7726 |
openTool:WorkspaceApplication |
|
7727 |
with:#openOnFile: |
|
7728 |
ignoreDirectories:true |
|
7729 |
! |
|
7730 |
||
4950 | 7731 |
openXV |
4957 | 7732 |
self openOSCommandWithFiles:'xv' |
4950 | 7733 |
! |
7734 |
||
3892 | 7735 |
openZipTool |
5880 | 7736 |
|zipTool| |
3892 | 7737 |
|
7738 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 7739 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 7740 |
]. |
7741 |
! |
|
7742 |
||
7743 |
readAbbrevFile |
|
7744 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
7745 |
||
5880 | 7746 |
|directories| |
3892 | 7747 |
|
3982 | 7748 |
directories := self currentSelectedDirectories. |
3892 | 7749 |
directories isEmpty ifTrue:[^ self]. |
7750 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7751 |
self withActivityIndicationDo:[ |
5880 | 7752 |
directories do:[:eachDir | |
7753 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
7754 |
] |
|
5828 | 7755 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7756 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7757 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 7758 |
! |
7759 |
||
6460 | 7760 |
readAndShowResources |
7761 |
self withActivityIndicationDo:[ |
|
7762 |
| selectedFiles| |
|
7763 |
||
7764 |
selectedFiles:= self currentSelectedFiles. |
|
7765 |
selectedFiles do:[:fileName | |
|
7766 |
resources := ResourcePack fromFile:fileName. |
|
7767 |
resources inspect. |
|
7768 |
]. |
|
7769 |
] |
|
7770 |
! |
|
7771 |
||
3892 | 7772 |
singleFileFileIn:fileName lazy:lazy |
7773 |
"fileIn the selected file(s)" |
|
7774 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7775 |
|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
|
7776 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7777 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7778 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7779 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7780 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7781 |
[ |
4345 | 7782 |
(ObjectFileLoader notNil |
5491 | 7783 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 7784 |
AbortOperationRequest catch:[ |
7785 |
|p| |
|
7786 |
||
7787 |
"/ |
|
7788 |
"/ look if already loaded ... then unload first |
|
7789 |
"/ |
|
7790 |
p := fileName pathName. |
|
7791 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
7792 |
(Dialog confirm:(resources |
|
7793 |
string:'%1 is already loaded; load anyway ?' |
|
7794 |
with:p)) ifFalse:[ |
|
7795 |
^ self |
|
7796 |
]. |
|
7797 |
notifyString := 'unloading old ' , p , ' ...'. |
|
7798 |
Transcript showCR:notifyString. |
|
4523 | 7799 |
self notify:notifyString. |
4345 | 7800 |
ObjectFileLoader unloadObjectFile:p. |
7801 |
]. |
|
7802 |
||
7803 |
notifyString := 'loading ' , p , ' ...'. |
|
7804 |
Transcript showCR:notifyString. |
|
4523 | 7805 |
self notify:notifyString. |
12426 | 7806 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
7807 |
notifyString := 'Error: could not load ' , p. |
|
7808 |
Transcript showCR:notifyString. |
|
7809 |
self notify:notifyString. |
|
7810 |
] ifFalse:[ |
|
7811 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
7812 |
]. |
|
4345 | 7813 |
] |
7814 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
7815 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
7816 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7817 |
aStream := fileName readStreamOrNil. |
4345 | 7818 |
aStream notNil ifTrue:[ |
7819 |
aStream fileInBinary. |
|
7820 |
] |
|
7821 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7822 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 7823 |
"/ loading a java class file |
7824 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 7825 |
JavaClassReader loadFile:fileName |
4345 | 7826 |
] |
7827 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
7828 |
"/ loading a sif (smalltalk interchange format) file |
|
7829 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
7830 |
SmalltalkInterchangeFileManager newForFileIn |
|
7831 |
fileName: fileName pathName; |
|
7832 |
fileIn. |
|
7833 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
7834 |
Parcel isNil ifTrue:[ |
|
7835 |
Dialog warn:'Parcel support not loaded.' |
|
7836 |
] ifFalse:[ |
|
7837 |
Parcel loadParcelFrom: fileName pathName |
|
7838 |
] |
|
7839 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7840 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7841 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7842 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7843 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7844 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7845 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7846 |
Error handle:[:ex | |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7847 |
self errorNotify:'Error on file in: ', ex description. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7848 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7849 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7850 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7851 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7852 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7853 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7854 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7855 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7856 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7857 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7858 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7859 |
] |
4345 | 7860 |
] |
7861 |
] |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7862 |
]]] |
4345 | 7863 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7864 |
] 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
|
7865 |
|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
|
7866 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7867 |
isRedef := false. |
12684 | 7868 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7869 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7870 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7871 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7872 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7873 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7874 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7875 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7876 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7877 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7878 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7879 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7880 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7881 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7882 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7883 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7884 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7885 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7886 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7887 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7888 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7889 |
sender := ex suspendedContext. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7890 |
msg := msg , '\\in ' , sender receiver class name , '>>' , sender sender selector |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7891 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7892 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7893 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7894 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7895 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7896 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7897 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7898 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7899 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7900 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7901 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7902 |
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
|
7903 |
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
|
7904 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7905 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7906 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7907 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7908 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7909 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7910 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7911 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7912 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7913 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7914 |
values := #(cancelAll) , values. |
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 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7917 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7918 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7919 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7920 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7921 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7922 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7923 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7924 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7925 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7926 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7927 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7928 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7929 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7930 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7931 |
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
|
7932 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7933 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7934 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7935 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7936 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7937 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7938 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7939 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7940 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
7941 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
7942 |
(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
|
7943 |
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
|
7944 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7945 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7946 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7947 |
ex return |
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 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7950 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7951 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7952 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7953 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7954 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7955 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7956 |
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
|
7957 |
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
|
7958 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7959 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7960 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7961 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7962 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7963 |
] |
7040 | 7964 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7965 |
"Modified: / 22-11-2011 / 13:52:17 / cg" |
4531 | 7966 |
! |
7967 |
||
4558 | 7968 |
splitFile:infile intoPiecesOfSize:kiloBytes |
7969 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
7970 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
7971 |
||
7972 |
bufferSize := 32*1024. |
|
7973 |
||
7974 |
inStream := infile readStream. |
|
7975 |
||
7976 |
bytesPerSplit := kiloBytes * 1024. |
|
7977 |
||
7978 |
remaining := infile fileSize. |
|
7979 |
splitIndex := 1. |
|
7980 |
[remaining > 0] whileTrue:[ |
|
7981 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
7982 |
outStream := outFile asFilename writeStream. |
|
7983 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
7984 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
7985 |
buffer := ByteArray new:bufferSize. |
|
7986 |
n := inStream |
|
7987 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
7988 |
into:buffer |
|
7989 |
startingAt:1. |
|
7990 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
7991 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
7992 |
remaining := remaining - n. |
|
7993 |
]. |
|
7994 |
outStream close. |
|
7995 |
splitIndex := splitIndex + 1. |
|
7996 |
]. |
|
7997 |
inStream close. |
|
7998 |
! |
|
7999 |
||
8000 |
splitSelectedFiles |
|
6264 | 8001 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8002 |
|
12871 | 8003 |
selectedFiles := self currentSelectedFiles. |
4558 | 8004 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8005 |
||
6265 | 8006 |
msg := (numFiles > 1) |
8007 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8008 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8009 |
|
6352 | 8010 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8011 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8012 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8013 |
kiloBytes isNil ifTrue:[^ self]. |
8014 |
||
8015 |
selectedFiles do:[:fileName | |
|
8016 |
self notify:('Splitting:', fileName baseName). |
|
8017 |
fileName isDirectory ifFalse:[ |
|
8018 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8019 |
] |
|
8020 |
]. |
|
6190 | 8021 |
self notify:nil. |
6265 | 8022 |
|
7560 | 8023 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8024 |
! |
8025 |
||
4531 | 8026 |
truncateSelectedFilesToZeroSize |
4554 | 8027 |
|selectedFiles numFiles msg| |
4531 | 8028 |
|
7560 | 8029 |
selectedFiles := self currentSelectedObjects. |
4554 | 8030 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8031 |
||
4930 | 8032 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 8033 |
numFiles > 1 ifTrue:[ |
4930 | 8034 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 8035 |
]. |
4531 | 8036 |
|
8037 |
(Dialog |
|
6352 | 8038 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 8039 |
initialAnswer:false |
8040 |
) ifFalse:[ |
|
8041 |
^ self |
|
8042 |
]. |
|
8043 |
||
8044 |
selectedFiles do:[:fileName | |
|
8045 |
|s| |
|
8046 |
||
8047 |
self notify:('Truncating:', fileName baseName). |
|
8048 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8049 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8050 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8051 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8052 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 8053 |
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
|
8054 |
]. |
4531 | 8055 |
] |
8056 |
]. |
|
6190 | 8057 |
self notify:nil. |
7560 | 8058 |
|
8059 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 8060 |
! ! |
8061 |
||
4849 | 8062 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 8063 |
|
8064 |
canCvsAddAndCommit |
|
8065 |
||
3982 | 8066 |
|selectedFiles| |
8067 |
||
8068 |
selectedFiles := self currentSelectedFiles. |
|
8069 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 8070 |
! |
8071 |
||
8072 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
8073 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8074 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8075 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8076 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8077 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8078 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 8079 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8080 |
]. |
3892 | 8081 |
! ! |
8082 |
||
4849 | 8083 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8084 |
|
6521 | 8085 |
anySTFilesOrDirectoriesPresent |
8086 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
8087 |
! |
|
8088 |
||
3892 | 8089 |
anySTFilesPresent |
8090 |
^ self anyFilesPresentWithSuffix:'st' |
|
8091 |
! |
|
8092 |
||
8093 |
canCreateNewProject |
|
8094 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
12811 | 8095 |
^ self currentSelectedFiles contains:[:fileName| |
8096 |
| suffix| |
|
8097 |
suffix := fileName suffix asLowercase. |
|
8098 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8099 |
] |
|
3892 | 8100 |
! |
8101 |
||
8102 |
canDoTerminal |
|
8103 |
||
8104 |
^ OperatingSystem isUNIXlike |
|
8105 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8106 |
! |
|
8107 |
||
8108 |
canDoTerminalAndSystemIsDOS |
|
8109 |
||
8110 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8111 |
! |
|
8112 |
||
8113 |
canDoTerminalAndSystemIsUnix |
|
8114 |
||
8115 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8116 |
! |
|
8117 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8118 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8119 |
"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
|
8120 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8121 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8122 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8123 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8124 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8125 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8126 |
|
12811 | 8127 |
canOpenMonticelloBrowser |
8128 |
^ self currentSelectedFiles |
|
8129 |
contains:[:fileName| |
|
8130 |
fileName suffix asLowercase = 'mcz' |
|
8131 |
] |
|
8132 |
! |
|
8133 |
||
3892 | 8134 |
canReadAbbrevFile |
8135 |
||
5960 | 8136 |
|currentDirectory| |
3892 | 8137 |
|
8138 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 8139 |
currentDirectory := self currentDirectory. |
8140 |
^ currentDirectory notNil |
|
8141 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 8142 |
! |
8143 |
||
8144 |
canRemoveFromSourcePath |
|
8145 |
||
8146 |
^ false |
|
8147 |
! |
|
8148 |
||
13089 | 8149 |
cannotGenerateSignatureFiles |
8150 |
^ self canGenerateSignatureFiles not |
|
8151 |
! |
|
8152 |
||
3892 | 8153 |
hasASN1 |
8154 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 8155 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 8156 |
|
8157 |
! |
|
8158 |
||
8159 |
hasASN1AndSelection |
|
8160 |
^ [ self hasSelection value |
|
4414 | 8161 |
and:[self currentSelectedFiles size > 0 |
8162 |
and:[OSI::ASN1Parser notNil |
|
8163 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 8164 |
! |
8165 |
||
8166 |
hasCBrowser |
|
8167 |
^ [ CBrowser::Browser notNil ] |
|
8168 |
! |
|
8169 |
||
8170 |
hasJava |
|
8171 |
||
8172 |
^ [ JavaClassReader notNil |
|
4414 | 8173 |
and:[JavaClassReader isLoaded]] |
3892 | 8174 |
! |
8175 |
||
8176 |
hasJavaAndSelection |
|
8177 |
||
12871 | 8178 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 8179 |
and:[JavaClassReader notNil |
8180 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 8181 |
! |
8182 |
||
8183 |
hasMP3Player |
|
8184 |
||
8185 |
^ [ MP3PlayerApplication notNil |
|
4414 | 8186 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 8187 |
! |
8188 |
||
8189 |
hasMP3PlayerAndSelection |
|
8190 |
||
12871 | 8191 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 8192 |
and:[ self hasMP3Player value]] |
3892 | 8193 |
! |
8194 |
||
8426 | 8195 |
hasResourceFileSelected |
12871 | 8196 |
^ (self currentSelectedFiles) |
8197 |
contains:[:fn | |
|
12811 | 8198 |
fn suffix asLowercase = 'rs' |
8199 |
]. |
|
8426 | 8200 |
! |
8201 |
||
3892 | 8202 |
hasSlideShow |
8203 |
||
8204 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
8205 |
! |
|
8206 |
||
8207 |
hasSnapshotSelection |
|
8208 |
||
8209 |
^ [ |
|
4414 | 8210 |
| files | |
8426 | 8211 |
|
4414 | 8212 |
files := self currentSelectedFiles. |
8213 |
((files size == 1) |
|
8214 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 8215 |
] |
8216 |
! |
|
8217 |
||
7869 | 8218 |
hasXml |
9206 | 8219 |
^ [ XML::XMLParser notNil ] |
7869 | 8220 |
! |
8221 |
||
8222 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8223 |
"/ 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
|
8224 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 8225 |
|
8426 | 8226 |
^ [ |
8227 |
|sel fileName| |
|
7869 | 8228 |
|
8229 |
sel := self currentSelectedFiles. |
|
8230 |
sel size == 1 ifTrue:[ |
|
8231 |
fileName := sel first. |
|
8232 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8233 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 8234 |
] ifFalse:[ |
8235 |
false |
|
8236 |
] |
|
8237 |
] ifFalse:[ |
|
8238 |
false |
|
8239 |
] |
|
8240 |
] |
|
8241 |
! |
|
8242 |
||
3892 | 8243 |
hasZipFileSelected |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8244 |
|sel fileName suff| |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8245 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8246 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8247 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8248 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8249 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8250 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8251 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8252 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8253 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8254 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8255 |
^ fileName mimeTypeOfContents = 'application/x-zip-compressed' |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8256 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8257 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8258 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8259 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8260 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8261 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8262 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8263 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 8264 |
! |
8265 |
||
8266 |
javaSupportLoaded |
|
8267 |
||
8268 |
^ false |
|
8269 |
! ! |
|
8270 |
||
3906 | 8271 |
!AbstractFileBrowser methodsFor:'presentation'! |
8272 |
||
8273 |
getModeString:modeBits |
|
8274 |
"convert file-mode bits into a more user-friendly string. |
|
8275 |
This is wrong here - should be moved into OperatingSystem." |
|
8276 |
||
8277 |
^ self getModeString:modeBits |
|
4414 | 8278 |
with:#( 'owner:' $r $w $x |
8279 |
' group:' $r $w $x |
|
8280 |
' others:' $r $w $x ) |
|
3906 | 8281 |
! |
8282 |
||
8283 |
getModeString:modeBits with:texts |
|
8284 |
"convert file-mode bits into a more user-friendly string. |
|
8285 |
This is wrong here - should be moved into OperatingSystem." |
|
8286 |
||
8287 |
|bits modeString| |
|
8288 |
||
8289 |
bits := modeBits bitAnd:8r777. |
|
8290 |
modeString := ''. |
|
8291 |
||
8292 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
8293 |
with: texts do:[:bitMask :access | |
|
4414 | 8294 |
|ch| |
8295 |
||
8296 |
bitMask isNil ifTrue:[ |
|
8297 |
modeString := modeString , access |
|
8298 |
] ifFalse:[ |
|
8299 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
8300 |
ch := $- |
|
8301 |
] ifFalse:[ |
|
8302 |
ch := access |
|
8303 |
]. |
|
8304 |
modeString := modeString copyWith:ch |
|
8305 |
] |
|
3906 | 8306 |
]. |
8307 |
^ modeString |
|
8308 |
! ! |
|
8309 |
||
5880 | 8310 |
!AbstractFileBrowser methodsFor:'private'! |
8311 |
||
8312 |
theSingleSelectedDirectoryOrHomeDir |
|
8313 |
|dir| |
|
8314 |
||
5888 | 8315 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 8316 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
8317 |
^ dir. |
|
8318 |
! |
|
8319 |
||
8320 |
theSingleSelectedDirectoryOrNil |
|
8321 |
|dirs| |
|
8322 |
||
8323 |
dirs := self currentSelectedDirectories. |
|
8324 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
8325 |
^ dirs anElement. |
|
8326 |
! ! |
|
8327 |
||
3892 | 8328 |
!AbstractFileBrowser methodsFor:'queries'! |
8329 |
||
8256 | 8330 |
cBrowserLoaded |
8331 |
^ CBrowser::Browser notNil |
|
8332 |
! |
|
8333 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8334 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8335 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8336 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8337 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8338 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8339 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8340 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8341 |
"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
|
8342 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8343 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8344 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8345 |
|
3906 | 8346 |
getFileInfoStringForFirstSelectedFile:longInfo |
8347 |
"get stat info on selected file - return a string which can be |
|
8348 |
shown in a box" |
|
8349 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
8350 |
|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
|
8351 |
sizeString fileSize tAccess tModification buffer| |
3906 | 8352 |
|
7560 | 8353 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8354 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 8355 |
filename := selFiles first. |
8356 |
||
8364 | 8357 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8358 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8359 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8360 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8361 |
]. |
8364 | 8362 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
8363 |
buffer := Text writeStream. |
4765 | 8364 |
|
8365 |
buffer |
|
8366 |
nextPutAll:'filename: '; |
|
8367 |
nextPutLine:filename asString. |
|
8368 |
||
8364 | 8369 |
OperatingSystem isMSDOSlike ifTrue: [ |
8370 |
(info alternativeName notNil |
|
8371 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
8372 |
buffer nextPutAll:'shortname: '. |
|
8373 |
buffer nextPutLine:info alternativeName. |
|
8374 |
] |
|
8375 |
]. |
|
8376 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8377 |
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
|
8378 |
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
|
8379 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8380 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8381 |
]. |
4765 | 8382 |
buffer |
8383 |
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
|
8384 |
nextPutLine:(info path ? '???'). |
3906 | 8385 |
] 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
|
8386 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8387 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8388 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8389 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8390 |
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
|
8391 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8392 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8393 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8394 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8395 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8396 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8397 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8398 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8399 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8400 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8401 |
fileSize > 1024 ifTrue:[ |
8172 | 8402 |
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
|
8403 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8404 |
]. |
4765 | 8405 |
buffer nextPutLine:sizeString. |
3906 | 8406 |
|
8407 |
modeBits := info mode. |
|
8408 |
modeString := self getModeString:modeBits. |
|
4765 | 8409 |
|
8410 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 8411 |
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
|
8412 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 8413 |
]. |
4765 | 8414 |
buffer |
8415 |
cr; |
|
8416 |
nextPutAll:'owner: '; |
|
8417 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
8418 |
||
3906 | 8419 |
longInfo ifTrue:[ |
4765 | 8420 |
buffer |
8421 |
nextPutAll:'group: '; |
|
8422 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
8423 |
||
8424 |
tAccess := info accessTime. |
|
8425 |
buffer |
|
8426 |
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
|
8427 |
nextPutAll:tAccess asDate printString; |
4765 | 8428 |
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
|
8429 |
nextPutLine:tAccess asTime printString. |
4765 | 8430 |
|
8431 |
tModification := info modificationTime. |
|
8432 |
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
|
8433 |
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
|
8434 |
nextPutAll:tModification asDate printString; |
4765 | 8435 |
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
|
8436 |
nextPutLine:tModification asTime printString. |
3906 | 8437 |
]. |
4765 | 8438 |
^ buffer contents |
7560 | 8439 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
8440 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 8441 |
! |
8442 |
||
8510 | 8443 |
hasImageColorHistogram |
8444 |
^ ImageColorHistogram notNil |
|
8445 |
! |
|
8446 |
||
10258 | 8447 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
8448 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 8449 |
|
8450 |
"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
|
8451 |
"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
|
8452 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 8453 |
! |
8454 |
||
3892 | 8455 |
initialCommandFor:fileName into:aBox |
8456 |
"set a useful initial command for execute box." |
|
8457 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
8458 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 8459 |
! |
8460 |
||
8461 |
isAbstractFileBrowser |
|
8462 |
||
8463 |
^ true |
|
8464 |
! |
|
8465 |
||
8466 |
systemIsDOS |
|
8467 |
||
8468 |
^ OperatingSystem isMSDOSlike |
|
8469 |
! |
|
8470 |
||
12473 | 8471 |
systemIsOSX |
8472 |
||
8473 |
^ OperatingSystem isOSXlike |
|
8474 |
! |
|
8475 |
||
3892 | 8476 |
systemIsUnix |
8477 |
^ OperatingSystem isUNIXlike |
|
8478 |
! ! |
|
8479 |
||
8480 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
8481 |
||
8482 |
allItemsOfCurrentDirectory |
|
5009 | 8483 |
self |
4774 | 8484 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 8485 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
8486 |
||
8487 |
^ nil |
|
3892 | 8488 |
! |
8489 |
||
8490 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 8491 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8492 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
8493 |
(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
|
8494 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 8495 |
]. |
8496 |
^ false. |
|
8497 |
! |
|
8498 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8499 |
commonPrefixOfSelectedFiles |
4773 | 8500 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8501 |
|
7560 | 8502 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8503 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8504 |
|
4772 | 8505 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 8506 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8507 |
stringCol from:2 do:[:el| |
4773 | 8508 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8509 |
]. |
4773 | 8510 |
^ firstPre asFilename |
7560 | 8511 |
|
8512 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8513 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8514 |
|
12481 | 8515 |
compressTabsOnSave |
8516 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
8517 |
when saving. |
|
8518 |
Default is true" |
|
8519 |
||
8520 |
^ true |
|
8521 |
! |
|
8522 |
||
3892 | 8523 |
currentFilesAreInSameDirectory |
8524 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8525 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 8526 |
! |
8527 |
||
8528 |
currentFilesHasDirectories |
|
8529 |
||
6725 | 8530 |
^ self currentSelectedDirectories notEmpty. |
3892 | 8531 |
! |
8532 |
||
3982 | 8533 |
directoriesForFiles:aFileCol |
11743 | 8534 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 8535 |
! |
8536 |
||
3892 | 8537 |
fileListIsEmpty |
5009 | 8538 |
self |
8539 |
applicationNamed:#DirectoryContentsBrowser |
|
8540 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
8541 |
||
8542 |
^ nil. |
|
3892 | 8543 |
! |
8544 |
||
8545 |
fileListIsNotEmpty |
|
8546 |
||
8547 |
^ self fileListIsEmpty not. |
|
8548 |
! |
|
8549 |
||
8550 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 8551 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 8552 |
|
8553 |
| file1 file2 | |
|
8554 |
||
6284 | 8555 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 8556 |
file1 := aFilename1 asFilename. |
8557 |
file2 := aFilename2 asFilename. |
|
6284 | 8558 |
|
3892 | 8559 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 8560 |
|
3892 | 8561 |
((file1 isDirectory) |
8562 |
and:[(file2 isDirectory) |
|
8563 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 8564 |
^ file1 baseName = file2 baseName |
3892 | 8565 |
]. |
3982 | 8566 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 8567 |
! |
8568 |
||
8569 |
getAllFilesAsStringCollection |
|
5009 | 8570 |
self |
8571 |
applicationNamed:#DirectoryContentsBrowser |
|
8572 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
8573 |
||
8574 |
^ nil |
|
3892 | 8575 |
! |
8576 |
||
8577 |
getBestDirectory |
|
8578 |
||
8579 |
|selFiles stringCol firstPre| |
|
8580 |
||
6725 | 8581 |
selFiles := self currentSelectedDirectories. |
3892 | 8582 |
selFiles isEmpty ifTrue:[^ nil]. |
8583 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 8584 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 8585 |
firstPre := stringCol at:1. |
8586 |
stringCol from:2 do:[:el| |
|
4414 | 8587 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 8588 |
]. |
8589 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 8590 |
firstPre removeLast. |
3892 | 8591 |
]. |
8592 |
^ firstPre asFilename |
|
8593 |
! |
|
8594 |
||
8595 |
getDirWithoutFileName:aFileName |
|
8596 |
||
8597 |
| dir | |
|
8598 |
aFileName isNil ifTrue:[ |
|
4414 | 8599 |
^ aFileName. |
3892 | 8600 |
]. |
8601 |
dir := aFileName asFilename. |
|
8602 |
dir isDirectory ifFalse:[ |
|
4414 | 8603 |
dir := dir directory. |
3892 | 8604 |
]. |
8605 |
^ dir. |
|
8606 |
! |
|
8607 |
||
8608 |
getInfoItem |
|
8609 |
"get filename of a description-file (.dir.info, README etc.); |
|
8610 |
This file is automatically shown when a directory is enterred. |
|
8611 |
You can add more names below if you like." |
|
8612 |
||
5880 | 8613 |
|dir| |
8614 |
||
8615 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8616 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 8617 |
|
8618 |
#( |
|
8619 |
'.dir.info' |
|
8620 |
'README' |
|
8621 |
'ReadMe' |
|
8622 |
'Readme' |
|
8623 |
'readme' |
|
8624 |
'read.me' |
|
8625 |
'Read.me' |
|
8626 |
'READ.ME' |
|
8627 |
'README.TXT' |
|
8628 |
'readme.txt' |
|
8629 |
'Readme.txt' |
|
8630 |
'Info.txt' |
|
8631 |
'info.txt' |
|
8632 |
'INFO.TXT' |
|
8633 |
) do:[:f | |
|
5883 | 8634 |
|n| |
4414 | 8635 |
|
5880 | 8636 |
n := dir construct:f. |
4414 | 8637 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
8638 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
8639 |
] |
|
3892 | 8640 |
]. |
8641 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8642 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8643 |
|
12497 | 8644 |
hasPackageDirectorySelected |
8645 |
|dir| |
|
8646 |
||
8647 |
dir := self currentDirectory. |
|
8648 |
^ dir notNil |
|
8649 |
and:[ dir exists |
|
8650 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
8651 |
! |
|
8652 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8653 |
parentDirectoriesOfCurrentFiles |
11743 | 8654 |
^ self currentSelectedObjects |
8655 |
collect:[:file | file directory] as:Set |
|
7560 | 8656 |
|
8657 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 8658 |
! |
8659 |
||
8660 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 8661 |
^ true. "/ the code below is too slow for a menu enabling operation |
8662 |
||
8663 |
"/ |directories| |
|
8664 |
"/ |
|
8665 |
"/ directories := self currentDirectories value. |
|
8666 |
"/ directories do:[:dir| |
|
8667 |
"/ [ |
|
8668 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
8669 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
8670 |
"/ ] |
|
8671 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
8672 |
"/ ]. |
|
8673 |
"/ ^ false. |
|
6586 | 8674 |
! |
8675 |
||
8676 |
recursiveAnySTFilesPresent |
|
8677 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 8678 |
! ! |
8679 |
||
8680 |
!AbstractFileBrowser methodsFor:'selection'! |
|
8681 |
||
8682 |
currentSelectedDirectories |
|
6725 | 8683 |
^ self currentDirectoriesValue. |
3982 | 8684 |
! |
8685 |
||
8686 |
currentSelectedFiles |
|
12824 | 8687 |
^ self currentSelectedObjects reject:[:file | file isDirectory]. |
7560 | 8688 |
|
8689 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 8690 |
! |
8691 |
||
6460 | 8692 |
currentSelectedObjects |
8693 |
^ self currentFileNameHolder value |
|
8694 |
! |
|
8695 |
||
3982 | 8696 |
firstSelectedFile |
7560 | 8697 |
^ self currentSelectedObjects |
12102 | 8698 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8699 |
ifNone:[]. |
7560 | 8700 |
|
8701 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 8702 |
! |
8703 |
||
9490 | 8704 |
hasOnlyDirectoriesSelected |
8705 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
8706 |
||
8707 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
8708 |
! |
|
8709 |
||
4414 | 8710 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8711 |
|
7560 | 8712 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
8713 |
||
8714 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 8715 |
! |
8716 |
||
9490 | 8717 |
hasTwoDirectoriesSelected |
8718 |
||
8719 |
^ self currentSelectedObjects size == 2 |
|
8720 |
and:[self hasOnlyDirectoriesSelected] |
|
8721 |
||
8722 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
8723 |
! |
|
8724 |
||
4414 | 8725 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8726 |
|
7560 | 8727 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8728 |
and:[self hasOnlyFilesSelected] |
7560 | 8729 |
|
8730 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
3892 | 8731 |
! ! |
8732 |
||
3964 | 8733 |
!AbstractFileBrowser methodsFor:'sorting'! |
8734 |
||
3989 | 8735 |
currentSortOrder |
4027 | 8736 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 8737 |
! |
8738 |
||
8739 |
sortBlockHolder |
|
8740 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 8741 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8742 |
selector:#fileName |
|
8743 |
sortCaseless:self sortCaseless value |
|
8744 |
sortReverse:false) asValue. |
|
3989 | 8745 |
]. |
8746 |
! |
|
8747 |
||
8748 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8749 |
|v| |
4027 | 8750 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8751 |
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
|
8752 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8753 |
^ v. |
3989 | 8754 |
! |
8755 |
||
8756 |
sortCaseless |
|
4201 | 8757 |
" aspect for sort caseless " |
3989 | 8758 |
|
13000 | 8759 |
^ self |
8760 |
aspectFor:#sortCaseless |
|
8761 |
ifAbsent:[ (Filename isCaseSensitive not) asValue ] |
|
3989 | 8762 |
! |
8763 |
||
4074 | 8764 |
sortDirectoriesBeforeFiles |
8765 |
||
4201 | 8766 |
" aspect for sort directories always before files" |
4074 | 8767 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
8768 |
! |
|
8769 |
||
3989 | 8770 |
sortFileListsBy:instanceName |
8771 |
||
8772 |
self sortFileListsBy:instanceName withReverse:true |
|
8773 |
! |
|
8774 |
||
8775 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
8776 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 8777 |
|
8778 |
aSymbol := instanceName asSymbol. |
|
4027 | 8779 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 8780 |
sortCaselessLocal := self sortCaseless value. |
4027 | 8781 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8782 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8783 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 8784 |
currentSortOrder at:#column put:aSymbol. |
8785 |
currentSortOrder at:#reverse put:false. |
|
8786 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 8787 |
] ifFalse:[ |
4343 | 8788 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
8789 |
"/ sort caseless changed |
|
8790 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
8791 |
] ifFalse:[ |
|
8792 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
8793 |
"/ same column like before - change sort order ifReverse is true |
|
8794 |
aBoolean ifTrue:[ |
|
8795 |
isReverse := currentSortOrder at:#reverse. |
|
8796 |
currentSortOrder at:#reverse put:(isReverse not). |
|
8797 |
]. |
|
8798 |
] ifFalse:[ |
|
8799 |
"/ another column - remark column |
|
8800 |
currentSortOrder at:#column put:aSymbol. |
|
8801 |
] |
|
8802 |
] |
|
3964 | 8803 |
]. |
4027 | 8804 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8805 |
|
5383 | 8806 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8807 |
selector:instanceName |
|
8808 |
sortCaseless:sortCaselessLocal |
|
8809 |
sortReverse:(currentSortOrder at:#reverse). |
|
8810 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8811 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8812 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 8813 |
! ! |
8814 |
||
3892 | 8815 |
!AbstractFileBrowser methodsFor:'startup & release'! |
8816 |
||
8817 |
makeDependent |
|
4074 | 8818 |
self filterModel addDependent:self. |
4004 | 8819 |
self currentFileNameHolder addDependent:self. |
4074 | 8820 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 8821 |
self sortCaseless addDependent:self. |
4011 | 8822 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
8823 |
self rootHolder addDependent:self. |
3892 | 8824 |
! |
8825 |
||
8826 |
masterApplication:anApplication |
|
8827 |
||
8828 |
masterApplication isNil ifTrue:[ |
|
4414 | 8829 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
8830 |
aspects := anApplication aspects |
|
8831 |
] ifFalse:[ |
|
8832 |
aspects isNil ifTrue:[ |
|
8833 |
aspects := IdentityDictionary new. |
|
8834 |
aspects at:#applications put:(IdentityDictionary new). |
|
8835 |
] |
|
8836 |
]. |
|
8837 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8838 |
"/ self makeDependent. |
3892 | 8839 |
]. |
3952 | 8840 |
^ super masterApplication:anApplication. |
3892 | 8841 |
! |
8842 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8843 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8844 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8845 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8846 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8847 |
|
3892 | 8848 |
postOpenWith:aBuilder |
8849 |
||
8850 |
super postOpenWith:aBuilder. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8851 |
self windowGroup showWaitCursorWhenBusyForMillis:100. |
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8852 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8853 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 8854 |
! ! |
8855 |
||
8856 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
8857 |
||
8858 |
files |
|
8859 |
"return the value of the instance variable 'files' (automatically generated)" |
|
8860 |
||
8861 |
^ files |
|
8862 |
! |
|
8863 |
||
8864 |
files:something |
|
8865 |
"set the value of the instance variable 'files' (automatically generated)" |
|
8866 |
||
8867 |
files := something. |
|
8868 |
! |
|
8869 |
||
8870 |
method |
|
8871 |
"return the value of the instance variable 'method' (automatically generated)" |
|
8872 |
||
8873 |
^ method |
|
8874 |
! |
|
8875 |
||
8876 |
method:something |
|
8877 |
"set the value of the instance variable 'method' (automatically generated)" |
|
8878 |
||
8879 |
method := something. |
|
8880 |
! ! |
|
8881 |
||
8882 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
8883 |
||
8884 |
locked |
|
8885 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
8886 |
||
8887 |
locked isNil ifTrue:[ |
|
4414 | 8888 |
locked := false. |
3892 | 8889 |
]. |
8890 |
^ locked |
|
8891 |
! ! |
|
8892 |
||
8893 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
8894 |
||
8895 |
doIfUnLocked:aBlock |
|
8896 |
||
8897 |
self locked ifFalse:[ |
|
4414 | 8898 |
aBlock value. |
3892 | 8899 |
]. |
8900 |
! |
|
8901 |
||
8902 |
doLocked:aBlock |
|
8903 |
||
8904 |
locked := true. |
|
4004 | 8905 |
aBlock ensure:[ |
4414 | 8906 |
locked := false. |
4004 | 8907 |
] |
3892 | 8908 |
! ! |
8909 |
||
3952 | 8910 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
8911 |
||
6369 | 8912 |
defaultHistorySize |
8913 |
^ 50 |
|
3892 | 8914 |
! ! |
8915 |
||
6371 | 8916 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 8917 |
|
8918 |
new |
|
6371 | 8919 |
^ (super new) initializeHistory. |
6369 | 8920 |
! ! |
8921 |
||
8922 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
8923 |
||
8924 |
historySize |
|
8925 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
8926 |
^ historySize |
|
8927 |
! |
|
8928 |
||
8929 |
historySize:aNumber |
|
8930 |
historySize := aNumber |
|
4032 | 8931 |
! ! |
8932 |
||
3892 | 8933 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
8934 |
||
3952 | 8935 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8936 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8937 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8938 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8939 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8940 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
8941 |
pathToAdd := pathToAdd copyButLast:(Filename separator asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8942 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8943 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8944 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8945 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8946 |
self backForwardListAdd:pathToAdd. |
3952 | 8947 |
item isNil ifTrue:[ |
4347 | 8948 |
" not already in history" |
6369 | 8949 |
self size >= self historySize ifTrue:[ |
4347 | 8950 |
self removeLast. |
8951 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
8952 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 8953 |
] ifFalse:[ |
4347 | 8954 |
"already been there before; move the entry to |
8955 |
the beginning, so it will fall out later." |
|
8956 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8957 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8958 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8959 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
8960 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 8961 |
! |
8962 |
||
4347 | 8963 |
backForwardListAdd:aPath |
8964 |
|pathIndex| |
|
8965 |
||
8966 |
pathIndex := backForwardList indexOf:aPath. |
|
8967 |
pathIndex == 0 ifTrue:[ |
|
8968 |
" a new path comes in remove forward paths " |
|
8969 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
8970 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
8971 |
]. |
|
8972 |
] ifFalse:[ |
|
8973 |
backForwardList remove:aPath. |
|
8974 |
pathIndex <= backForwardIndex ifTrue:[ |
|
8975 |
backForwardIndex := backForwardIndex - 1. |
|
8976 |
] |
|
4022 | 8977 |
]. |
4347 | 8978 |
backForwardList add:aPath afterIndex:backForwardIndex. |
8979 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 8980 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 8981 |
backForwardList removeFirst. |
8982 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 8983 |
]. |
4347 | 8984 |
! |
8985 |
||
8986 |
goBackward |
|
4288 | 8987 |
"return the first path of the backward list; |
8988 |
remove it from the back list and add it ti the forward list." |
|
4022 | 8989 |
|
4347 | 8990 |
|retPath| |
8991 |
||
8992 |
self canBackward ifTrue:[ |
|
8993 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
8994 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 8995 |
]. |
4022 | 8996 |
^ retPath. |
8997 |
! |
|
8998 |
||
8999 |
goForward |
|
4288 | 9000 |
"return the first path of the forward list; |
9001 |
remove it from the list." |
|
4022 | 9002 |
|
4347 | 9003 |
|retPath| |
9004 |
||
9005 |
self canForward ifTrue:[ |
|
9006 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9007 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9008 |
]. |
4022 | 9009 |
^ retPath. |
9010 |
! |
|
9011 |
||
9012 |
resetForwardBackward |
|
9013 |
||
4347 | 9014 |
self initialize |
4022 | 9015 |
! |
9016 |
||
9017 |
setPosition:aPosition for:aPath |
|
9018 |
||
9019 |
self do:[:item| |
|
4414 | 9020 |
item path = aPath ifTrue:[ |
9021 |
item position:aPosition. |
|
9022 |
] |
|
4022 | 9023 |
]. |
3892 | 9024 |
! ! |
9025 |
||
4870 | 9026 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9027 |
|
6371 | 9028 |
initializeHistory |
4032 | 9029 |
|
4347 | 9030 |
backForwardList := OrderedCollection new. |
9031 |
self reverseDo:[:el| |
|
9032 |
backForwardList add:el path. |
|
9033 |
]. |
|
9034 |
backForwardIndex := backForwardList size. |
|
4032 | 9035 |
! ! |
9036 |
||
3892 | 9037 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9038 |
||
4288 | 9039 |
canBackward |
4347 | 9040 |
|
9041 |
^ backForwardIndex > 1 |
|
4288 | 9042 |
! |
9043 |
||
3892 | 9044 |
canForward |
4347 | 9045 |
|
9046 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9047 |
! |
|
9048 |
||
9049 |
getBackCollection |
|
9050 |
||
9051 |
| backCol | |
|
9052 |
||
9053 |
backCol := OrderedCollection new. |
|
9054 |
self canBackward ifTrue:[ |
|
9055 |
| tmpCol | |
|
9056 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9057 |
tmpCol reverseDo:[ :el| |
|
9058 |
backCol add:el. |
|
9059 |
] |
|
9060 |
]. |
|
9061 |
^ backCol |
|
3952 | 9062 |
! |
9063 |
||
9064 |
getForwardCollection |
|
9065 |
||
4347 | 9066 |
| forwCol | |
9067 |
||
9068 |
forwCol := OrderedCollection new. |
|
9069 |
self canForward ifTrue:[ |
|
9070 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9071 |
]. |
|
9072 |
^ forwCol |
|
3952 | 9073 |
! |
9074 |
||
9075 |
getItemFor:aPath |
|
6627 | 9076 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9077 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9078 |
"/ ^ nil. |
|
3952 | 9079 |
! |
9080 |
||
9081 |
getPositionFor:aPath |
|
9082 |
||
9083 |
|item| |
|
9084 |
||
9085 |
item := self getItemFor:aPath. |
|
9086 |
||
9087 |
item notNil ifTrue:[ |
|
4414 | 9088 |
^ item position. |
3952 | 9089 |
]. |
9090 |
^ nil |
|
9091 |
! |
|
9092 |
||
9093 |
includesPath:aPath |
|
6627 | 9094 |
^ self contains:[:item | item path = aPath]. |
9095 |
||
9096 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
9097 |
"/ ^ false. |
|
4347 | 9098 |
! |
9099 |
||
9100 |
nextBackwardItem |
|
9101 |
"return the first path of the backward list" |
|
9102 |
||
9103 |
|retPath| |
|
9104 |
||
9105 |
self canBackward ifTrue:[ |
|
9106 |
retPath := backForwardList at:backForwardIndex. |
|
9107 |
]. |
|
9108 |
^ retPath. |
|
9109 |
! |
|
9110 |
||
9111 |
nextForwardItem |
|
9112 |
"return the first path of the forward list" |
|
9113 |
||
9114 |
|retPath| |
|
9115 |
||
9116 |
self canForward ifTrue:[ |
|
9117 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9118 |
]. |
|
9119 |
^ retPath. |
|
3952 | 9120 |
! ! |
9121 |
||
9122 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
9123 |
||
9124 |
path:aPath |
|
9125 |
||
9126 |
^ self new path:aPath |
|
9127 |
! ! |
|
9128 |
||
9129 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
9130 |
||
6433 | 9131 |
asFilename |
9132 |
^ path asFilename |
|
9133 |
! |
|
9134 |
||
3952 | 9135 |
path |
9136 |
"return the value of the instance variable 'path' (automatically generated)" |
|
9137 |
||
9138 |
^ path |
|
9139 |
! |
|
9140 |
||
9141 |
path:something |
|
9142 |
"set the value of the instance variable 'path' (automatically generated)" |
|
9143 |
||
9144 |
path := something. |
|
9145 |
! |
|
9146 |
||
9147 |
position |
|
9148 |
"return the value of the instance variable 'position' (automatically generated)" |
|
9149 |
||
9150 |
^ position |
|
9151 |
! |
|
9152 |
||
9153 |
position:something |
|
9154 |
"set the value of the instance variable 'position' (automatically generated)" |
|
9155 |
||
9156 |
position := something. |
|
9157 |
! |
|
9158 |
||
9159 |
printString |
|
9160 |
||
9161 |
^ self path asString |
|
3892 | 9162 |
! ! |
9163 |
||
9164 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
9165 |
||
9166 |
withValue:aValue isHolder:aBoolean |
|
9167 |
||
9168 |
| instance | |
|
9169 |
||
9170 |
instance := self basicNew. |
|
9171 |
instance value:aValue. |
|
9172 |
instance isHolder:aBoolean. |
|
9173 |
^ instance |
|
9174 |
! ! |
|
9175 |
||
9176 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
9177 |
||
9178 |
isHolder |
|
9179 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
9180 |
||
9181 |
^ isHolder |
|
9182 |
! |
|
9183 |
||
9184 |
isHolder:something |
|
9185 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
9186 |
||
9187 |
isHolder := something. |
|
9188 |
! |
|
9189 |
||
9190 |
value |
|
9191 |
"return the value of the instance variable 'value' (automatically generated)" |
|
9192 |
||
9193 |
^ value |
|
9194 |
! |
|
9195 |
||
9196 |
value:something |
|
9197 |
"set the value of the instance variable 'value' (automatically generated)" |
|
9198 |
||
9199 |
value := something. |
|
9200 |
! ! |
|
9201 |
||
9202 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
9203 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9204 |
version |
13704 | 9205 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.541 2013-12-04 14:27:39 stefan Exp $' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9206 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9207 |
|
8832 | 9208 |
version_CVS |
13704 | 9209 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.541 2013-12-04 14:27:39 stefan Exp $' |
3892 | 9210 |
! ! |
12094 | 9211 |