author | Claus Gittinger <cg@exept.de> |
Fri, 28 Nov 2014 13:31:39 +0100 | |
changeset 14941 | feeeea13426b |
parent 14742 | 2b23888bda58 |
child 14980 | 1c752103f217 |
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 |
|
14126 | 15 |
instanceVariableNames:'aspects' |
16 |
classVariableNames:'VisitedDirectories RuntimeAspects DirectoryBookmarks |
|
17 |
LastEnforcedNameSpace CommandHistory DefaultCommandPerSuffix |
|
18 |
CommandHistorySize LastFileDiffFile DefaultFilters RootHolder |
|
19 |
LastFileSelection LastMoveDestination LastScriptBlockString |
|
20 |
LastMustMatchPattern LastFileDiffDirectory |
|
21 |
LastMercurialRepository' |
|
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 |
||
14126 | 31 |
ApplicationModel - ClassResources |
32 |
Model - |
|
33 |
Object - |
|
3892 | 34 |
" |
35 |
! |
|
36 |
||
37 |
Object subclass:#Clipboard |
|
14126 | 38 |
instanceVariableNames:'method files' |
39 |
classVariableNames:'' |
|
40 |
poolDictionaries:'' |
|
41 |
privateIn:AbstractFileBrowser |
|
3892 | 42 |
! |
43 |
||
44 |
Object subclass:#CodeExecutionLock |
|
14126 | 45 |
instanceVariableNames:'locked' |
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
privateIn:AbstractFileBrowser |
|
3892 | 49 |
! |
50 |
||
4366 | 51 |
List subclass:#DirectoryHistory |
14126 | 52 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
53 |
backForwardList backForwardIndex historySize' |
|
54 |
classVariableNames:'HistorySize' |
|
55 |
poolDictionaries:'' |
|
56 |
privateIn:AbstractFileBrowser |
|
3952 | 57 |
! |
58 |
||
59 |
Object subclass:#DirectoryHistoryItem |
|
14126 | 60 |
instanceVariableNames:'path position' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 64 |
! |
65 |
||
66 |
Object subclass:#SaveAspectItem |
|
14126 | 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 |
14709
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
561 |
showDirectoriesOnTop false |
4201 | 562 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
563 |
|
11501 | 564 |
"Modified: / 11-05-2012 / 09:22:04 / cg" |
14709
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
565 |
"Modified: / 12-08-2014 / 13:13:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3892 | 566 |
! ! |
567 |
||
5398 | 568 |
!AbstractFileBrowser class methodsFor:'help specs'! |
569 |
||
8261 | 570 |
basicFlyByHelpSpec |
6099 | 571 |
<resource: #help> |
572 |
||
8261 | 573 |
^ super flyByHelpSpec addPairsFrom:#( |
6099 | 574 |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
575 |
#lockFileEncoding |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
576 |
'Do not guess the encoding from the file''s contents.' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
577 |
|
6100 | 578 |
#closeTabButton |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
579 |
'Close this tab' |
6100 | 580 |
|
6099 | 581 |
#addTerminal |
14308 | 582 |
'Add a shell terminal view' |
6099 | 583 |
|
584 |
#make |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
585 |
'Call the make command' |
6099 | 586 |
|
587 |
#searchFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
588 |
'Search a file' |
6099 | 589 |
|
590 |
#directoryUp |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
591 |
'Directory up' |
6099 | 592 |
|
593 |
#directoryBack |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
594 |
'Directory back' |
6099 | 595 |
|
596 |
#directoryForward |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
597 |
'Directory forward' |
6099 | 598 |
|
599 |
#directoryHistory |
|
600 |
'Directory' |
|
601 |
||
602 |
#copyFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
603 |
'Copy the selected file(s)' |
6099 | 604 |
|
605 |
#cutFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
606 |
'Cut the selected file(s)' |
6099 | 607 |
|
608 |
#editFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
609 |
'Edit the selected file' |
6099 | 610 |
|
611 |
#fileHome |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
612 |
'Goto home directory' |
6099 | 613 |
|
8093 | 614 |
#fileDesktop |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
615 |
'Goto desktop directory' |
8093 | 616 |
|
6099 | 617 |
#fileGotoDefault |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
618 |
'Goto default directory (ST/X start directory)' |
6099 | 619 |
|
6454 | 620 |
#fileGotoSmalltalkDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
621 |
'Goto Smalltalk directory (ST/X application)' |
6454 | 622 |
|
6456 | 623 |
#fileGotoDefaultDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
624 |
'Goto current directory' |
6456 | 625 |
|
6099 | 626 |
#pasteFile |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
627 |
'Paste file(s)' |
6099 | 628 |
|
629 |
#deleteFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
630 |
'Delete the selected file(s)' |
6099 | 631 |
|
632 |
#fileIn |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
633 |
'File in' |
6099 | 634 |
|
635 |
#fileHistory |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
636 |
'File history' |
6099 | 637 |
|
638 |
#fileGotoBookmark |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
639 |
'Goto bookmarked directory' |
6099 | 640 |
|
641 |
#hideToolBar |
|
13910 | 642 |
'Hide the toolbar (show again via "View"-menu)' |
6099 | 643 |
|
644 |
#hideFilenameEntryField |
|
13910 | 645 |
'Hide filename & filter fields (show again via "View"-menu)' |
646 |
||
647 |
#hideBookmarks |
|
648 |
'Hide the bookmarks (show again via "View"-menu)' |
|
6099 | 649 |
|
650 |
#openChangeBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
651 |
'Open a Changebrowser on file' |
6099 | 652 |
|
653 |
#showFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
654 |
'Show file details' |
6099 | 655 |
|
656 |
#hideFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
657 |
'Hide file details' |
6099 | 658 |
|
659 |
#toggleDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
660 |
'Show/hide file details' |
6099 | 661 |
|
662 |
#viewDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
663 |
'Show/hide file details' |
6099 | 664 |
|
665 |
#selectDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
666 |
'Select file details to be shown' |
6099 | 667 |
|
8088 | 668 |
#showDifferences |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
669 |
'Show differences between file and editor versions' |
8088 | 670 |
|
671 |
#toggleHexDisplay |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
672 |
'Toggle between hexadecimal and textual representation' |
8088 | 673 |
|
674 |
#findInBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
675 |
'Navigate the browser''s file list to the edited file' |
8088 | 676 |
|
677 |
#saveFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
678 |
'Save the editor''s contents into the file' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
679 |
|
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
680 |
#saveFileAs |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
681 |
'Save the editor''s contents into another file' |
8088 | 682 |
|
683 |
#reloadFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
684 |
'Reload from the file' |
8088 | 685 |
|
686 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
687 |
'Send to the printer' |
8088 | 688 |
|
6099 | 689 |
). |
690 |
||
8261 | 691 |
" |
692 |
self flyByHelpSpec |
|
693 |
" |
|
694 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
695 |
"Modified: / 06-10-2011 / 14:55:27 / cg" |
8261 | 696 |
! |
697 |
||
698 |
flyByHelpSpec |
|
699 |
<resource: #programHelp> |
|
700 |
||
701 |
|spec hist resources| |
|
702 |
||
703 |
spec := self basicFlyByHelpSpec. |
|
704 |
||
705 |
"/ add help items for the history |
|
6099 | 706 |
hist := self directoryHistory. |
707 |
hist notNil ifTrue:[ |
|
708 |
resources := self classResources. |
|
709 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
710 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 711 |
]. |
712 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
713 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 714 |
]. |
715 |
]. |
|
716 |
^ spec. |
|
717 |
||
718 |
" |
|
719 |
self flyByHelpSpec |
|
720 |
" |
|
721 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
722 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
5398 | 723 |
! ! |
724 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
725 |
!AbstractFileBrowser class methodsFor:'image specs'! |
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 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
728 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
729 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
730 |
^ Icon deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
731 |
! |
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 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
734 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
735 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
736 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
737 |
! |
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 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
740 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
741 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
742 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
743 |
! |
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 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
746 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
747 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
748 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
749 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
750 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
751 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
752 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
753 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
754 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
755 |
! |
3892 | 756 |
|
6337 | 757 |
disabledCursorIcon |
758 |
"This resource specification was automatically generated |
|
759 |
by the ImageEditor of ST/X." |
|
760 |
||
761 |
"Do not manually edit this!! If it is corrupted, |
|
762 |
the ImageEditor may not be able to read the specification." |
|
763 |
||
764 |
" |
|
765 |
self disabledCursorImage inspect |
|
766 |
ImageEditor openOnClass:self andSelector:#disabledCursorImage |
|
767 |
Icon flushCachedIcons |
|
768 |
" |
|
769 |
||
770 |
<resource: #image> |
|
771 |
||
772 |
^Icon |
|
8473 | 773 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
6337 | 774 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
775 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
776 |
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:' |
|
777 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
778 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
779 |
! |
|
780 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
781 |
disabledCursorImage |
6337 | 782 |
"/ DisabledCursorImage isNil ifTrue:[ |
783 |
"/ DisabledCursorImage := self disabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
784 |
"/ ]. |
|
3892 | 785 |
^ DisabledCursorImage |
786 |
! |
|
787 |
||
6337 | 788 |
enabledCursorIcon |
789 |
"This resource specification was automatically generated |
|
790 |
by the ImageEditor of ST/X." |
|
791 |
||
792 |
"Do not manually edit this!! If it is corrupted, |
|
793 |
the ImageEditor may not be able to read the specification." |
|
794 |
||
795 |
" |
|
796 |
self enabledCursorImage inspect |
|
797 |
ImageEditor openOnClass:self andSelector:#enabledCursorImage |
|
798 |
Icon flushCachedIcons |
|
799 |
" |
|
800 |
||
801 |
<resource: #image> |
|
802 |
||
803 |
^Icon |
|
8473 | 804 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
6337 | 805 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
806 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
807 |
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:' |
|
808 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
809 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
810 |
! |
|
811 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
812 |
enabledCursorImage |
6337 | 813 |
"/ EnabledCursorImage isNil ifTrue:[ |
814 |
"/ EnabledCursorImage := self enabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
815 |
"/ ]. |
|
3892 | 816 |
^ EnabledCursorImage |
6083 | 817 |
! |
818 |
||
3892 | 819 |
fileInIcon |
820 |
<resource: #programImage> |
|
821 |
||
6116 | 822 |
^ ToolbarIconLibrary fileInIcon |
3892 | 823 |
! |
824 |
||
6079 | 825 |
historyBackIcon |
826 |
<resource: #programImage> |
|
827 |
||
828 |
^ ToolbarIconLibrary historyBackIcon |
|
829 |
! |
|
830 |
||
831 |
historyForwardIcon |
|
832 |
<resource: #programImage> |
|
833 |
||
834 |
^ ToolbarIconLibrary historyForwardIcon |
|
835 |
! |
|
836 |
||
3892 | 837 |
homeIcon |
838 |
<resource: #programImage> |
|
839 |
||
6079 | 840 |
^ ToolbarIconLibrary homeIcon |
3892 | 841 |
! |
842 |
||
6074 | 843 |
homeIcon2 |
6079 | 844 |
<resource: #programImage> |
845 |
||
846 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 847 |
! |
848 |
||
849 |
htmlReloadIcon |
|
850 |
<resource: #programImage> |
|
851 |
||
852 |
^ ToolbarIconLibrary reload22x22Icon |
|
853 |
! |
|
854 |
||
3892 | 855 |
leftDownIcon |
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
856 |
<resource: #image> |
3892 | 857 |
"This resource specification was automatically generated |
858 |
by the ImageEditor of ST/X." |
|
859 |
"Do not manually edit this!! If it is corrupted, |
|
860 |
the ImageEditor may not be able to read the specification." |
|
861 |
" |
|
862 |
self leftDownIcon inspect |
|
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
863 |
ImageEditor openOnClass:self andSelector:#leftDownIcon" |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
864 |
|
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
865 |
^ Icon constantNamed:#'AbstractFileBrowser class leftDownIcon' |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
866 |
ifAbsentPut:[ |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
867 |
(Depth2Image new) |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
868 |
width:28; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
869 |
height:28; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
870 |
photometric:(#palette); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
871 |
bitsPerSample:(#( 2 )); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
872 |
samplesPerPixel:(1); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
873 |
bits:(ByteArray |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
874 |
fromPackedString:' |
3892 | 875 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
876 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
877 |
UUUU@@@@@@@AUUUUUUUUUP@a'); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
878 |
colorMapFromArray:#[ 255 255 255 0 0 0 40 40 100 255 0 0 ]; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
879 |
mask:((ImageMask new) |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
880 |
width:28; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
881 |
height:28; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
882 |
bits:(ByteArray |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
883 |
fromPackedString:' |
3892 | 884 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
885 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a'); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
886 |
yourself); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
887 |
yourself |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
888 |
] |
3892 | 889 |
! |
890 |
||
891 |
menuHistoryList9x20Icon |
|
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
892 |
<resource: #image> |
3892 | 893 |
"This resource specification was automatically generated |
894 |
by the ImageEditor of ST/X." |
|
895 |
"Do not manually edit this!! If it is corrupted, |
|
896 |
the ImageEditor may not be able to read the specification." |
|
897 |
" |
|
898 |
self menuHistoryList9x20Icon inspect |
|
899 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
900 |
Icon flushCachedIcons" |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
901 |
|
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
902 |
^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
903 |
ifAbsentPut:[ |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
904 |
(Depth1Image new) |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
905 |
width:9; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
906 |
height:20; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
907 |
photometric:(#palette); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
908 |
bitsPerSample:(#( 1 )); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
909 |
samplesPerPixel:(1); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
910 |
bits:(ByteArray |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
911 |
fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a'); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
912 |
colorMapFromArray:#[ 255 255 255 0 0 0 ]; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
913 |
mask:((ImageMask new) |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
914 |
width:9; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
915 |
height:20; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
916 |
bits:(ByteArray |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
917 |
fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a'); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
918 |
yourself); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
919 |
yourself |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
920 |
] |
3892 | 921 |
! |
922 |
||
923 |
menuHistoryListIcon |
|
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
924 |
<resource: #image> |
3892 | 925 |
"This resource specification was automatically generated |
926 |
by the ImageEditor of ST/X." |
|
927 |
"Do not manually edit this!! If it is corrupted, |
|
928 |
the ImageEditor may not be able to read the specification." |
|
929 |
" |
|
930 |
self menuHistoryListIcon inspect |
|
14419
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
931 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon" |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
932 |
|
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
933 |
^ Icon constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
934 |
ifAbsentPut:[ |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
935 |
(Depth1Image new) |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
936 |
width:12; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
937 |
height:12; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
938 |
photometric:(#palette); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
939 |
bitsPerSample:(#( 1 )); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
940 |
samplesPerPixel:(1); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
941 |
bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0'); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
942 |
colorMapFromArray:#[ 255 255 255 0 0 0 ]; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
943 |
mask:((ImageMask new) |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
944 |
width:12; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
945 |
height:12; |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
946 |
bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@'); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
947 |
yourself); |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
948 |
yourself |
2ae3acd9f3ec
Use ImageMask instead of Depth1Image for masks
Stefan Vogel <sv@exept.de>
parents:
14362
diff
changeset
|
949 |
] |
3892 | 950 |
! |
951 |
||
6087 | 952 |
newDirectoryIcon |
6074 | 953 |
<resource: #programImage> |
954 |
||
6087 | 955 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 956 |
! |
957 |
||
6091 | 958 |
removeTabIcon |
959 |
<resource: #programImage> |
|
960 |
||
961 |
^ ToolbarIconLibrary removeTabIcon |
|
962 |
! |
|
963 |
||
3892 | 964 |
vt100Terminal |
965 |
<resource: #programImage> |
|
966 |
||
967 |
^ ToolbarIconLibrary shell20x20Icon |
|
968 |
! ! |
|
969 |
||
5528 | 970 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
971 |
||
972 |
encodingDialogSpec |
|
973 |
"This resource specification was automatically generated |
|
974 |
by the UIPainter of ST/X." |
|
975 |
||
976 |
"Do not manually edit this!! If it is corrupted, |
|
977 |
the UIPainter may not be able to read the specification." |
|
978 |
||
979 |
" |
|
980 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
981 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
982 |
" |
|
983 |
||
984 |
<resource: #canvas> |
|
985 |
||
986 |
^ |
|
987 |
#(FullSpec |
|
988 |
name: encodingDialogSpec |
|
989 |
window: |
|
990 |
(WindowSpec |
|
991 |
label: 'File Encoding' |
|
992 |
name: 'File Encoding' |
|
993 |
min: (Point 10 10) |
|
5626 | 994 |
bounds: (Rectangle 0 0 379 590) |
5528 | 995 |
) |
996 |
component: |
|
997 |
(SpecCollection |
|
998 |
collection: ( |
|
999 |
(LabelSpec |
|
11053 | 1000 |
label: 'Select the External (File-) Encoding:' |
6236 | 1001 |
name: 'Label1' |
5528 | 1002 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
1003 |
translateLabel: true |
|
1004 |
adjust: left |
|
1005 |
) |
|
1006 |
(DataSetSpec |
|
1007 |
name: 'Table1' |
|
5737 | 1008 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 1009 |
model: selectedEncoding |
1010 |
hasHorizontalScrollBar: true |
|
1011 |
hasVerticalScrollBar: true |
|
1012 |
dataList: encodingList |
|
1013 |
has3Dseparators: true |
|
1014 |
columns: |
|
11053 | 1015 |
(Array |
5528 | 1016 |
|
1017 |
(DataSetColumnSpec |
|
1018 |
label: 'Encoding' |
|
1019 |
labelButtonType: Button |
|
1020 |
model: at: |
|
1021 |
canSelect: false |
|
1022 |
isResizeable: false |
|
1023 |
showRowSeparator: false |
|
1024 |
showColSeparator: false |
|
1025 |
) |
|
1026 |
(DataSetColumnSpec |
|
1027 |
label: 'Description' |
|
1028 |
labelButtonType: Button |
|
1029 |
model: at: |
|
1030 |
canSelect: false |
|
1031 |
isResizeable: false |
|
1032 |
showRowSeparator: false |
|
1033 |
showColSeparator: false |
|
1034 |
) |
|
1035 |
) |
|
5626 | 1036 |
doubleClickChannel: accept |
5528 | 1037 |
) |
1038 |
(HorizontalPanelViewSpec |
|
5737 | 1039 |
name: 'ButtonPanel' |
5528 | 1040 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
1041 |
horizontalLayout: fitSpace |
|
1042 |
verticalLayout: center |
|
1043 |
horizontalSpace: 3 |
|
1044 |
verticalSpace: 3 |
|
1045 |
reverseOrderIfOKAtLeft: true |
|
1046 |
component: |
|
1047 |
(SpecCollection |
|
1048 |
collection: ( |
|
1049 |
(ActionButtonSpec |
|
1050 |
label: 'Cancel' |
|
1051 |
name: 'Button2' |
|
1052 |
translateLabel: true |
|
1053 |
model: cancel |
|
5737 | 1054 |
extent: (Point 185 22) |
5528 | 1055 |
) |
1056 |
(ActionButtonSpec |
|
1057 |
label: 'OK' |
|
1058 |
name: 'Button1' |
|
1059 |
translateLabel: true |
|
1060 |
model: accept |
|
1061 |
isDefault: true |
|
5737 | 1062 |
extent: (Point 185 22) |
5528 | 1063 |
) |
1064 |
) |
|
1065 |
||
1066 |
) |
|
1067 |
) |
|
5737 | 1068 |
(CheckBoxSpec |
1069 |
label: 'Lock Encoding' |
|
1070 |
name: 'LockEncodingCheckBox' |
|
1071 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1072 |
activeHelpKey: lockFileEncoding |
|
1073 |
model: lockFileEncoding |
|
1074 |
translateLabel: true |
|
1075 |
) |
|
5528 | 1076 |
) |
1077 |
||
1078 |
) |
|
1079 |
) |
|
11053 | 1080 |
|
1081 |
"Modified: / 06-01-2012 / 15:40:54 / cg" |
|
1082 |
! |
|
1083 |
||
1084 |
lineEndConventionDialogSpec |
|
1085 |
"This resource specification was automatically generated |
|
1086 |
by the UIPainter of ST/X." |
|
1087 |
||
1088 |
"Do not manually edit this!! If it is corrupted, |
|
1089 |
the UIPainter may not be able to read the specification." |
|
1090 |
||
1091 |
" |
|
1092 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec |
|
1093 |
AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec |
|
1094 |
" |
|
1095 |
||
1096 |
<resource: #canvas> |
|
1097 |
||
1098 |
^ |
|
1099 |
#(FullSpec |
|
1100 |
name: lineEndConventionDialogSpec |
|
1101 |
window: |
|
1102 |
(WindowSpec |
|
1103 |
label: 'Line-End Convention' |
|
1104 |
name: 'Line-End Convention' |
|
1105 |
min: (Point 10 10) |
|
1106 |
bounds: (Rectangle 0 0 379 239) |
|
1107 |
) |
|
1108 |
component: |
|
1109 |
(SpecCollection |
|
1110 |
collection: ( |
|
1111 |
(LabelSpec |
|
11286 | 1112 |
label: 'Select the Line-End Convention (used when saving files):' |
11053 | 1113 |
name: 'Label1' |
1114 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1115 |
translateLabel: true |
|
1116 |
adjust: left |
|
1117 |
) |
|
1118 |
(VerticalPanelViewSpec |
|
1119 |
name: 'VerticalPanel1' |
|
1120 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1121 |
horizontalLayout: center |
|
1122 |
verticalLayout: center |
|
1123 |
horizontalSpace: 3 |
|
1124 |
verticalSpace: 3 |
|
1125 |
component: |
|
1126 |
(SpecCollection |
|
1127 |
collection: ( |
|
1128 |
(RadioButtonSpec |
|
1129 |
label: 'NL (Unix)' |
|
1130 |
name: 'RadioButton1' |
|
1131 |
translateLabel: true |
|
1132 |
model: lineEndConvention |
|
1133 |
isTriggerOnDown: true |
|
1134 |
select: nl |
|
1135 |
extent: (Point 136 22) |
|
1136 |
) |
|
1137 |
(RadioButtonSpec |
|
1138 |
label: 'CR-NL (MSDOS)' |
|
1139 |
name: 'RadioButton4' |
|
1140 |
translateLabel: true |
|
1141 |
model: lineEndConvention |
|
1142 |
isTriggerOnDown: true |
|
14659 | 1143 |
select: crlf |
11053 | 1144 |
extent: (Point 136 22) |
1145 |
) |
|
1146 |
(RadioButtonSpec |
|
1147 |
label: 'CR (Mac)' |
|
1148 |
name: 'RadioButton5' |
|
1149 |
translateLabel: true |
|
1150 |
model: lineEndConvention |
|
1151 |
isTriggerOnDown: true |
|
1152 |
select: cr |
|
1153 |
extent: (Point 136 22) |
|
1154 |
) |
|
1155 |
(RadioButtonSpec |
|
1156 |
label: 'EOL' |
|
1157 |
name: 'RadioButton6' |
|
1158 |
translateLabel: true |
|
1159 |
model: lineEndConvention |
|
1160 |
isTriggerOnDown: true |
|
1161 |
select: eol |
|
1162 |
extent: (Point 136 22) |
|
1163 |
) |
|
1164 |
(RadioButtonSpec |
|
1165 |
label: 'EOT' |
|
1166 |
name: 'RadioButton7' |
|
1167 |
translateLabel: true |
|
1168 |
model: lineEndConvention |
|
1169 |
isTriggerOnDown: true |
|
1170 |
select: eot |
|
1171 |
extent: (Point 136 22) |
|
1172 |
) |
|
1173 |
) |
|
1174 |
||
1175 |
) |
|
1176 |
) |
|
1177 |
(HorizontalPanelViewSpec |
|
1178 |
name: 'ButtonPanel' |
|
1179 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1180 |
horizontalLayout: fitSpace |
|
1181 |
verticalLayout: center |
|
1182 |
horizontalSpace: 3 |
|
1183 |
verticalSpace: 3 |
|
1184 |
reverseOrderIfOKAtLeft: true |
|
1185 |
component: |
|
1186 |
(SpecCollection |
|
1187 |
collection: ( |
|
1188 |
(ActionButtonSpec |
|
1189 |
label: 'Cancel' |
|
1190 |
name: 'Button2' |
|
1191 |
translateLabel: true |
|
1192 |
model: cancel |
|
1193 |
extent: (Point 185 22) |
|
1194 |
) |
|
1195 |
(ActionButtonSpec |
|
1196 |
label: 'OK' |
|
1197 |
name: 'Button1' |
|
1198 |
translateLabel: true |
|
1199 |
model: accept |
|
1200 |
isDefault: true |
|
1201 |
extent: (Point 185 22) |
|
1202 |
) |
|
1203 |
) |
|
1204 |
||
1205 |
) |
|
1206 |
) |
|
1207 |
) |
|
1208 |
||
1209 |
) |
|
1210 |
) |
|
11286 | 1211 |
|
1212 |
"Modified: / 28-02-2012 / 11:12:03 / cg" |
|
11053 | 1213 |
! |
1214 |
||
1215 |
tabStopConversionDialogSpec |
|
1216 |
"This resource specification was automatically generated |
|
1217 |
by the UIPainter of ST/X." |
|
1218 |
||
1219 |
"Do not manually edit this!! If it is corrupted, |
|
1220 |
the UIPainter may not be able to read the specification." |
|
1221 |
||
1222 |
" |
|
1223 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec |
|
1224 |
AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec |
|
1225 |
" |
|
1226 |
||
1227 |
<resource: #canvas> |
|
1228 |
||
1229 |
^ |
|
1230 |
#(FullSpec |
|
1231 |
name: 'tabStopConversionDialogSpec' |
|
1232 |
window: |
|
1233 |
(WindowSpec |
|
1234 |
label: 'Tab-Stop Conversion' |
|
1235 |
name: 'Tab-Stop Conversion' |
|
1236 |
min: (Point 10 10) |
|
1237 |
bounds: (Rectangle 0 0 379 239) |
|
1238 |
) |
|
1239 |
component: |
|
1240 |
(SpecCollection |
|
1241 |
collection: ( |
|
1242 |
(LabelSpec |
|
11286 | 1243 |
label: 'Select the Tab-Stop Conversion (used when saving files):' |
11053 | 1244 |
name: 'Label1' |
1245 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1246 |
translateLabel: true |
|
1247 |
adjust: left |
|
1248 |
) |
|
1249 |
(VerticalPanelViewSpec |
|
1250 |
name: 'VerticalPanel1' |
|
1251 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1252 |
horizontalLayout: center |
|
1253 |
verticalLayout: center |
|
1254 |
horizontalSpace: 3 |
|
1255 |
verticalSpace: 3 |
|
1256 |
component: |
|
1257 |
(SpecCollection |
|
1258 |
collection: ( |
|
1259 |
(RadioButtonSpec |
|
1260 |
label: '4' |
|
1261 |
name: 'RadioButton1' |
|
1262 |
translateLabel: true |
|
1263 |
model: tabStops |
|
1264 |
isTriggerOnDown: true |
|
1265 |
select: 4 |
|
1266 |
extent: (Point 136 22) |
|
1267 |
) |
|
1268 |
(RadioButtonSpec |
|
1269 |
label: '8' |
|
1270 |
name: 'RadioButton4' |
|
1271 |
translateLabel: true |
|
1272 |
model: tabStops |
|
1273 |
isTriggerOnDown: true |
|
1274 |
select: 8 |
|
1275 |
extent: (Point 136 22) |
|
1276 |
) |
|
1277 |
) |
|
1278 |
||
1279 |
) |
|
1280 |
) |
|
1281 |
(HorizontalPanelViewSpec |
|
1282 |
name: 'ButtonPanel' |
|
1283 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1284 |
horizontalLayout: fitSpace |
|
1285 |
verticalLayout: center |
|
1286 |
horizontalSpace: 3 |
|
1287 |
verticalSpace: 3 |
|
1288 |
reverseOrderIfOKAtLeft: true |
|
1289 |
component: |
|
1290 |
(SpecCollection |
|
1291 |
collection: ( |
|
1292 |
(ActionButtonSpec |
|
1293 |
label: 'Cancel' |
|
1294 |
name: 'Button2' |
|
1295 |
translateLabel: true |
|
1296 |
model: cancel |
|
1297 |
extent: (Point 185 22) |
|
1298 |
) |
|
1299 |
(ActionButtonSpec |
|
1300 |
label: 'OK' |
|
1301 |
name: 'Button1' |
|
1302 |
translateLabel: true |
|
1303 |
model: accept |
|
1304 |
isDefault: true |
|
1305 |
extent: (Point 185 22) |
|
1306 |
) |
|
1307 |
) |
|
1308 |
||
1309 |
) |
|
1310 |
) |
|
1311 |
) |
|
1312 |
||
1313 |
) |
|
1314 |
) |
|
11286 | 1315 |
|
1316 |
"Modified: / 28-02-2012 / 11:12:38 / cg" |
|
5528 | 1317 |
! ! |
1318 |
||
3892 | 1319 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1320 |
||
1321 |
baseBookmarksMenuSpec |
|
1322 |
"This resource specification was automatically generated |
|
1323 |
by the MenuEditor of ST/X." |
|
1324 |
||
1325 |
"Do not manually edit this!! If it is corrupted, |
|
1326 |
the MenuEditor may not be able to read the specification." |
|
1327 |
||
1328 |
" |
|
1329 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1330 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1331 |
" |
|
1332 |
||
1333 |
<resource: #menu> |
|
1334 |
||
1335 |
^ |
|
6551 | 1336 |
#(Menu |
1337 |
( |
|
1338 |
(MenuItem |
|
1339 |
enabled: currentFilesHasDirectories |
|
1340 |
label: 'Add Bookmark' |
|
1341 |
itemValue: addBookmark |
|
1342 |
translateLabel: true |
|
4414 | 1343 |
) |
6551 | 1344 |
(MenuItem |
1345 |
enabled: hasBookmarksToRemove |
|
1346 |
label: 'Remove Bookmark' |
|
1347 |
itemValue: removeBookmark |
|
1348 |
translateLabel: true |
|
4414 | 1349 |
) |
6551 | 1350 |
(MenuItem |
1351 |
label: 'Save Bookmarks In...' |
|
1352 |
itemValue: saveBookmarks |
|
1353 |
translateLabel: true |
|
4679 | 1354 |
) |
4414 | 1355 |
) |
1356 |
nil |
|
1357 |
nil |
|
3892 | 1358 |
) |
1359 |
! |
|
1360 |
||
6102 | 1361 |
baseBookmarksMenuSpec2 |
1362 |
"This resource specification was automatically generated |
|
1363 |
by the MenuEditor of ST/X." |
|
1364 |
||
1365 |
"Do not manually edit this!! If it is corrupted, |
|
1366 |
the MenuEditor may not be able to read the specification." |
|
1367 |
||
1368 |
" |
|
8013 | 1369 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
1370 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
6102 | 1371 |
" |
1372 |
||
1373 |
<resource: #menu> |
|
1374 |
||
1375 |
^ |
|
8013 | 1376 |
#(Menu |
1377 |
( |
|
1378 |
(MenuItem |
|
1379 |
label: 'Edit Bookmarks' |
|
1380 |
itemValue: editBookmarks |
|
1381 |
translateLabel: true |
|
1382 |
) |
|
1383 |
(MenuItem |
|
1384 |
label: '-' |
|
1385 |
) |
|
1386 |
(MenuItem |
|
1387 |
enabled: currentFilesHasDirectories |
|
1388 |
label: 'Add Bookmark' |
|
1389 |
itemValue: addBookmark |
|
1390 |
translateLabel: true |
|
6102 | 1391 |
) |
1392 |
) |
|
1393 |
nil |
|
1394 |
nil |
|
1395 |
) |
|
1396 |
! |
|
1397 |
||
4110 | 1398 |
browserMenu |
1399 |
"This resource specification was automatically generated |
|
1400 |
by the MenuEditor of ST/X." |
|
1401 |
||
1402 |
"Do not manually edit this!! If it is corrupted, |
|
1403 |
the MenuEditor may not be able to read the specification." |
|
1404 |
||
10923 | 1405 |
|
4110 | 1406 |
" |
1407 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1408 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1409 |
" |
|
1410 |
||
1411 |
<resource: #menu> |
|
1412 |
||
1413 |
^ |
|
5273 | 1414 |
#(Menu |
1415 |
( |
|
1416 |
(MenuItem |
|
7315 | 1417 |
label: 'Spawn Filebrowser' |
5273 | 1418 |
itemValue: doSpawn |
1419 |
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
|
1420 |
shortcutKey: Ctrln |
4201 | 1421 |
) |
5273 | 1422 |
(MenuItem |
7829 | 1423 |
label: 'Windows Explorer' |
1424 |
itemValue: doOpenExplorer |
|
1425 |
translateLabel: true |
|
8256 | 1426 |
isVisible: systemIsDOS |
1427 |
) |
|
1428 |
(MenuItem |
|
12473 | 1429 |
label: 'Open Finder' |
1430 |
itemValue: doOpenFinder |
|
1431 |
translateLabel: true |
|
1432 |
isVisible: systemIsOSX |
|
1433 |
) |
|
1434 |
(MenuItem |
|
8256 | 1435 |
label: 'C Browser' |
1436 |
itemValue: doOpenCBrowser |
|
1437 |
translateLabel: true |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
1438 |
isVisible: cBrowserMenuItemVisible |
7829 | 1439 |
) |
1440 |
(MenuItem |
|
5273 | 1441 |
label: '-' |
4201 | 1442 |
) |
5273 | 1443 |
(MenuItem |
6335 | 1444 |
label: 'Add Text Editor Page' |
5273 | 1445 |
itemValue: newTextEditor |
1446 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
1447 |
shortcutKey: Ctrlt |
4392 | 1448 |
) |
5273 | 1449 |
(MenuItem |
6335 | 1450 |
label: 'Add Shell Terminal Page' |
5273 | 1451 |
itemValue: doAddTerminal |
1452 |
translateLabel: true |
|
4201 | 1453 |
) |
5273 | 1454 |
(MenuItem |
10923 | 1455 |
label: 'Add Archiver Page' |
1456 |
itemValue: doAddArchiver |
|
1457 |
translateLabel: true |
|
1458 |
) |
|
1459 |
(MenuItem |
|
6335 | 1460 |
label: 'Add Search Page' |
5273 | 1461 |
itemValue: doOpenSearchFile |
1462 |
translateLabel: true |
|
4201 | 1463 |
) |
5273 | 1464 |
(MenuItem |
1465 |
label: '-' |
|
11053 | 1466 |
isVisible: false |
4201 | 1467 |
) |
5273 | 1468 |
(MenuItem |
1469 |
label: 'Settings...' |
|
1470 |
itemValue: doOpenSettings |
|
1471 |
translateLabel: true |
|
11053 | 1472 |
isVisible: false |
5104 | 1473 |
) |
5273 | 1474 |
(MenuItem |
5528 | 1475 |
label: 'Encoding...' |
1476 |
itemValue: fileEncodingDialog |
|
1477 |
translateLabel: true |
|
11053 | 1478 |
isVisible: false |
1479 |
) |
|
1480 |
(MenuItem |
|
1481 |
label: 'Line End Convention...' |
|
1482 |
itemValue: lineEndConventionDialog |
|
1483 |
translateLabel: true |
|
1484 |
isVisible: false |
|
1485 |
) |
|
1486 |
(MenuItem |
|
1487 |
label: 'Tab Stop Conversion...' |
|
1488 |
itemValue: tabStopConversionDialog |
|
1489 |
translateLabel: true |
|
1490 |
isVisible: false |
|
5528 | 1491 |
) |
1492 |
(MenuItem |
|
5273 | 1493 |
label: '-' |
5104 | 1494 |
) |
5273 | 1495 |
(MenuItem |
1496 |
label: 'Exit' |
|
1497 |
itemValue: closeRequest |
|
1498 |
translateLabel: true |
|
4201 | 1499 |
) |
1500 |
) |
|
1501 |
nil |
|
1502 |
nil |
|
4110 | 1503 |
) |
11057 | 1504 |
|
1505 |
"Modified: / 07-01-2012 / 12:51:20 / cg" |
|
4110 | 1506 |
! |
1507 |
||
3892 | 1508 |
directoryMenu |
1509 |
"This resource specification was automatically generated |
|
1510 |
by the MenuEditor of ST/X." |
|
1511 |
||
1512 |
"Do not manually edit this!! If it is corrupted, |
|
1513 |
the MenuEditor may not be able to read the specification." |
|
1514 |
||
11767 | 1515 |
|
3892 | 1516 |
" |
1517 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1518 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1519 |
" |
|
1520 |
||
1521 |
<resource: #menu> |
|
1522 |
||
1523 |
^ |
|
6220 | 1524 |
#(Menu |
1525 |
( |
|
1526 |
(MenuItem |
|
14742 | 1527 |
label: 'Bookmarks' |
1528 |
submenuChannel: bookmarksMenu |
|
1529 |
) |
|
1530 |
(MenuItem |
|
1531 |
label: 'Visited Directories' |
|
1532 |
submenuChannel: visitedDirectoriesMenu |
|
4414 | 1533 |
) |
6220 | 1534 |
(MenuItem |
1535 |
label: '-' |
|
4414 | 1536 |
) |
6220 | 1537 |
(MenuItem |
14742 | 1538 |
label: 'Up' |
1539 |
itemValue: doGoDirectoryUp |
|
1540 |
) |
|
1541 |
(MenuItem |
|
6220 | 1542 |
activeHelpKey: directoryBack |
1543 |
enabled: enableBack |
|
1544 |
label: 'Back' |
|
1545 |
itemValue: doBack |
|
4414 | 1546 |
) |
6220 | 1547 |
(MenuItem |
1548 |
activeHelpKey: directoryBack |
|
1549 |
enabled: enableForward |
|
1550 |
label: 'Forward' |
|
1551 |
itemValue: doForward |
|
4414 | 1552 |
) |
6220 | 1553 |
(MenuItem |
1554 |
label: '-' |
|
4414 | 1555 |
) |
6220 | 1556 |
(MenuItem |
9596 | 1557 |
enabled: enableHome |
6434 | 1558 |
label: 'Home Directory' |
1559 |
itemValue: doGotoHomeDirectory |
|
1560 |
) |
|
1561 |
(MenuItem |
|
9596 | 1562 |
enabled: enableGotoDesktopDirectory |
9572 | 1563 |
label: 'Desktop' |
1564 |
itemValue: doGotoDesktopDirectory |
|
1565 |
) |
|
1566 |
(MenuItem |
|
9596 | 1567 |
enabled: enableGotoDefaultDirectory |
6434 | 1568 |
label: 'Default (Current) Directory' |
6220 | 1569 |
itemValue: doGotoDefaultDirectory |
9596 | 1570 |
) |
1571 |
(MenuItem |
|
1572 |
enabled: enableGotoSmalltalkDirectory |
|
1573 |
label: 'Smalltalk (Application) Directory' |
|
1574 |
itemValue: doGotoSmalltalkDirectory |
|
4414 | 1575 |
) |
6220 | 1576 |
(MenuItem |
9677 | 1577 |
enabled: enableGotoTempDirectory |
11995 | 1578 |
label: 'Smalltalk Temp Directory' |
9677 | 1579 |
itemValue: doGotoTempDirectory |
1580 |
) |
|
1581 |
(MenuItem |
|
9596 | 1582 |
label: '-' |
1583 |
) |
|
1584 |
(MenuItem |
|
1585 |
enabled: enableMakeCurrentDirectory |
|
1586 |
label: 'Make this the Default (Current) Directory' |
|
1587 |
itemValue: doMakeCurrentDirectory |
|
4414 | 1588 |
) |
1589 |
) |
|
1590 |
nil |
|
1591 |
nil |
|
3892 | 1592 |
) |
1593 |
! |
|
1594 |
||
1595 |
editMenu |
|
1596 |
"This resource specification was automatically generated |
|
1597 |
by the MenuEditor of ST/X." |
|
1598 |
||
1599 |
"Do not manually edit this!! If it is corrupted, |
|
1600 |
the MenuEditor may not be able to read the specification." |
|
1601 |
||
1602 |
" |
|
1603 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1604 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1605 |
" |
|
1606 |
||
1607 |
<resource: #menu> |
|
1608 |
||
1609 |
^ |
|
5888 | 1610 |
#(Menu |
1611 |
( |
|
1612 |
(MenuItem |
|
1613 |
enabled: hasFileSelection |
|
1614 |
label: 'Copy Selected Filenames to Clipboard' |
|
1615 |
itemValue: copySelectedFilenames |
|
1616 |
translateLabel: true |
|
4414 | 1617 |
) |
5888 | 1618 |
(MenuItem |
1619 |
enabled: fileListIsNotEmpty |
|
1620 |
label: 'Copy All Filenames to Clipboard' |
|
1621 |
itemValue: copyFileList |
|
1622 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1623 |
) |
4414 | 1624 |
) |
1625 |
nil |
|
1626 |
nil |
|
3892 | 1627 |
) |
1628 |
! |
|
1629 |
||
6099 | 1630 |
emptyMenuSpec |
1631 |
"This resource specification was automatically generated |
|
1632 |
by the MenuEditor of ST/X." |
|
1633 |
||
1634 |
"Do not manually edit this!! If it is corrupted, |
|
1635 |
the MenuEditor may not be able to read the specification." |
|
1636 |
||
1637 |
" |
|
1638 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1639 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1640 |
" |
|
1641 |
||
1642 |
<resource: #menu> |
|
1643 |
||
1644 |
^ |
|
1645 |
#(#Menu |
|
1646 |
#( |
|
1647 |
) |
|
1648 |
nil |
|
1649 |
nil |
|
1650 |
) |
|
1651 |
! |
|
1652 |
||
11053 | 1653 |
extraMenu |
1654 |
"This resource specification was automatically generated |
|
1655 |
by the MenuEditor of ST/X." |
|
1656 |
||
1657 |
"Do not manually edit this!! If it is corrupted, |
|
1658 |
the MenuEditor may not be able to read the specification." |
|
1659 |
||
1660 |
||
1661 |
" |
|
1662 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu |
|
1663 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp |
|
1664 |
" |
|
1665 |
||
1666 |
<resource: #menu> |
|
1667 |
||
1668 |
^ |
|
1669 |
#(Menu |
|
1670 |
( |
|
1671 |
(MenuItem |
|
1672 |
label: 'Encoding...' |
|
1673 |
itemValue: fileEncodingDialog |
|
1674 |
translateLabel: true |
|
1675 |
) |
|
1676 |
(MenuItem |
|
1677 |
label: 'Line End Convention...' |
|
1678 |
itemValue: lineEndConventionDialog |
|
1679 |
translateLabel: true |
|
1680 |
) |
|
1681 |
(MenuItem |
|
1682 |
label: 'Tab Stop Conversion...' |
|
1683 |
itemValue: tabStopConversionDialog |
|
1684 |
translateLabel: true |
|
1685 |
) |
|
1686 |
(MenuItem |
|
1687 |
label: '-' |
|
1688 |
) |
|
1689 |
(MenuItem |
|
1690 |
label: 'Settings...' |
|
1691 |
itemValue: doOpenSettings |
|
1692 |
translateLabel: true |
|
11286 | 1693 |
labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...') |
11053 | 1694 |
) |
1695 |
) |
|
1696 |
nil |
|
1697 |
nil |
|
1698 |
) |
|
1699 |
! |
|
1700 |
||
3892 | 1701 |
fileMenu |
1702 |
"This resource specification was automatically generated |
|
1703 |
by the MenuEditor of ST/X." |
|
1704 |
||
1705 |
"Do not manually edit this!! If it is corrupted, |
|
1706 |
the MenuEditor may not be able to read the specification." |
|
1707 |
||
12497 | 1708 |
|
3892 | 1709 |
" |
1710 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1711 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1712 |
" |
|
1713 |
||
1714 |
<resource: #menu> |
|
1715 |
||
1716 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1717 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1718 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1719 |
(MenuItem |
14742 | 1720 |
enabled: enableFileHistory |
1721 |
label: 'File History' |
|
1722 |
submenuChannel: menuFileHistory |
|
1723 |
) |
|
1724 |
(MenuItem |
|
1725 |
label: '-' |
|
1726 |
) |
|
1727 |
(MenuItem |
|
6593 | 1728 |
label: 'Open' |
1729 |
itemValue: doShowFileContents |
|
1730 |
) |
|
1731 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1732 |
label: '-' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1733 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1734 |
(MenuItem |
6593 | 1735 |
enabled: hasFileSelection |
1736 |
label: 'FileIn' |
|
1737 |
itemValue: fileFileIn |
|
1738 |
) |
|
1739 |
(MenuItem |
|
1740 |
enabled: hasFileSelection |
|
1741 |
label: 'FileIn to Namespace...' |
|
1742 |
itemValue: fileFileInToNameSpace |
|
12497 | 1743 |
) |
1744 |
(MenuItem |
|
1745 |
enabled: hasPackageDirectorySelected |
|
1746 |
label: 'Load Package from Here' |
|
1747 |
itemValue: fileFileInPackage |
|
6593 | 1748 |
) |
1749 |
(MenuItem |
|
1750 |
label: '-' |
|
1751 |
) |
|
1752 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1753 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1754 |
submenuChannel: newMenu |
5425 | 1755 |
keepLinkedMenu: true |
4414 | 1756 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1757 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1758 |
label: '-' |
4534 | 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 |
5945 | 1762 |
label: 'Cut' |
1763 |
itemValue: cutFiles |
|
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
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 |
enabled: hasSelection |
5945 | 1767 |
label: 'Copy' |
1768 |
itemValue: copyFiles |
|
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1769 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1770 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1771 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1772 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1773 |
itemValue: pasteFiles |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1774 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1775 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1776 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1777 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1778 |
itemValue: deleteFiles |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1779 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1780 |
(MenuItem |
6169 | 1781 |
enabled: hasSelection |
1782 |
label: 'Erase' |
|
1783 |
itemValue: eraseFiles |
|
1784 |
) |
|
1785 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1786 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1787 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1788 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1789 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1790 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1791 |
itemValue: renameSelection |
8716 | 1792 |
shortcutKey: Rename |
4414 | 1793 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1794 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1795 |
enabled: hasSelection |
5634 | 1796 |
label: 'Move To...' |
6107 | 1797 |
itemValue: moveSelectionTo |
1798 |
) |
|
1799 |
(MenuItem |
|
1800 |
enabled: hasSelection |
|
1801 |
label: 'Copy To...' |
|
1802 |
itemValue: copySelectionTo |
|
4414 | 1803 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1804 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1805 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1806 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1807 |
itemValue: doShowProperties |
4554 | 1808 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1809 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1810 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1811 |
isVisible: javaSupportLoaded |
4414 | 1812 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1813 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1814 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1815 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1816 |
isVisible: javaSupportLoaded |
4414 | 1817 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1818 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1819 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1820 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1821 |
isVisible: javaSupportLoaded |
4414 | 1822 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1823 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1824 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1825 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1826 |
isVisible: javaSupportLoaded |
4414 | 1827 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1828 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1829 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1830 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1831 |
isVisible: javaSupportLoaded |
4414 | 1832 |
) |
1833 |
) |
|
1834 |
nil |
|
1835 |
nil |
|
3892 | 1836 |
) |
1837 |
! |
|
1838 |
||
4930 | 1839 |
fileOpMenu |
1840 |
"This resource specification was automatically generated |
|
1841 |
by the MenuEditor of ST/X." |
|
1842 |
||
1843 |
"Do not manually edit this!! If it is corrupted, |
|
1844 |
the MenuEditor may not be able to read the specification." |
|
1845 |
||
13089 | 1846 |
|
4930 | 1847 |
" |
1848 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1849 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1850 |
" |
|
1851 |
||
1852 |
<resource: #menu> |
|
1853 |
||
1854 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1855 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1856 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1857 |
(MenuItem |
13089 | 1858 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1859 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1860 |
itemValue: splitSelectedFiles |
13089 | 1861 |
) |
1862 |
(MenuItem |
|
12871 | 1863 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1864 |
label: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1865 |
itemValue: joinSelectedFiles |
13089 | 1866 |
) |
1867 |
(MenuItem |
|
12871 | 1868 |
enabled: hasFileSelection |
7635 | 1869 |
label: 'Copy Corrupted File To...' |
1870 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1871 |
) |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1872 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1873 |
label: '-' |
4930 | 1874 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1875 |
(MenuItem |
13089 | 1876 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1877 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1878 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1879 |
argument: rot13 |
4930 | 1880 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1881 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1882 |
label: '-' |
4930 | 1883 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1884 |
(MenuItem |
12871 | 1885 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1886 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1887 |
itemValue: truncateSelectedFilesToZeroSize |
4930 | 1888 |
) |
9490 | 1889 |
(MenuItem |
1890 |
label: '-' |
|
1891 |
) |
|
1892 |
(MenuItem |
|
13089 | 1893 |
label: 'Load Signature Support Package' |
1894 |
itemValue: loadSignatureSupport |
|
1895 |
isVisible: cannotGenerateSignatureFiles |
|
1896 |
) |
|
1897 |
(MenuItem |
|
1898 |
enabled: canGenerateSignatureFiles |
|
9490 | 1899 |
label: 'Generate Signed Files' |
1900 |
itemValue: generateSignaturesForSelectedFiles |
|
13089 | 1901 |
) |
1902 |
(MenuItem |
|
9490 | 1903 |
enabled: canGenerateSignatureFiles |
1904 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1905 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1906 |
) |
|
9596 | 1907 |
(MenuItem |
13783 | 1908 |
enabled: canGenerateSignatureFiles |
1909 |
label: 'Generate Patch Installer for File(s)' |
|
1910 |
itemValue: generatePatchInstallerForSelectedFiles |
|
1911 |
) |
|
1912 |
(MenuItem |
|
9596 | 1913 |
label: '-' |
1914 |
) |
|
1915 |
(MenuItem |
|
12871 | 1916 |
enabled: hasFileSelection |
9596 | 1917 |
label: 'File Differences' |
1918 |
itemValue: openDiffView |
|
1919 |
isVisible: hasTwoFilesSelectedHolder |
|
1920 |
) |
|
1921 |
(MenuItem |
|
12871 | 1922 |
enabled: hasFileSelection |
9596 | 1923 |
label: 'File Differences...' |
1924 |
itemValue: openDiffView |
|
1925 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1926 |
) |
|
1927 |
(MenuItem |
|
1928 |
enabled: hasSelection |
|
1929 |
label: 'Directory Differences' |
|
1930 |
itemValue: openDirectoryDiffView |
|
1931 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
1932 |
) |
|
1933 |
(MenuItem |
|
1934 |
enabled: hasSelection |
|
1935 |
label: 'Directory Differences...' |
|
1936 |
itemValue: openDirectoryDiffView |
|
1937 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
1938 |
) |
|
4930 | 1939 |
) |
1940 |
nil |
|
1941 |
nil |
|
1942 |
) |
|
1943 |
! |
|
1944 |
||
3892 | 1945 |
newMenu |
1946 |
"This resource specification was automatically generated |
|
1947 |
by the MenuEditor of ST/X." |
|
1948 |
||
1949 |
"Do not manually edit this!! If it is corrupted, |
|
1950 |
the MenuEditor may not be able to read the specification." |
|
1951 |
||
1952 |
" |
|
1953 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1954 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1955 |
" |
|
1956 |
||
1957 |
<resource: #menu> |
|
1958 |
||
1959 |
^ |
|
1960 |
#(#Menu |
|
4414 | 1961 |
#( |
1962 |
#(#MenuItem |
|
1963 |
#label: 'Directory...' |
|
1964 |
#translateLabel: true |
|
1965 |
#value: #newDirectory |
|
1966 |
) |
|
1967 |
#(#MenuItem |
|
1968 |
#label: 'File...' |
|
1969 |
#translateLabel: true |
|
1970 |
#value: #newFile |
|
1971 |
) |
|
1972 |
#(#MenuItem |
|
1973 |
#label: 'Hard Link...' |
|
1974 |
#translateLabel: true |
|
1975 |
#isVisible: #systemIsUnix |
|
1976 |
#value: #newHardLink |
|
1977 |
) |
|
1978 |
#(#MenuItem |
|
1979 |
#label: 'Symbolic Link...' |
|
1980 |
#translateLabel: true |
|
1981 |
#isVisible: #systemIsUnix |
|
1982 |
#value: #newSoftLink |
|
1983 |
) |
|
1984 |
) |
|
1985 |
nil |
|
1986 |
nil |
|
3892 | 1987 |
) |
3906 | 1988 |
! |
1989 |
||
13856 | 1990 |
scmMenuSlice |
1991 |
"This resource specification was automatically generated |
|
1992 |
by the MenuEditor of ST/X." |
|
1993 |
||
1994 |
"Do not manually edit this!! If it is corrupted, |
|
1995 |
the MenuEditor may not be able to read the specification." |
|
1996 |
||
1997 |
||
1998 |
" |
|
1999 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#scmMenuSlice |
|
2000 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser scmMenuSlice)) startUp |
|
2001 |
" |
|
2002 |
||
2003 |
<resource: #menu> |
|
2004 |
||
2005 |
^ |
|
2006 |
#(Menu |
|
2007 |
( |
|
2008 |
(MenuItem |
|
2009 |
label: 'CVS' |
|
2010 |
isVisible: cvsMenusAreShown |
|
2011 |
submenuChannel: cvsMenu |
|
2012 |
) |
|
2013 |
(MenuItem |
|
2014 |
label: 'SVN' |
|
2015 |
isVisible: svnMenusAreShown |
|
2016 |
submenuChannel: svnMenu |
|
2017 |
) |
|
2018 |
(MenuItem |
|
2019 |
label: 'Mercurial' |
|
2020 |
isVisible: mercurialMenusAreShown |
|
2021 |
submenuChannel: mercurialMenu |
|
2022 |
) |
|
2023 |
(MenuItem |
|
2024 |
label: 'HG' |
|
2025 |
isVisible: hgMenusAreShown |
|
2026 |
submenuChannel: hgMenu |
|
2027 |
) |
|
2028 |
(MenuItem |
|
2029 |
label: 'Perforce' |
|
2030 |
isVisible: perforceMenusAreShown |
|
2031 |
submenuChannel: perforceMenu |
|
2032 |
) |
|
2033 |
) |
|
2034 |
nil |
|
2035 |
nil |
|
2036 |
) |
|
2037 |
! |
|
2038 |
||
4201 | 2039 |
showMenuSpec |
2040 |
"This resource specification was automatically generated |
|
2041 |
by the MenuEditor of ST/X." |
|
2042 |
||
2043 |
"Do not manually edit this!! If it is corrupted, |
|
2044 |
the MenuEditor may not be able to read the specification." |
|
2045 |
||
2046 |
" |
|
2047 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
2048 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
2049 |
" |
|
2050 |
||
2051 |
<resource: #menu> |
|
2052 |
||
2053 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2054 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2055 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2056 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2057 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2058 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2059 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2060 |
indication: showHiddenFiles |
4201 | 2061 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2062 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2063 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2064 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2065 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2066 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2067 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2068 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2069 |
indication: showDirectoryTree |
4201 | 2070 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2071 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2072 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2073 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2074 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2075 |
indication: viewFilesInDirectoryTree |
4201 | 2076 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2077 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2078 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2079 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2080 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2081 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2082 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2083 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2084 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2085 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2086 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2087 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2088 |
indication: viewNoteBookApplicationHolder |
4201 | 2089 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2090 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2091 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2092 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2093 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2094 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2095 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2096 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2097 |
indication: showDiskUsageHolder |
4201 | 2098 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2099 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2100 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2101 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2102 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2103 |
! |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2104 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2105 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2106 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2107 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2108 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2109 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2110 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2111 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2112 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2113 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2114 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2115 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2116 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2117 |
<resource: #menu> |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2118 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2119 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2120 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2121 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2122 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2123 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2124 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2125 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2126 |
indication: showHiddenFiles |
4554 | 2127 |
) |
4201 | 2128 |
) |
2129 |
nil |
|
2130 |
nil |
|
2131 |
) |
|
2132 |
! |
|
2133 |
||
3906 | 2134 |
sortMenu |
2135 |
"This resource specification was automatically generated |
|
2136 |
by the MenuEditor of ST/X." |
|
2137 |
||
2138 |
"Do not manually edit this!! If it is corrupted, |
|
2139 |
the MenuEditor may not be able to read the specification." |
|
2140 |
||
2141 |
" |
|
3907 | 2142 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
2143 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 2144 |
" |
2145 |
||
2146 |
<resource: #menu> |
|
2147 |
||
2148 |
^ |
|
2149 |
#(#Menu |
|
4414 | 2150 |
#( |
2151 |
#(#MenuItem |
|
2152 |
#label: 'By Filename' |
|
2153 |
#translateLabel: true |
|
2154 |
#hideMenuOnActivated: false |
|
2155 |
#choice: #sortBlockProperty |
|
2156 |
#choiceValue: #baseName |
|
2157 |
) |
|
2158 |
#(#MenuItem |
|
5122 | 2159 |
#label: 'By Extension' |
4414 | 2160 |
#translateLabel: true |
2161 |
#hideMenuOnActivated: false |
|
2162 |
#choice: #sortBlockProperty |
|
2163 |
#choiceValue: #suffix |
|
2164 |
) |
|
2165 |
#(#MenuItem |
|
2166 |
#label: 'By Permissions' |
|
2167 |
#translateLabel: true |
|
2168 |
#hideMenuOnActivated: false |
|
2169 |
#choice: #sortBlockProperty |
|
2170 |
#choiceValue: #permissions |
|
2171 |
) |
|
2172 |
#(#MenuItem |
|
2173 |
#label: 'By Owner' |
|
2174 |
#translateLabel: true |
|
2175 |
#isVisible: #viewOwner |
|
2176 |
#hideMenuOnActivated: false |
|
2177 |
#choice: #sortBlockProperty |
|
2178 |
#choiceValue: #owner |
|
2179 |
) |
|
2180 |
#(#MenuItem |
|
2181 |
#label: 'By Group' |
|
2182 |
#translateLabel: true |
|
2183 |
#isVisible: #viewOwner |
|
2184 |
#hideMenuOnActivated: false |
|
2185 |
#choice: #sortBlockProperty |
|
2186 |
#choiceValue: #group |
|
2187 |
) |
|
2188 |
#(#MenuItem |
|
2189 |
#label: 'By Size' |
|
2190 |
#translateLabel: true |
|
2191 |
#hideMenuOnActivated: false |
|
2192 |
#choice: #sortBlockProperty |
|
2193 |
#choiceValue: #fileSize |
|
2194 |
) |
|
2195 |
#(#MenuItem |
|
2196 |
#label: 'By Date && Time' |
|
2197 |
#translateLabel: true |
|
2198 |
#hideMenuOnActivated: false |
|
2199 |
#choice: #sortBlockProperty |
|
2200 |
#choiceValue: #modificationTime |
|
2201 |
) |
|
2202 |
#(#MenuItem |
|
2203 |
#label: '-' |
|
2204 |
) |
|
2205 |
#(#MenuItem |
|
2206 |
#label: 'Ignore Case in Sort' |
|
2207 |
#translateLabel: true |
|
2208 |
#hideMenuOnActivated: false |
|
2209 |
#indication: #sortCaseless |
|
2210 |
) |
|
2211 |
#(#MenuItem |
|
2212 |
#label: 'Directories before Files' |
|
2213 |
#translateLabel: true |
|
2214 |
#hideMenuOnActivated: false |
|
2215 |
#indication: #sortDirectoriesBeforeFiles |
|
2216 |
) |
|
2217 |
) |
|
2218 |
nil |
|
2219 |
nil |
|
3906 | 2220 |
) |
4018 | 2221 |
! |
2222 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2223 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2224 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2225 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2226 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2227 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2228 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2229 |
|
11286 | 2230 |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2231 |
" |
4367 | 2232 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
2233 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2234 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2235 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2236 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2237 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2238 |
^ |
5830 | 2239 |
#(Menu |
2240 |
( |
|
2241 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2242 |
label: 'Open (Win32-Shell)' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2243 |
itemValue: doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2244 |
isVisible: systemIsDOS |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2245 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2246 |
(MenuItem |
6528 | 2247 |
label: 'Execute UNIX Command...' |
5830 | 2248 |
itemValue: doExecuteCommand |
6528 | 2249 |
isVisible: systemIsUnix |
2250 |
) |
|
2251 |
(MenuItem |
|
2252 |
label: 'Execute DOS Command...' |
|
2253 |
itemValue: doExecuteCommand |
|
2254 |
isVisible: systemIsDOS |
|
4230 | 2255 |
) |
5830 | 2256 |
(MenuItem |
5880 | 2257 |
label: 'Execute Script...' |
2258 |
itemValue: doExecuteScript |
|
2259 |
) |
|
2260 |
(MenuItem |
|
5830 | 2261 |
enabled: canDoTerminal |
2262 |
label: 'Shell Terminal' |
|
2263 |
itemValue: openTerminal |
|
2264 |
isVisible: canDoTerminalAndSystemIsUnix |
|
11286 | 2265 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal') |
4230 | 2266 |
) |
5830 | 2267 |
(MenuItem |
2268 |
enabled: canDoTerminal |
|
2269 |
label: 'DOS Terminal' |
|
2270 |
itemValue: openTerminal |
|
2271 |
isVisible: canDoTerminalAndSystemIsDOS |
|
11286 | 2272 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal') |
4230 | 2273 |
) |
5830 | 2274 |
(MenuItem |
2275 |
label: '-' |
|
4230 | 2276 |
) |
5830 | 2277 |
(MenuItem |
2278 |
enabled: hasFileSelection |
|
2279 |
label: 'Changes Browser' |
|
2280 |
itemValue: openChangesBrowser |
|
4230 | 2281 |
) |
5830 | 2282 |
(MenuItem |
2283 |
enabled: hasFileSelection |
|
2284 |
label: 'ChangeSet Browser' |
|
2285 |
itemValue: openChangeSetBrowser |
|
6602 | 2286 |
isVisible: changeSetBrowserItemVisible |
4230 | 2287 |
) |
5830 | 2288 |
(MenuItem |
6022 | 2289 |
enabled: hasFileSelection |
2290 |
label: 'Workspace' |
|
2291 |
itemValue: openWorkspace |
|
2292 |
) |
|
2293 |
(MenuItem |
|
2294 |
label: '-' |
|
2295 |
) |
|
2296 |
(MenuItem |
|
5830 | 2297 |
enabled: canReadAbbrevFile |
2298 |
label: 'Install Autoloaded' |
|
2299 |
itemValue: readAbbrevFile |
|
4230 | 2300 |
) |
5830 | 2301 |
(MenuItem |
2302 |
enabled: anySTFilesPresent |
|
6521 | 2303 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 2304 |
itemValue: installAllAsAutoloaded |
4230 | 2305 |
) |
5830 | 2306 |
(MenuItem |
6586 | 2307 |
enabled: recursiveAnySTFilesPresent |
6521 | 2308 |
label: 'Recursive Install All ST-Files as Autoloaded' |
2309 |
itemValue: installAllAsAutoloadedRecursive |
|
2310 |
) |
|
2311 |
(MenuItem |
|
14298 | 2312 |
label: '-' |
2313 |
) |
|
2314 |
(MenuItem |
|
2315 |
enabled: hasJava |
|
14262 | 2316 |
label: 'Add Directory to Java Source Path (stx:libjava)' |
2317 |
itemValue: addDirToJavaSourcePath |
|
2318 |
) |
|
2319 |
(MenuItem |
|
14298 | 2320 |
enabled: hasJava |
14262 | 2321 |
label: 'Add Selected Files to Java Source Path (stx:libjava)' |
2322 |
itemValue: fileAddToJavaSourcePath |
|
2323 |
) |
|
2324 |
(MenuItem |
|
5830 | 2325 |
label: '-' |
4230 | 2326 |
) |
5830 | 2327 |
(MenuItem |
6593 | 2328 |
label: 'File Operations' |
2329 |
submenuChannel: fileOpMenu |
|
2330 |
) |
|
2331 |
(MenuItem |
|
5830 | 2332 |
label: 'File Utilities' |
2333 |
submenu: |
|
2334 |
(Menu |
|
2335 |
( |
|
2336 |
(MenuItem |
|
2337 |
enabled: hasFileSelection |
|
2338 |
label: 'Editor' |
|
2339 |
itemValue: openEditor |
|
4820 | 2340 |
) |
5830 | 2341 |
(MenuItem |
2342 |
enabled: hasFileSelection |
|
2343 |
label: 'HTML Reader' |
|
2344 |
itemValue: openHTMLReader |
|
4820 | 2345 |
) |
5830 | 2346 |
(MenuItem |
8832 | 2347 |
enabled: hasFileSelection |
2348 |
label: 'Web Browser' |
|
2349 |
itemValue: openWebBrowser |
|
2350 |
) |
|
2351 |
(MenuItem |
|
7869 | 2352 |
label: 'XML Inspector' |
9784 | 2353 |
itemValue: inspectXmlFile |
7869 | 2354 |
isVisible: hasXml |
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2355 |
showBusyCursorWhilePerforming: true |
7869 | 2356 |
) |
2357 |
(MenuItem |
|
5830 | 2358 |
enabled: hasFileSelection |
2359 |
label: 'Acroread (PDF Viewer)' |
|
2360 |
itemValue: openPDFViewer |
|
4820 | 2361 |
) |
5830 | 2362 |
(MenuItem |
2363 |
enabled: hasASN1AndSelection |
|
2364 |
label: 'ASN1 Browser' |
|
2365 |
itemValue: openASN1Browser |
|
2366 |
isVisible: hasASN1 |
|
4820 | 2367 |
) |
5830 | 2368 |
(MenuItem |
2369 |
enabled: hasCBrowser |
|
2370 |
label: 'C Browser' |
|
2371 |
itemValue: openCBrowser |
|
2372 |
isVisible: hasCBrowser |
|
4820 | 2373 |
) |
14262 | 2374 |
(MenuItem |
12871 | 2375 |
enabled: canOpenMonticelloBrowser |
12811 | 2376 |
label: 'Monticello Browser' |
2377 |
itemValue: doOpenMonticelloBrowser |
|
2378 |
) |
|
2379 |
(MenuItem |
|
5830 | 2380 |
enabled: hasJavaAndSelection |
2381 |
label: 'Applet Viewer' |
|
2382 |
itemValue: openAppletViewer |
|
2383 |
isVisible: hasJava |
|
4820 | 2384 |
) |
5830 | 2385 |
(MenuItem |
2386 |
enabled: hasMP3PlayerAndSelection |
|
2387 |
label: 'MP3 Player' |
|
2388 |
itemValue: openMP3Player |
|
2389 |
isVisible: hasMP3Player |
|
4820 | 2390 |
) |
5830 | 2391 |
(MenuItem |
2392 |
enabled: hasFileSelection |
|
2393 |
label: 'xv (Image Viewer)' |
|
2394 |
itemValue: openXV |
|
6460 | 2395 |
isVisible: systemIsUnix |
4950 | 2396 |
) |
5830 | 2397 |
(MenuItem |
2398 |
enabled: currentFilesAreInSameDirectory |
|
2399 |
label: 'Slide Show' |
|
2400 |
itemValue: openSlideShow |
|
2401 |
isVisible: hasSlideShow |
|
4820 | 2402 |
) |
5830 | 2403 |
(MenuItem |
2404 |
enabled: hasFileSelection |
|
2405 |
label: 'gv (Postscript Viewer)' |
|
2406 |
itemValue: openGV |
|
6460 | 2407 |
isVisible: systemIsUnix |
2408 |
) |
|
2409 |
(MenuItem |
|
2410 |
enabled: hasMP3PlayerAndSelection |
|
2411 |
label: 'MP3 Player' |
|
2412 |
itemValue: openMP3Player |
|
2413 |
isVisible: hasMP3Player |
|
4957 | 2414 |
) |
5830 | 2415 |
(MenuItem |
2416 |
enabled: hasFileSelection |
|
9509 | 2417 |
label: 'Realplay (avi viewer)' |
5830 | 2418 |
itemValue: openRP |
6460 | 2419 |
isVisible: systemIsUnix |
2420 |
) |
|
2421 |
(MenuItem |
|
2422 |
label: '-' |
|
2423 |
) |
|
2424 |
(MenuItem |
|
2425 |
label: 'Smalltalk' |
|
2426 |
submenu: |
|
2427 |
(Menu |
|
2428 |
( |
|
2429 |
(MenuItem |
|
2430 |
enabled: hasSnapshotSelection |
|
2431 |
label: 'Snapshot Image Browser' |
|
2432 |
itemValue: openSnapshotImageBrowser |
|
2433 |
) |
|
2434 |
(MenuItem |
|
2435 |
enabled: canCreateNewProject |
|
2436 |
label: 'Create Smalltalk Project' |
|
2437 |
itemValue: createProjectAndOpenProjectBrowser |
|
2438 |
) |
|
2439 |
(MenuItem |
|
2440 |
label: '-' |
|
2441 |
) |
|
2442 |
(MenuItem |
|
8426 | 2443 |
enabled: hasResourceFileSelected |
6460 | 2444 |
label: 'Show Contents of Resourcefile' |
2445 |
itemValue: readAndShowResources |
|
2446 |
) |
|
8426 | 2447 |
(MenuItem |
2448 |
enabled: hasResourceFileSelected |
|
2449 |
label: 'Resource File Editor' |
|
2450 |
itemValue: openResourceFileEditor |
|
2451 |
showBusyCursorWhilePerforming: true |
|
2452 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2453 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2454 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2455 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2456 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2457 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2458 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2459 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2460 |
) |
6460 | 2461 |
) |
2462 |
nil |
|
2463 |
nil |
|
2464 |
) |
|
2465 |
) |
|
2466 |
(MenuItem |
|
2467 |
label: 'Image' |
|
2468 |
submenu: |
|
2469 |
(Menu |
|
2470 |
( |
|
2471 |
(MenuItem |
|
2472 |
enabled: hasFileSelection |
|
2473 |
label: 'Image Editor' |
|
2474 |
itemValue: openImageEditor |
|
2475 |
) |
|
2476 |
(MenuItem |
|
2477 |
enabled: hasFileSelection |
|
2478 |
label: 'Image Preview' |
|
2479 |
itemValue: openImagePreview |
|
2480 |
) |
|
2481 |
(MenuItem |
|
2482 |
enabled: hasFileSelection |
|
2483 |
label: 'Image Inspector' |
|
2484 |
itemValue: openImageInspector |
|
2485 |
) |
|
2486 |
(MenuItem |
|
2487 |
label: '-' |
|
2488 |
) |
|
2489 |
(MenuItem |
|
2490 |
enabled: hasFileSelection |
|
2491 |
label: 'Convert to GIF' |
|
2492 |
itemValue: convertImageToGIF |
|
2493 |
) |
|
2494 |
(MenuItem |
|
2495 |
enabled: hasFileSelection |
|
2496 |
label: 'Convert to PNG' |
|
2497 |
itemValue: convertImageToPNG |
|
2498 |
) |
|
2499 |
(MenuItem |
|
2500 |
enabled: hasFileSelection |
|
2501 |
label: 'Convert to XPM' |
|
2502 |
itemValue: convertImageToXPM |
|
2503 |
) |
|
2504 |
(MenuItem |
|
2505 |
enabled: hasFileSelection |
|
2506 |
label: 'Convert to JPG' |
|
2507 |
itemValue: convertImageToJPG |
|
2508 |
) |
|
2509 |
) |
|
2510 |
nil |
|
2511 |
nil |
|
2512 |
) |
|
2513 |
) |
|
2514 |
(MenuItem |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
2515 |
enabled: hasZipFileSelectedHolder |
6460 | 2516 |
label: 'ZipFile Tool' |
2517 |
itemValue: openZipTool |
|
2518 |
) |
|
2519 |
(MenuItem |
|
2520 |
enabled: hasFileSelection |
|
2521 |
label: 'Hex Dump' |
|
2522 |
itemValue: fileHexDump |
|
4958 | 2523 |
) |
4820 | 2524 |
) |
2525 |
nil |
|
2526 |
nil |
|
2527 |
) |
|
4230 | 2528 |
) |
5830 | 2529 |
(MenuItem |
2530 |
label: 'Find' |
|
2531 |
submenu: |
|
2532 |
(Menu |
|
2533 |
( |
|
2534 |
(MenuItem |
|
2535 |
label: 'File...' |
|
2536 |
itemValue: fileFindFile |
|
4367 | 2537 |
) |
5830 | 2538 |
(MenuItem |
14262 | 2539 |
enabled: hasFileSelection |
10306 | 2540 |
label: 'Same Contents as Selected...' |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2541 |
itemValue: fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2542 |
) |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2543 |
(MenuItem |
5830 | 2544 |
label: 'Duplicate Files' |
2545 |
itemValue: fileFindDuplicates |
|
5082 | 2546 |
) |
5830 | 2547 |
(MenuItem |
2548 |
enabled: hasSelection |
|
2549 |
label: 'All Duplicate Files (Recursive)' |
|
2550 |
itemValue: fileFindAllDuplicates |
|
4367 | 2551 |
) |
8510 | 2552 |
(MenuItem |
2553 |
label: 'Similar Image Files' |
|
2554 |
itemValue: fileFindSimilarImages |
|
2555 |
isVisible: hasImageColorHistogram |
|
2556 |
) |
|
4367 | 2557 |
) |
2558 |
nil |
|
2559 |
nil |
|
2560 |
) |
|
4230 | 2561 |
) |
2562 |
) |
|
2563 |
nil |
|
2564 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2565 |
) |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2566 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2567 |
|
4018 | 2568 |
viewDetailsMenuSpec |
2569 |
"This resource specification was automatically generated |
|
2570 |
by the MenuEditor of ST/X." |
|
2571 |
||
2572 |
"Do not manually edit this!! If it is corrupted, |
|
2573 |
the MenuEditor may not be able to read the specification." |
|
2574 |
||
2575 |
" |
|
4648 | 2576 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2577 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2578 |
" |
2579 |
||
2580 |
<resource: #menu> |
|
2581 |
||
2582 |
^ |
|
2583 |
#(#Menu |
|
4414 | 2584 |
#( |
2585 |
#(#MenuItem |
|
2586 |
#label: '-' |
|
2587 |
) |
|
2588 |
#(#MenuItem |
|
2589 |
#label: 'Hidden Files' |
|
2590 |
#translateLabel: true |
|
2591 |
#indication: #showHiddenFiles |
|
2592 |
) |
|
2593 |
) |
|
2594 |
nil |
|
2595 |
nil |
|
4018 | 2596 |
) |
3892 | 2597 |
! ! |
2598 |
||
11144 | 2599 |
!AbstractFileBrowser class methodsFor:'menu specs-scm'! |
2600 |
||
2601 |
cvsMenu |
|
2602 |
"This resource specification was automatically generated |
|
2603 |
by the MenuEditor of ST/X." |
|
2604 |
||
2605 |
"Do not manually edit this!! If it is corrupted, |
|
2606 |
the MenuEditor may not be able to read the specification." |
|
2607 |
||
11149 | 2608 |
|
11144 | 2609 |
" |
2610 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
2611 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
2612 |
" |
|
2613 |
||
2614 |
<resource: #menu> |
|
2615 |
||
2616 |
^ |
|
11149 | 2617 |
#(Menu |
2618 |
( |
|
2619 |
(MenuItem |
|
2620 |
label: 'Commit (CVS)...' |
|
2621 |
itemValue: cvsCommit |
|
2622 |
translateLabel: true |
|
2623 |
) |
|
2624 |
(MenuItem |
|
2625 |
enabled: canCvsAddAndCommit |
|
2626 |
label: 'Add && Commit...' |
|
2627 |
itemValue: cvsAddAndCommit |
|
2628 |
translateLabel: true |
|
2629 |
) |
|
2630 |
(MenuItem |
|
2631 |
enabled: canCvsAddAndCommit |
|
2632 |
label: 'Add as Binary && Commit...' |
|
2633 |
itemValue: cvsAddBinaryAndCommit |
|
2634 |
translateLabel: true |
|
2635 |
) |
|
2636 |
(MenuItem |
|
14530 | 2637 |
label: 'Commit Folder (CVS)...' |
2638 |
itemValue: cvsCommitFolder |
|
2639 |
translateLabel: true |
|
2640 |
) |
|
2641 |
(MenuItem |
|
11149 | 2642 |
label: '-' |
2643 |
) |
|
2644 |
(MenuItem |
|
2645 |
enabled: hasSelection |
|
2646 |
label: 'Update selected Files/Directories' |
|
2647 |
itemValue: cvsUpdateSelection |
|
2648 |
translateLabel: true |
|
2649 |
) |
|
2650 |
(MenuItem |
|
2651 |
label: 'Update Directory Local' |
|
2652 |
itemValue: cvsUpdateAll |
|
2653 |
translateLabel: true |
|
2654 |
) |
|
2655 |
(MenuItem |
|
2656 |
label: 'Update Directory Recursive' |
|
2657 |
itemValue: cvsUpdateAllRecursive |
|
2658 |
translateLabel: true |
|
2659 |
) |
|
2660 |
(MenuItem |
|
2661 |
label: '-' |
|
2662 |
) |
|
2663 |
(MenuItem |
|
2664 |
enabled: hasSelection |
|
2665 |
label: 'Tag...' |
|
2666 |
itemValue: cvsTagSelection |
|
2667 |
translateLabel: true |
|
2668 |
) |
|
2669 |
(MenuItem |
|
2670 |
enabled: hasSelection |
|
2671 |
label: 'Revision Log' |
|
2672 |
itemValue: cvsRevisionLog |
|
2673 |
translateLabel: true |
|
2674 |
) |
|
2675 |
(MenuItem |
|
2676 |
enabled: hasSelection |
|
2677 |
label: 'Compare with newest in Repository' |
|
2678 |
itemValue: cvsCompareWithNewest |
|
2679 |
translateLabel: true |
|
2680 |
) |
|
2681 |
(MenuItem |
|
2682 |
label: '-' |
|
2683 |
) |
|
2684 |
(MenuItem |
|
2685 |
enabled: canRemoveCVSContainer |
|
2686 |
label: 'Remove File && CVS Container...' |
|
2687 |
itemValue: cvsRemoveFileAndCVSContainer |
|
2688 |
translateLabel: true |
|
11144 | 2689 |
) |
2690 |
) |
|
2691 |
nil |
|
2692 |
nil |
|
2693 |
) |
|
2694 |
! |
|
2695 |
||
2696 |
mercurialMenu |
|
2697 |
"This resource specification was automatically generated |
|
2698 |
by the MenuEditor of ST/X." |
|
2699 |
||
2700 |
"Do not manually edit this!! If it is corrupted, |
|
2701 |
the MenuEditor may not be able to read the specification." |
|
2702 |
||
2703 |
||
2704 |
" |
|
2705 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu |
|
2706 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp |
|
2707 |
" |
|
2708 |
||
2709 |
<resource: #menu> |
|
2710 |
||
2711 |
^ |
|
2712 |
#(Menu |
|
2713 |
( |
|
2714 |
(MenuItem |
|
2715 |
label: 'Add' |
|
2716 |
itemValue: mercurialAdd |
|
2717 |
translateLabel: true |
|
2718 |
) |
|
2719 |
(MenuItem |
|
2720 |
label: 'Commit Changes' |
|
2721 |
itemValue: mercurialCommit |
|
2722 |
translateLabel: true |
|
2723 |
) |
|
2724 |
(MenuItem |
|
2725 |
label: 'Push...' |
|
2726 |
itemValue: mercurialPush |
|
2727 |
translateLabel: true |
|
2728 |
) |
|
2729 |
(MenuItem |
|
2730 |
label: 'Status' |
|
2731 |
itemValue: mercurialStatus |
|
2732 |
translateLabel: true |
|
2733 |
) |
|
2734 |
(MenuItem |
|
2735 |
label: '-' |
|
2736 |
) |
|
2737 |
(MenuItem |
|
2738 |
label: 'Init' |
|
2739 |
itemValue: mercurialInit |
|
2740 |
translateLabel: true |
|
2741 |
) |
|
2742 |
) |
|
2743 |
nil |
|
2744 |
nil |
|
2745 |
) |
|
2746 |
||
2747 |
"Modified: / 17-01-2012 / 15:57:40 / cg" |
|
2748 |
! |
|
2749 |
||
2750 |
perforceMenu |
|
2751 |
"This resource specification was automatically generated |
|
2752 |
by the MenuEditor of ST/X." |
|
2753 |
||
2754 |
"Do not manually edit this!! If it is corrupted, |
|
2755 |
the MenuEditor may not be able to read the specification." |
|
2756 |
||
2757 |
||
2758 |
" |
|
2759 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu |
|
2760 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp |
|
2761 |
" |
|
2762 |
||
2763 |
<resource: #menu> |
|
2764 |
||
2765 |
^ |
|
2766 |
#(Menu |
|
2767 |
( |
|
2768 |
(MenuItem |
|
2769 |
label: 'Commit' |
|
2770 |
itemValue: perforceCommit |
|
2771 |
translateLabel: true |
|
2772 |
) |
|
2773 |
) |
|
2774 |
nil |
|
2775 |
nil |
|
2776 |
) |
|
2777 |
||
2778 |
"Created: / 15-01-2012 / 13:12:30 / cg" |
|
2779 |
! ! |
|
2780 |
||
3892 | 2781 |
!AbstractFileBrowser class methodsFor:'misc'! |
2782 |
||
2783 |
newLock |
|
2784 |
^ CodeExecutionLock new |
|
2785 |
! ! |
|
2786 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2787 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2788 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2789 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2790 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2791 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2792 |
|
4610 | 2793 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2794 |
||
11262 | 2795 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart |
2796 |
"utility helper: generate a hexDump with addresses" |
|
2797 |
||
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2798 |
|lines nHexLines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2799 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2800 |
"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
|
2801 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2802 |
nHexLines := (data size + 15) // 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2803 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2804 |
lines := VirtualArray new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2805 |
lines setSize:nHexLines + (nHexLines // 16). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2806 |
lines |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2807 |
generator:[:lineNr | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2808 |
|blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2809 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2810 |
blockNr := (lineNr - 1) // 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2811 |
lineNrInBlock := (lineNr - 1) \\ 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2812 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2813 |
lineNrInBlock == 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2814 |
line := '' |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2815 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2816 |
startOffset := ((blockNr * 16) + lineNrInBlock) * 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2817 |
lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2818 |
asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2819 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2820 |
lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2821 |
lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2822 |
1 to:16 do:[:i | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2823 |
i ~~ 1 ifTrue:[ lineStream space ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2824 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2825 |
(startOffset + i) > data size ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2826 |
asciiLineStream nextPut:(Character space). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2827 |
lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2828 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2829 |
byte := data at:startOffset + i. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2830 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2831 |
lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2832 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2833 |
(byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2834 |
asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2835 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2836 |
asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2837 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2838 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2839 |
]. |
12421 | 2840 |
line := (lineStream contents paddedTo:(addrDigits + 1 + (3*16)+ 8)) |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2841 |
, asciiLineStream contents. |
11262 | 2842 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2843 |
line |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2844 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2845 |
^ lines. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2846 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2847 |
"/ |offs |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2848 |
"/ col line lineStream asciiLineStream lines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2849 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2850 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2851 |
"/ offs := virtualStart. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2852 |
"/ lines := StringCollection new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2853 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2854 |
"/ lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2855 |
"/ asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2856 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2857 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2858 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2859 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2860 |
"/ data do:[:byte | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2861 |
"/ lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2862 |
"/ (byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2863 |
"/ asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2864 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2865 |
"/ asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2866 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2867 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2868 |
"/ offs := offs + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2869 |
"/ col := col + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2870 |
"/ col > 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2871 |
"/ lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2872 |
"/ lineStream nextPutAll:asciiLineStream contents. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2873 |
"/ lines add:(lineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2874 |
"/ (offs bitAnd:16rFF) == 0 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2875 |
"/ lines add:nil |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2876 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2877 |
"/ lineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2878 |
"/ asciiLineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2879 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2880 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2881 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2882 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2883 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2884 |
"/ lineStream space |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2885 |
"/ ] |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2886 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2887 |
"/ line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2888 |
"/ lines add:(line , ' ' , asciiLineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2889 |
"/ ^ lines |
11262 | 2890 |
|
2891 |
"Created: / 13-02-2012 / 15:01:46 / cg" |
|
2892 |
! |
|
2893 |
||
4610 | 2894 |
contentsOfFileAsHexDump:f |
8472 | 2895 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2896 |
! |
|
2897 |
||
2898 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2899 |
|resources fileName stream data offs |
11262 | 2900 |
addrDigits col lines answer sizeLimit showLastPart| |
4610 | 2901 |
|
2902 |
resources := self classResources. |
|
2903 |
||
2904 |
fileName := f baseName. |
|
2905 |
f isDirectory ifTrue:[ |
|
2906 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2907 |
^ nil |
|
2908 |
]. |
|
2909 |
f exists ifFalse:[ |
|
2910 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2911 |
^ nil |
|
2912 |
]. |
|
2913 |
f isReadable ifFalse:[ |
|
2914 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2915 |
^ nil |
|
2916 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2917 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2918 |
limitOrNil notNil ifTrue:[ |
2919 |
sizeLimit := limitOrNil. |
|
2920 |
showLastPart := showLastPartOrNil |
|
2921 |
] ifFalse:[ |
|
2922 |
answer := Dialog |
|
2923 |
confirmWithCancel:(resources |
|
2924 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2925 |
with:(fileName contractTo:40) allBold |
|
2926 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2927 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2928 |
||
2929 |
answer isNil ifTrue:[^ nil]. |
|
2930 |
answer ifTrue:[ |
|
2931 |
sizeLimit := 4 * 1024 * 1024 |
|
2932 |
]. |
|
8436 | 2933 |
]. |
4610 | 2934 |
]. |
2935 |
||
2936 |
stream := f readStream binary. |
|
8436 | 2937 |
sizeLimit notNil ifTrue:[ |
8472 | 2938 |
showLastPart == true ifTrue:[ |
2939 |
stream position:(f fileSize - sizeLimit). |
|
2940 |
]. |
|
8436 | 2941 |
data := stream nextBytes:sizeLimit. |
2942 |
] ifFalse:[ |
|
2943 |
data := stream contents. |
|
2944 |
]. |
|
4610 | 2945 |
stream close. |
2946 |
||
2947 |
col := 1. |
|
2948 |
offs := 0. |
|
2949 |
lines := StringCollection new. |
|
2950 |
||
2951 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2952 |
||
11262 | 2953 |
^ self |
2954 |
contentsOfBytesAsHexDump:data |
|
2955 |
numberOfAddressDigits:addrDigits |
|
2956 |
addressStart:0 |
|
2957 |
||
2958 |
"Modified: / 13-02-2012 / 15:01:19 / cg" |
|
4610 | 2959 |
! ! |
2960 |
||
3892 | 2961 |
!AbstractFileBrowser methodsFor:'actions'! |
2962 |
||
2963 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2964 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2965 |
Then evaluate aBlock passing the command-string as argument." |
2966 |
||
4523 | 2967 |
|box osName commandString| |
3892 | 2968 |
|
2969 |
osName := OperatingSystem platformName. |
|
2970 |
||
2971 |
box := FilenameEnterBox |
|
4414 | 2972 |
title:(resources string:'Execute %1 command:' with:osName) |
2973 |
okText:(resources string:'Execute') |
|
4523 | 2974 |
action:[:cmd | commandString := cmd]. |
3892 | 2975 |
|
2976 |
fileName notNil ifTrue:[ |
|
4414 | 2977 |
self initialCommandFor:fileName into:box. |
3892 | 2978 |
]. |
2979 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2980 |
box show. |
3892 | 2981 |
box destroy. |
2982 |
||
4523 | 2983 |
commandString notNil ifTrue:[ |
2984 |
aBlock value:commandString |
|
2985 |
]. |
|
2986 |
||
3892 | 2987 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2988 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2989 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2990 |
! |
|
2991 |
||
2992 |
changeFileBrowserTitleTo:aString |
|
4774 | 2993 |
self |
2994 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2995 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2996 |
! |
2997 |
||
2998 |
copyFileList |
|
4774 | 2999 |
"copy the fileList to the clipBoard" |
3000 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3001 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3002 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3003 |
fileList := self |
4774 | 3004 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 3005 |
ifPresentDo:[:app | app browserFileList]. |
3006 |
||
3007 |
fileList notNil ifTrue:[ |
|
3008 |
self copyFileListToClipBoard:fileList. |
|
3009 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3010 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3011 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3012 |
copyFileListToClipBoard:fileList |
4774 | 3013 |
"copy the itemList to the clipBoard" |
3014 |
||
3015 |
|stream| |
|
3016 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3017 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 3018 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3019 |
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
|
3020 |
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
|
3021 |
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
|
3022 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3023 |
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
|
3024 |
(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
|
3025 |
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
|
3026 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
3027 |
]. |
3892 | 3028 |
]. |
6034 | 3029 |
self window setClipboardText:stream contents. |
3892 | 3030 |
! |
3031 |
||
3032 |
copySelectedFilenames |
|
4774 | 3033 |
"copy the selected fileNames to the clipBoard" |
3034 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3035 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3036 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
3037 |
fileList := self |
4774 | 3038 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 3039 |
ifPresentDo:[:appl | appl selectedFileNames]. |
3040 |
fileList notNil ifTrue:[ |
|
3041 |
self copyFileListToClipBoard:fileList. |
|
3042 |
]. |
|
3892 | 3043 |
! |
3044 |
||
10923 | 3045 |
doAddArchiver |
3046 |
|files| |
|
3047 |
||
3048 |
files := self currentSelectedFiles. |
|
3049 |
files size == 1 ifFalse:[ |
|
3050 |
Dialog information:'Select exactly one archive.'. |
|
3051 |
^ self |
|
3052 |
]. |
|
3053 |
||
3054 |
self |
|
3055 |
applicationNamed:#FileApplicationNoteBook |
|
3056 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
3057 |
||
3058 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
3059 |
! |
|
3060 |
||
3892 | 3061 |
doAddTerminal |
5960 | 3062 |
|dir| |
3063 |
||
3064 |
dir := self currentDirectory. |
|
3892 | 3065 |
|
5960 | 3066 |
dir isNil ifTrue:[ |
4414 | 3067 |
dir := Filename homeDirectory |
3892 | 3068 |
]. |
4774 | 3069 |
|
5009 | 3070 |
self |
3071 |
applicationNamed:#FileApplicationNoteBook |
|
3072 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 3073 |
! |
3074 |
||
3075 |
doOpenSearchFile |
|
5961 | 3076 |
|item file| |
3077 |
||
3078 |
file := self firstSelectedFileName. |
|
3079 |
file isNil ifTrue:[ |
|
3080 |
file := Filename homeDirectory asAbsoluteFilename. |
|
3081 |
]. |
|
3082 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 3083 |
self openSearchFileOn:item. |
3084 |
! |
|
3085 |
||
3086 |
doShowFileContents |
|
5009 | 3087 |
self |
3088 |
applicationNamed:#DirectoryContentsBrowser |
|
3089 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
3090 |
||
3091 |
^ nil |
|
3892 | 3092 |
! |
3093 |
||
3094 |
doShowProperties |
|
3095 |
"show long stat (file)-info" |
|
3096 |
||
3097 |
self fileGetInfo:true |
|
3098 |
! |
|
3099 |
||
14577 | 3100 |
enterAction |
3101 |
self |
|
3102 |
applicationNamed:#DirectoryContentsBrowser |
|
3103 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl enterAction ]]. |
|
3104 |
! |
|
3105 |
||
5528 | 3106 |
fileEncodingDialog |
14497 | 3107 |
"open a dialog to allow change of the file's character encoding. |
5528 | 3108 |
Files are converted to internal encoding when read, and converted back |
3109 |
to this encoding when saved. |
|
3110 |
Notice: currently, not too many encodings are supported by the system." |
|
3111 |
||
3112 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
3113 |
||
3114 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
3115 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
3116 |
||
3117 |
bindings := IdentityDictionary new. |
|
3118 |
bindings at:#encodingList put:encodingDescr. |
|
3119 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 3120 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
3121 |
||
5528 | 3122 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
3123 |
ifTrue:[ |
|
3124 |
idx := (bindings at:#selectedEncoding) value. |
|
3125 |
selectedEncoding := encodings at:idx. |
|
3126 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 3127 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 3128 |
]. |
5737 | 3129 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 3130 |
]. |
3131 |
||
3132 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
3133 |
! |
|
3134 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3135 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3136 |
"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
|
3137 |
|
5959 | 3138 |
|currentFileNameHolder currentSel| |
3139 |
||
3140 |
currentFileNameHolder := self currentFileNameHolder. |
|
3141 |
||
3142 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3143 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 3144 |
self withWaitCursorDo:[ |
3145 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
3146 |
] |
|
3147 |
]. |
|
3148 |
||
3149 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 3150 |
! |
3151 |
||
11053 | 3152 |
lineEndConventionDialog |
3153 |
"open a dialog to allow change of the line end conventions |
|
3154 |
(when writing files)" |
|
3155 |
||
3156 |
|bindings| |
|
3157 |
||
3158 |
bindings := IdentityDictionary new. |
|
3159 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
3160 |
||
3161 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
3162 |
ifTrue:[ |
|
3163 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value |
|
3164 |
]. |
|
3165 |
||
3166 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
3167 |
! |
|
3168 |
||
4392 | 3169 |
newTextEditor |
5009 | 3170 |
self |
3171 |
applicationNamed:#FileApplicationNoteBook |
|
3172 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
3173 |
||
3174 |
^ nil. |
|
3175 |
! |
|
3176 |
||
3177 |
openApplByFileItem:anItem |
|
8490 | 3178 |
"/ q: is the following always wanted ? |
9267 | 3179 |
self window sensor shiftDown ifFalse:[ |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3180 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3181 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3182 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3183 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3184 |
"/ ]. |
9267 | 3185 |
|
8490 | 3186 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
3187 |
"/ Error handle:[:ex | |
|
3188 |
"/ ] do:[ |
|
3189 |
"/ OperatingSystem |
|
3190 |
"/ shellExecute:nil |
|
3191 |
"/ lpOperation:'open' |
|
3192 |
"/ lpFile:(anItem fileName pathName) |
|
3193 |
"/ lpParameters:nil |
|
3194 |
"/ lpDirectory:(self directory pathName) |
|
3195 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
3196 |
"/ ^ self. |
|
3197 |
"/ ] |
|
3198 |
"/ ] |
|
9267 | 3199 |
]. |
5306 | 3200 |
^ self |
5009 | 3201 |
applicationNamed:#FileApplicationNoteBook |
5306 | 3202 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3203 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3204 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
3892 | 3205 |
! |
3206 |
||
4392 | 3207 |
openApplForFile:aFilename |
5306 | 3208 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 3209 |
! |
3210 |
||
3892 | 3211 |
openCommandResultApplication |
3212 |
||
5009 | 3213 |
self |
3214 |
applicationNamed:#FileApplicationNoteBook |
|
3215 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
3216 |
||
3217 |
^ nil |
|
3892 | 3218 |
! |
3219 |
||
5010 | 3220 |
openNewTextEditorOn:anItem |
5009 | 3221 |
self |
3222 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3223 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3224 |
|
3225 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3226 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3227 |
|
5010 | 3228 |
openSearchFileOn:anItem |
5009 | 3229 |
self |
3230 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3231 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3232 |
|
3233 |
^ nil. |
|
3892 | 3234 |
! |
3235 |
||
5162 | 3236 |
openTextEditorForFile:aFilename |
3237 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3238 |
! |
|
3239 |
||
5010 | 3240 |
openTextEditorOn:anItem |
5009 | 3241 |
self |
3242 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3243 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3244 |
|
3245 |
^ nil. |
|
3892 | 3246 |
! |
3247 |
||
5010 | 3248 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3249 |
self |
3250 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3251 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3252 |
|
3253 |
^ nil. |
|
4618 | 3254 |
! |
3255 |
||
5959 | 3256 |
setCurrentFileName:aFilename |
3257 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3258 |
! |
|
3259 |
||
3260 |
setCurrentFileNames:aCollectionOfFilenames |
|
3261 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3262 |
! |
|
3263 |
||
11053 | 3264 |
tabStopConversionDialog |
3265 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3266 |
||
3267 |
|bindings| |
|
3268 |
||
3269 |
bindings := IdentityDictionary new. |
|
3270 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3271 |
||
3272 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3273 |
ifTrue:[ |
|
3274 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3275 |
]. |
|
3276 |
||
3277 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3278 |
! |
|
3279 |
||
3892 | 3280 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3281 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3282 |
aColOfFiles notNil ifTrue:[ |
5959 | 3283 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3284 |
]. |
3892 | 3285 |
! |
3286 |
||
3287 |
updateCurrentDirectory |
|
5739 | 3288 |
self updateCurrentDirectory:false |
3289 |
! |
|
3290 |
||
3291 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3292 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3293 |
|
5009 | 3294 |
self |
3295 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3296 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3297 |
self |
3298 |
applicationNamed:#DirectoryTreeBrowser |
|
3299 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3300 |
! |
3301 |
||
5739 | 3302 |
updateCurrentDirectoryWithReread |
3303 |
self updateCurrentDirectory:true |
|
3304 |
! |
|
3305 |
||
4345 | 3306 |
withActivityIndicationDo:aBlock |
3307 |
||
3308 |
self activityVisibilityChannel value:true. |
|
3309 |
[ |
|
9361 | 3310 |
self withWaitCursorDo:[ |
3311 |
aBlock value. |
|
3312 |
] |
|
4345 | 3313 |
] ensure:[ |
3314 |
self activityVisibilityChannel value:false. |
|
3315 |
] |
|
3892 | 3316 |
! ! |
3317 |
||
3318 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3319 |
||
3320 |
addBookmark |
|
3321 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3322 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3323 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3324 |
! |
3325 |
||
3326 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3327 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3328 |
self class addBookmark:path |
3892 | 3329 |
]. |
3330 |
! |
|
3331 |
||
8013 | 3332 |
editBookmarks |
3333 |
||
3334 |
| default selectedDirectories | |
|
3335 |
||
3336 |
selectedDirectories := self currentSelectedDirectories. |
|
3337 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
3338 |
self class editBookmarksWithDefault: default. |
|
3339 |
! |
|
3340 |
||
3892 | 3341 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3342 |
^ self class hasBookmarks |
3892 | 3343 |
! |
3344 |
||
3345 |
hasBookmarksToRemove |
|
3346 |
|bookmarks directories| |
|
3347 |
||
3982 | 3348 |
directories := self currentSelectedDirectories. |
3892 | 3349 |
bookmarks := self class directoryBookmarks. |
3350 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
3351 |
! |
|
3352 |
||
3353 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3354 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3355 |
self class removeBookmark:dir |
3892 | 3356 |
]. |
4679 | 3357 |
! |
3358 |
||
3359 |
saveBookmarks |
|
3360 |
self class saveBookmarks |
|
3892 | 3361 |
! ! |
3362 |
||
3363 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3364 |
||
3365 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3366 |
|cmd suffix cmdHist historySize| |
3892 | 3367 |
|
3368 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3369 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3370 |
cmdHist notNil ifTrue:[ |
3371 |
cmdHist addFirst:aCommandString. |
|
6369 | 3372 |
historySize := self class commandHistorySize. |
3373 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3374 |
cmdHist removeLast |
3375 |
] |
|
3376 |
]. |
|
3377 |
aFilename notNil ifTrue:[ |
|
3378 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3379 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3380 |
DefaultCommandPerSuffix := Dictionary new. |
|
3381 |
]. |
|
3382 |
suffix := aFilename asFilename suffix. |
|
3383 |
suffix notNil ifTrue:[ |
|
3384 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3385 |
] |
|
3386 |
] |
|
3892 | 3387 |
] |
3388 |
! |
|
3389 |
||
3390 |
doBack |
|
6286 | 3391 |
"go backward in the history" |
3892 | 3392 |
|
4022 | 3393 |
| fileName| |
3394 |
||
6369 | 3395 |
fileName := self directoryHistory goBackward. |
3892 | 3396 |
fileName notNil ifTrue:[ |
4347 | 3397 |
self gotoFile:(fileName asFilename). |
3892 | 3398 |
] |
3399 |
! |
|
3400 |
||
3401 |
doForward |
|
6286 | 3402 |
"go forward in the history" |
3892 | 3403 |
|
3964 | 3404 |
| fileName| |
3405 |
||
6369 | 3406 |
fileName := self directoryHistory goForward. |
3892 | 3407 |
fileName notNil ifTrue:[ |
4414 | 3408 |
self gotoFile:(fileName asFilename). |
4022 | 3409 |
] ifFalse:[ |
4414 | 3410 |
self enableForward value:false. |
4022 | 3411 |
|
3412 |
]. |
|
3892 | 3413 |
! ! |
3414 |
||
3415 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3416 |
||
5009 | 3417 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3418 |
|appl| |
|
3419 |
||
3420 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3421 |
appl notNil ifTrue:[ |
|
3422 |
^ aBlock value:appl |
|
3423 |
]. |
|
3424 |
^ nil. |
|
3425 |
! |
|
3426 |
||
4004 | 3427 |
directoryContentsBrowser |
3428 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3429 |
! ! |
3430 |
||
3431 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3432 |
||
3433 |
applications |
|
3434 |
^ aspects at:#applications |
|
3435 |
! |
|
3436 |
||
3437 |
backgroundProcesses |
|
3438 |
||
3439 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3440 |
! |
|
3441 |
||
4230 | 3442 |
canMake |
6095 | 3443 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 3444 |
! |
3445 |
||
3892 | 3446 |
currentDirectories |
6725 | 3447 |
" returns a holder on a Collection of all currently selected directories |
3448 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3449 |
" |
3450 |
||
3451 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3452 |
! |
|
3453 |
||
6725 | 3454 |
currentDirectoriesValue |
3455 |
" returns a Collection of all currently selected directories |
|
3456 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3457 |
" |
|
3458 |
||
3459 |
^ self currentDirectories value |
|
3460 |
! |
|
3461 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3462 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3463 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3464 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3465 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3466 |
|
6725 | 3467 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3468 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3469 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3470 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3471 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3472 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3473 |
|
13856 | 3474 |
currentDirectoryDisplayed |
3475 |
"Return a directory as Filename that is currently displayed in the browser" |
|
3476 |
||
3477 |
^self subclassResponsibility |
|
3478 |
||
3479 |
"Created: / 14-01-2013 / 11:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3480 |
! |
|
3481 |
||
3892 | 3482 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3483 |
"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
|
3484 |
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
|
3485 |
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
|
3486 |
|
6589 | 3487 |
^ self aspectFor:#currentFileNameHolder |
3488 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3489 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3490 |
|
4692 | 3491 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3492 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3493 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3494 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3495 |
currentSel asValue |
6589 | 3496 |
] |
3497 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3498 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3499 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3500 |
newFilenames := Set new. |
6589 | 3501 |
filenames do:[:eachFilename| |
3502 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3503 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3504 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3505 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3506 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3507 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3508 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3509 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3510 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3511 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3512 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3513 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3514 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3515 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3516 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3517 |
! |
3518 |
||
5528 | 3519 |
defaultFileEncoding |
3520 |
^ #'iso8859-1' "/ #'utf-8' |
|
3521 |
! |
|
3522 |
||
3892 | 3523 |
enableDirectoryUp |
3524 |
||
3525 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
3526 |
! |
|
3527 |
||
6456 | 3528 |
enableGotoDefaultDirectory |
3529 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 3530 |
! |
3531 |
||
8168 | 3532 |
enableGotoDesktop |
14308 | 3533 |
"/ backward compatibility |
3534 |
^ self enableGotoDesktopDirectory. |
|
8168 | 3535 |
! |
3536 |
||
9572 | 3537 |
enableGotoDesktopDirectory |
3538 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ true asValue ]. |
|
3539 |
||
3540 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3541 |
! |
|
3542 |
||
6434 | 3543 |
enableGotoSmalltalkDirectory |
6456 | 3544 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3545 |
! |
3546 |
||
9677 | 3547 |
enableGotoTempDirectory |
3548 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3549 |
||
3550 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3551 |
! |
|
3552 |
||
3892 | 3553 |
enableHome |
3554 |
||
3555 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3556 |
! |
|
3557 |
||
9596 | 3558 |
enableMakeCurrentDirectory |
3559 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3560 |
||
3561 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3562 |
! |
|
3563 |
||
3892 | 3564 |
enableViewNoteBookApplication |
3565 |
||
3566 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3567 |
! |
|
3568 |
||
5528 | 3569 |
fileEncoding |
3570 |
^ self fileEncodingHolder value |
|
3571 |
! |
|
3572 |
||
3573 |
fileEncoding:newEncoding |
|
5533 | 3574 |
self fileEncodingHolder value:newEncoding. |
3575 |
||
3576 |
self |
|
3577 |
applicationNamed:#FileApplicationNoteBook |
|
3578 |
ifPresentDo:[:nb | |
|
3579 |
|appl| |
|
3580 |
||
3581 |
appl := nb selectedApplication. |
|
5535 | 3582 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3583 |
appl fileEncoding:newEncoding |
3584 |
] |
|
3585 |
]. |
|
5528 | 3586 |
! |
3587 |
||
5737 | 3588 |
fileEncodingHolder |
3589 |
^ self |
|
3590 |
aspectFor:#fileEncodingHolder |
|
3591 |
ifAbsent:[ |
|
3592 |
self |
|
3593 |
applicationNamed:#FileApplicationNoteBook |
|
3594 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3595 |
] |
|
3596 |
! |
|
3597 |
||
5961 | 3598 |
firstSelectedFileName |
3599 |
|files| |
|
3600 |
||
7560 | 3601 |
files := self currentSelectedObjects. |
5961 | 3602 |
files notEmpty ifTrue:[ |
3603 |
^ files first |
|
3604 |
]. |
|
3605 |
^ nil |
|
7560 | 3606 |
|
3607 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3608 |
! |
3609 |
||
6456 | 3610 |
gotoDefaultDirectoryIsVisible |
9596 | 3611 |
^ true. |
3612 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3613 |
||
3614 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3615 |
! |
3616 |
||
9572 | 3617 |
gotoDesktopDirectoryIsVisible |
3618 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3619 |
||
3620 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3621 |
||
3622 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3623 |
! |
|
3624 |
||
4618 | 3625 |
hasFileSelection |
3626 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3627 |
! |
|
3628 |
||
9490 | 3629 |
hasNotTwoDirectoriesSelectedHolder |
3630 |
^ self |
|
3631 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3632 |
ifAbsent:[ |
|
3633 |
BlockValue |
|
3634 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3635 |
argument:self currentFileNameHolder |
|
3636 |
]. |
|
3637 |
||
3638 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
3639 |
! |
|
3640 |
||
5830 | 3641 |
hasNotTwoFilesSelectedHolder |
9490 | 3642 |
^ self |
3643 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 3644 |
ifAbsent:[ |
3645 |
BlockValue |
|
3646 |
with:[:m | self hasTwoFilesSelected not] |
|
3647 |
argument:self currentFileNameHolder |
|
3648 |
]. |
|
9490 | 3649 |
|
3650 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 3651 |
! |
3652 |
||
3892 | 3653 |
hasSelection |
3654 |
||
3655 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
3656 |
! |
|
3657 |
||
9490 | 3658 |
hasTwoDirectoriesSelectedHolder |
3659 |
^ self |
|
3660 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
3661 |
ifAbsent:[ |
|
3662 |
BlockValue |
|
3663 |
with:[:m | self hasTwoDirectoriesSelected] |
|
3664 |
argument:self currentFileNameHolder |
|
3665 |
]. |
|
3666 |
||
3667 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
3668 |
! |
|
3669 |
||
4414 | 3670 |
hasTwoFilesSelectedHolder |
9490 | 3671 |
^ self |
3672 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3673 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3674 |
BlockValue |
5830 | 3675 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3676 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3677 |
]. |
9490 | 3678 |
|
3679 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 3680 |
! |
3681 |
||
11053 | 3682 |
inputTabColumnConversion |
3683 |
^ self inputTabColumnConversionHolder value |
|
3684 |
||
3685 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
3686 |
! |
|
3687 |
||
3688 |
inputTabColumnConversionHolder |
|
3689 |
^ self |
|
3690 |
aspectFor:#inputTabColumnConversionHolder |
|
3691 |
ifAbsent:[ |
|
3692 |
self |
|
3693 |
applicationNamed:#FileApplicationNoteBook |
|
3694 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
3695 |
] |
|
3696 |
||
3697 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
3698 |
! |
|
3699 |
||
3700 |
lineEndConvention |
|
3701 |
^ self lineEndConventionHolder value |
|
3702 |
||
3703 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
3704 |
! |
|
3705 |
||
11591 | 3706 |
lineEndConvention: aSymbol |
3707 |
self lineEndConventionHolder value: aSymbol |
|
3708 |
||
3709 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
3710 |
! |
|
3711 |
||
11053 | 3712 |
lineEndConventionHolder |
3713 |
^ self |
|
3714 |
aspectFor:#lineEndConventionHolder |
|
3715 |
ifAbsent:[ |
|
3716 |
self |
|
3717 |
applicationNamed:#FileApplicationNoteBook |
|
3718 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
3719 |
] |
|
3720 |
||
3721 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
3722 |
! |
|
3723 |
||
5737 | 3724 |
lockFileEncoding:aBoolean |
3725 |
self lockFileEncodingHolder value:aBoolean. |
|
3726 |
||
3727 |
self |
|
3728 |
applicationNamed:#FileApplicationNoteBook |
|
3729 |
ifPresentDo:[:nb | |
|
3730 |
|appl| |
|
3731 |
||
3732 |
appl := nb selectedApplication. |
|
3733 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
3734 |
appl lockFileEncoding:aBoolean |
|
3735 |
] |
|
3736 |
]. |
|
3737 |
! |
|
3738 |
||
3739 |
lockFileEncodingHolder |
|
3740 |
^ self |
|
3741 |
aspectFor:#lockFileEncodingHolder |
|
3742 |
ifAbsent:[ |
|
3743 |
self |
|
3744 |
applicationNamed:#FileApplicationNoteBook |
|
3745 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
3746 |
] |
|
3747 |
! |
|
3748 |
||
13856 | 3749 |
makeCommandHolder |
3750 |
^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ]. |
|
3751 |
||
3752 |
"Created: / 13-04-2012 / 17:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3753 |
! |
|
3754 |
||
4523 | 3755 |
notify:aString |
11108 | 3756 |
"aString is shown in the lower pane" |
3757 |
||
4523 | 3758 |
self notifyChannel value:aString |
11108 | 3759 |
|
3760 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 3761 |
! |
3762 |
||
3892 | 3763 |
notifyChannel |
3764 |
||
3765 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3766 |
! |
3767 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3768 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3769 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3770 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3771 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3772 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3773 |
|
4071 | 3774 |
rootHolder |
3775 |
"holder, which keeps the rootHolder of the treeView |
|
3776 |
" |
|
3777 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3778 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3779 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3780 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3781 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3782 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3783 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3784 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3785 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3786 |
! ! |
3787 |
||
3788 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3789 |
||
3790 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3791 |
"returns the model for an aspect; these are stored in a common dictionary" |
3792 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3793 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3794 |
! |
3795 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3796 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3797 |
"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
|
3798 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3799 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3800 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3801 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3802 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3803 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3804 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3805 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3806 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3807 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3808 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3809 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3810 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3811 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3812 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3813 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3814 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3815 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3816 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3817 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3818 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3819 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3820 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3821 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3822 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3823 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3824 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3825 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3826 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3827 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3828 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3829 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3830 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3831 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3832 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3833 |
aspectFor:something put:aValueHolder |
6284 | 3834 |
"stores the model for an aspect; these are stored in a common dictionary" |
3835 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3836 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3837 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3838 |
|
3892 | 3839 |
aspects |
6284 | 3840 |
"returns the common aspect dictionary" |
3841 |
||
3892 | 3842 |
^ aspects |
3843 |
! |
|
3844 |
||
3845 |
runtimeAspectValueFor:something |
|
3846 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3847 |
" |
|
3848 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3849 |
! |
|
3850 |
||
4201 | 3851 |
saveAspectValues |
3852 |
|saveAspects aspectValue| |
|
3853 |
||
3854 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3855 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3856 |
saveAspects do:[ :aspectKey | |
4201 | 3857 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3858 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3859 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3860 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3861 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3862 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3863 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3864 |
! |
3865 |
||
3892 | 3866 |
saveRuntimeAspectValues |
3867 |
|savedAspects dictionary value isHolder aspect| |
|
3868 |
||
5941 | 3869 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3870 |
dictionary := Dictionary new. |
5941 | 3871 |
savedAspects do:[:aspectKey | |
4414 | 3872 |
aspect := self perform:aspectKey. |
3873 |
isHolder := aspect isValueModel. |
|
5941 | 3874 |
isHolder ifTrue:[ |
3875 |
value := aspect value |
|
3876 |
] ifFalse:[ |
|
3877 |
value := aspect |
|
3878 |
]. |
|
3879 |
dictionary at:aspectKey |
|
3880 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3881 |
]. |
|
3882 |
RuntimeAspects := dictionary. |
|
3892 | 3883 |
! |
3884 |
||
4201 | 3885 |
userPreferencesAspectValueFor:something |
3886 |
"returns the default aspect from the Userpreferences |
|
3892 | 3887 |
" |
4201 | 3888 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3889 |
(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
|
3890 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3891 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3892 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3893 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3894 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 3895 |
! ! |
3896 |
||
4011 | 3897 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3898 |
||
9015 | 3899 |
filter:aString |
3900 |
self filterModel value:aString |
|
3901 |
! |
|
3902 |
||
4018 | 3903 |
filterBackgroundColor |
3904 |
||
3905 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3906 |
! |
|
3907 |
||
4011 | 3908 |
filterBlockHolder |
3909 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3910 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3911 |
! |
3912 |
||
3913 |
filterListModel |
|
3914 |
||
3915 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3916 |
! |
|
3917 |
||
3918 |
filterModel |
|
5941 | 3919 |
|m| |
3920 |
||
3921 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3922 |
^ m |
|
4011 | 3923 |
! |
3924 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3925 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3926 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3927 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3928 |
|
4018 | 3929 |
filterValueBox |
3930 |
||
3931 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3932 |
! |
|
3933 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3934 |
makeFilterBlock |
14497 | 3935 |
"return a two-arg filterblock on the file's path- and base-name. This block should return true for files |
9102 | 3936 |
to be shown" |
3937 |
||
12760 | 3938 |
| filterString filterStrings filters notFilters showHidden filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3939 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3940 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3941 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3942 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3943 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3944 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 3945 |
filterStrings := filterStrings |
3946 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
3947 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3948 |
filters := filterStrings |
12760 | 3949 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
3950 |
thenCollect: |
|
3951 |
[:eachPattern | |
|
3952 |
|pattern| |
|
3953 |
||
3954 |
pattern := eachPattern withoutSeparators. |
|
13856 | 3955 |
"JV@2012-03-05: Add implict star at the beggining and at the end of pattern, |
3956 |
that's how most of the other applications behave - do what most users expect" |
|
3957 |
pattern first == $* ifFalse:[pattern := '*' , pattern]. |
|
3958 |
pattern last == $* ifFalse:[pattern := pattern , '*']. |
|
3959 |
||
3960 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
|
12760 | 3961 |
]. |
3962 |
||
3963 |
notFilters := filterStrings |
|
3964 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
3965 |
thenCollect: |
|
3966 |
[:eachPattern | |
|
9296 | 3967 |
|pattern| |
3968 |
||
3969 |
pattern := eachPattern withoutSeparators. |
|
12760 | 3970 |
pattern := (pattern copyFrom:2) withoutSeparators. |
13439 | 3971 |
[:name :baseName | pattern match:baseName caseSensitive:ignoreCase not] |
9296 | 3972 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3973 |
|
12760 | 3974 |
|
3975 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3976 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3977 |
] ifFalse:[ |
12760 | 3978 |
filters isEmpty ifTrue:[ |
3979 |
filterBlock := [:name :baseName | |
|
3980 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
3981 |
]. |
|
3982 |
] ifFalse:[ |
|
3983 |
notFilters isEmpty ifTrue:[ |
|
3984 |
filterBlock := [:name :baseName | |
|
3985 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3986 |
]. |
|
3987 |
] ifFalse:[ |
|
3988 |
filterBlock := [:name :baseName | |
|
3989 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3990 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
3991 |
]. |
|
3992 |
] |
|
3993 |
] |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3994 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3995 |
|
4011 | 3996 |
showHidden := self showHiddenFiles value. |
3997 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3998 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3999 |
]. |
9296 | 4000 |
^ [:name :baseName | |
4001 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
13856 | 4002 |
|
4003 |
"Modified: / 05-02-2012 / 01:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4018 | 4004 |
! |
4005 |
||
4006 |
shownFiles |
|
4007 |
||
4008 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 4009 |
! ! |
4010 |
||
14126 | 4011 |
|
3892 | 4012 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
4013 |
||
4014 |
dirHistory |
|
6369 | 4015 |
"obsolete" |
4016 |
^ self directoryHistory |
|
4017 |
! |
|
4018 |
||
4019 |
directoryHistory |
|
3952 | 4020 |
^ self class directoryHistory |
3892 | 4021 |
! |
4022 |
||
4023 |
enableBack |
|
4024 |
||
4025 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
4026 |
! |
|
4027 |
||
4028 |
enableFileHistory |
|
4029 |
||
4030 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
4031 |
! |
|
4032 |
||
4033 |
enableForward |
|
4034 |
||
4035 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
4036 |
! |
|
4037 |
||
4038 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
4039 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 4040 |
! ! |
4041 |
||
4042 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
4043 |
||
4345 | 4044 |
activityVisibilityChannel |
6284 | 4045 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 4046 |
|
4047 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
4048 |
! |
|
4049 |
||
6602 | 4050 |
changeSetBrowserItemVisible |
4051 |
^ Screen current ctrlDown. |
|
4052 |
! |
|
4053 |
||
11135 | 4054 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4055 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 4056 |
|
4057 |
"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
|
4058 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4059 |
! |
4060 |
||
13856 | 4061 |
hgMenusAreShown |
4062 |
^ (ConfigurableFeatures includesFeature: #HGSupportEnabled) |
|
4063 |
||
4064 |
"Created: / 14-01-2013 / 11:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4065 |
! |
|
4066 |
||
11135 | 4067 |
mercurialMenusAreShown |
11147 | 4068 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 4069 |
|
4070 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
4071 |
! |
|
4072 |
||
4110 | 4073 |
openAlwaysInTextEditor |
4201 | 4074 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 4075 |
|
4076 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
4077 |
! |
|
4078 |
||
3892 | 4079 |
openMultipleApplicationsForType |
4080 |
||
4201 | 4081 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
4082 |
open TextEditor " |
|
4083 |
||
3892 | 4084 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
4085 |
! |
|
4086 |
||
11137 | 4087 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4088 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4089 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 4090 |
|
4091 |
"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
|
4092 |
"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
|
4093 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 4094 |
! |
4095 |
||
14709
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4096 |
showDirectoriesOnTop |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4097 |
|
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4098 |
^ self aspectFor:#showDirectoriesOnTop ifAbsent:[ false asValue ] |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4099 |
|
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4100 |
"Created: / 12-08-2014 / 13:02:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4101 |
! |
dc6998e427f4
Added option to show directories always in top of the list in directory contents view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14659
diff
changeset
|
4102 |
|
4201 | 4103 |
showDirectoryTree |
4104 |
||
4105 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 4106 |
! |
4107 |
||
4554 | 4108 |
showDiskUsageHolder |
4109 |
|holder| |
|
4110 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
4111 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 4112 |
holder addDependent:self. |
4554 | 4113 |
^ holder |
4114 |
! |
|
4115 |
||
3892 | 4116 |
showHiddenFiles |
4117 |
||
9582 | 4118 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
4119 |
||
4120 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 4121 |
! |
4122 |
||
9108 | 4123 |
showHiddenFiles:aHolder |
4124 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
4125 |
! |
|
4126 |
||
4127 |
shownFiles:aHolder |
|
4128 |
self aspectFor:#shownFiles put:aHolder. |
|
4129 |
! |
|
4130 |
||
11135 | 4131 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4132 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 4133 |
|
4134 |
"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
|
4135 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4136 |
! |
4137 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4138 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4139 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
4140 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4141 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
4142 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4143 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4144 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4145 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4146 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4147 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4148 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4149 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4150 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4151 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4152 |
|
4648 | 4153 |
userContextAvailable |
4154 |
||
4155 |
" aspect for show group and user columns in contents view |
|
4156 |
windows provides no user context" |
|
4157 |
||
4158 |
^ OperatingSystem isMSWINDOWSlike not |
|
4159 |
! |
|
4160 |
||
3892 | 4161 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4162 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4163 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4164 |
^ self directoryContentsBrowser viewDescription |
3892 | 4165 |
! |
4166 |
||
4167 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4168 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4169 |
" |
3892 | 4170 |
|
6121 | 4171 |
|directoryContentsBrowser| |
4172 |
||
4173 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4174 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4175 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4176 |
! |
4177 |
||
4178 |
viewDirectoryDescription |
|
4179 |
||
4201 | 4180 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4181 |
on change directory " |
|
4182 |
||
3892 | 4183 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4184 |
! |
|
4185 |
||
4201 | 4186 |
viewDirsInContentsBrowser |
4187 |
||
4188 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4189 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4190 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4191 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4192 |
" |
4201 | 4193 |
! |
4194 |
||
5870 | 4195 |
viewFilesInContentsBrowser |
4196 |
||
4197 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4198 |
! |
|
4199 |
||
3892 | 4200 |
viewFilesInDirectoryTree |
4201 |
||
4201 | 4202 |
" aspect for view files in tree view (not only directories) " |
4203 |
||
3892 | 4204 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4205 |
! |
|
4206 |
||
4207 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4208 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4209 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4210 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4211 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4212 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4213 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4214 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4215 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4216 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4217 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4218 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4219 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4220 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4221 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4222 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4223 |
! |
4224 |
||
4225 |
viewNoteBookApplicationHolder |
|
4226 |
||
4227 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4228 |
! |
|
4229 |
||
4230 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4231 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4232 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4233 |
^ self directoryContentsBrowser viewOwner |
3892 | 4234 |
! |
4235 |
||
4236 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4237 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4238 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4239 |
^ self directoryContentsBrowser viewPermissions |
3892 | 4240 |
! |
4241 |
||
4242 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4243 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4244 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4245 |
^ self directoryContentsBrowser viewPreview |
3892 | 4246 |
! |
4247 |
||
4248 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4249 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4250 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4251 |
^ self directoryContentsBrowser viewSize |
3892 | 4252 |
! |
4253 |
||
4974 | 4254 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4255 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4256 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4257 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4258 |
! |
4259 |
||
5312 | 4260 |
viewSizeInKiloBytes |
4261 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4262 |
||
4263 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4264 |
! |
|
4265 |
||
3892 | 4266 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4267 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4268 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4269 |
^ self directoryContentsBrowser viewTime |
3892 | 4270 |
! |
4271 |
||
4272 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4273 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4274 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4275 |
^ self directoryContentsBrowser viewType |
3892 | 4276 |
! ! |
4277 |
||
4278 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4279 |
||
4280 |
executeCommand:cmd |
|
4281 |
||
4282 |
self executeCommand:cmd inDirectory:nil |
|
4283 |
! |
|
4284 |
||
5880 | 4285 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4286 |
| nameString executionBlock| |
4287 |
||
5880 | 4288 |
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
|
4289 |
nameString := 'Execute: ', cmd. |
3892 | 4290 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4291 |
! |
|
4292 |
||
4293 |
getExecutionBlockForCommand:cmd |
|
4294 |
||
4295 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4296 |
! |
|
4297 |
||
5880 | 4298 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4299 |
| dir| |
|
4300 |
||
4301 |
dir := directoryOrNil. |
|
4302 |
directoryOrNil isNil ifTrue:[ |
|
4303 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4304 |
dir isNil ifTrue:[ |
12493 | 4305 |
Dialog warn:(resources string:'Please select a single directory.'). |
6671 | 4306 |
AbortSignal raise. |
4307 |
^ nil |
|
4308 |
]. |
|
3892 | 4309 |
]. |
4523 | 4310 |
|
4311 |
^ [:stream| |
|
4312 |
stream notNil ifTrue:[ |
|
4414 | 4313 |
OperatingSystem |
4314 |
executeCommand:cmd |
|
4315 |
inputFrom:nil |
|
4316 |
outputTo:stream |
|
4317 |
errorTo:stream |
|
4318 |
inDirectory:dir |
|
4319 |
onError:[:status| false]. |
|
4320 |
] |
|
4523 | 4321 |
]. |
3892 | 4322 |
! |
4323 |
||
4324 |
killAllRunningBackgroundProcesses |
|
4325 |
||
4326 |
self backgroundProcesses do:[ : process | |
|
4523 | 4327 |
self notify:'kill ', process name. |
4414 | 4328 |
process terminate. |
3892 | 4329 |
]. |
4330 |
! |
|
4331 |
||
4332 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4333 |
| stream process appl nameString| |
|
4334 |
||
4335 |
appl := self openCommandResultApplication. |
|
4336 |
stream := appl resultStream. |
|
4337 |
nameString := aString ? 'Execution Result'. |
|
4338 |
appl changeTabTo:nameString. |
|
4523 | 4339 |
|
8355 | 4340 |
process := [ |
4341 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
4342 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4343 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4344 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4345 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4346 |
"/ close automatically, if there was no output. |
4571 | 4347 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4348 |
"/ appl doClose. |
|
4349 |
"/ ] |
|
8355 | 4350 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4351 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4352 |
] newProcess. |
3892 | 4353 |
process priority:(Processor userBackgroundPriority). |
4354 |
process name:nameString. |
|
4355 |
self backgroundProcesses add:process. |
|
4356 |
appl process value:process. |
|
4357 |
process resume. |
|
4358 |
! ! |
|
4359 |
||
4360 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4361 |
||
4915 | 4362 |
currentFileNameHolderChanged |
4363 |
"/ self currentFileNameHolderChangedForCommon |
|
4364 |
! |
|
4365 |
||
4577 | 4366 |
currentFileNameHolderChangedForCommon |
5476 | 4367 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4368 |
|
7560 | 4369 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4370 |
self class currentSelection:selection. |
4734 | 4371 |
|
13521 | 4372 |
selectionNotEmpty := selection notEmptyOrNil. |
5476 | 4373 |
self hasSelection value:selectionNotEmpty. |
4374 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 4375 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4376 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4377 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4378 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4379 |
self currentDirectories value:newDirectories. |
4380 |
size := newDirectories size. |
|
4774 | 4381 |
rootInTreeView := self |
4382 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4383 |
ifPresentDo:[:appl | appl rootHolder]. |
4384 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4385 |
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
|
4386 |
|
4347 | 4387 |
newDirectories notEmpty ifTrue:[ |
6369 | 4388 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4389 |
]. |
5074 | 4390 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
14308 | 4391 |
"/ self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4392 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4393 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4394 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4395 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4396 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4397 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4398 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4399 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4400 |
self enableForward value:self canForward. |
4734 | 4401 |
self enableBack value:self canBackward. |
6095 | 4402 |
|
13856 | 4403 |
self updateCanMake. |
7560 | 4404 |
|
9677 | 4405 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
13856 | 4406 |
"Modified: / 17-12-2013 / 08:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4011 | 4407 |
! |
4408 |
||
4409 |
filterModelChanged |
|
4410 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4411 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4412 |
! |
4413 |
||
3892 | 4414 |
update:something with:aParameter from:changedObject |
4415 |
||
4416 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4417 |
and the things that have to be done if it runs standalone " |
|
4418 |
||
4419 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4420 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4421 |
^ self |
3892 | 4422 |
]. |
3989 | 4423 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4424 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4425 |
^ self |
3989 | 4426 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4427 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4428 |
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
|
4429 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4430 |
]. |
4011 | 4431 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4432 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4433 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4434 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4435 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4436 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4437 |
^ self |
4004 | 4438 |
]. |
4781 | 4439 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4440 |
self notify:nil. |
4781 | 4441 |
^ self |
4442 |
]. |
|
3989 | 4443 |
|
3892 | 4444 |
super update:something with:aParameter from:changedObject |
5543 | 4445 |
! |
4446 |
||
6095 | 4447 |
updateCanMake |
4448 |
|dir can| |
|
4449 |
||
4450 |
can := false. |
|
4451 |
dir := self currentDirectory. |
|
4452 |
dir notNil ifTrue:[ |
|
13856 | 4453 |
"/ Check for make |
6095 | 4454 |
can := (dir asFilename construct:'Makefile') exists. |
13856 | 4455 |
can ifFalse:[ |
4456 |
can := (dir asFilename construct:'makefile') exists. |
|
4457 |
]. |
|
6095 | 4458 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
4459 |
can ifFalse:[ |
|
13856 | 4460 |
can := (self currentDirectory asFilename construct:'bc.mak') exists. |
6095 | 4461 |
] |
4462 |
]. |
|
13856 | 4463 |
can ifTrue:[ |
4464 |
self makeCommandHolder value: 'make'. |
|
4465 |
self canMake value: true. |
|
4466 |
^ self |
|
4467 |
]. |
|
4468 |
||
4469 |
"/Check for Apache ant |
|
4470 |
(OperatingSystem canExecuteCommand: 'ant') ifTrue:[ |
|
4471 |
can := (dir asFilename construct:'build.xml') exists. |
|
4472 |
can ifTrue:[ |
|
4473 |
self makeCommandHolder value: 'ant'. |
|
4474 |
self canMake value: true. |
|
4475 |
^ self |
|
4476 |
]. |
|
4477 |
]. |
|
4478 |
||
4479 |
"/Add more here... |
|
4480 |
||
6095 | 4481 |
]. |
4482 |
self canMake value:can. |
|
13856 | 4483 |
|
4484 |
"Modified: / 17-12-2013 / 08:13:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
6095 | 4485 |
! |
4486 |
||
5543 | 4487 |
updateListAfterDelete:colOfFiles |
4488 |
self updateCurrentDirectory |
|
3892 | 4489 |
! ! |
4490 |
||
4491 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4492 |
||
4493 |
canPaste |
|
4494 |
||
4495 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
4496 |
! |
|
4497 |
||
4498 |
clipboard |
|
4499 |
||
4500 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4501 |
! |
|
4502 |
||
4503 |
copyFilesToClipBoard:colOfFiles |
|
4504 |
self putInClipBoard:colOfFiles as:#copy. |
|
4505 |
! |
|
4506 |
||
4507 |
cutFilesToClipBoard:colOfFiles |
|
4508 |
"defete current selected files/directories |
|
4509 |
" |
|
4510 |
self putInClipBoard:colOfFiles as:#cut. |
|
4511 |
! |
|
4512 |
||
4513 |
emptyClipBoard |
|
4514 |
||
4515 |
self clipboard files:nil. |
|
4516 |
self canPaste value:false. |
|
4517 |
! |
|
4518 |
||
4519 |
putInClipBoard:colOfFiles as:aSymbol |
|
4520 |
| stream clp| |
|
4521 |
||
4522 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4523 |
clp := self clipboard. |
|
4524 |
clp files:nil. |
|
4525 |
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
|
4526 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4527 |
stream := String writeStream. |
3892 | 4528 |
stream nextPutAll:aSymbol asString. |
4529 |
stream nextPutAll:' <'. |
|
4530 |
stream nextPutAll:colOfFiles first asString. |
|
4531 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4532 |
stream nextPutAll:' ...'. |
3892 | 4533 |
]. |
4534 |
stream nextPutAll:'> to clipboard'. |
|
4535 |
||
4523 | 4536 |
self notify:stream contents. |
3892 | 4537 |
clp files:colOfFiles. |
4538 |
self canPaste value:true. |
|
4539 |
! ! |
|
4540 |
||
4541 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4542 |
||
4543 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4544 |
|filenameDirString filenameDir| |
3892 | 4545 |
|
4546 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4547 |
|
3892 | 4548 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4549 |
filenameDir isNil ifTrue:[^ false ]. |
13232 | 4550 |
filenameDir isWritableDirectory ifFalse:[^ false]. |
6284 | 4551 |
|
3892 | 4552 |
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
|
4553 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4554 |
dropedObjects do:[:aDropObject | |
6284 | 4555 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4556 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4557 |
"/ |
|
4558 |
"/ dropFileName := aDropObject theObject. |
|
4559 |
"/ dropFileNameString := dropFileName asString. |
|
4560 |
"/ dropFileName isDirectory ifTrue:[ |
|
4561 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4562 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4563 |
"/ ^ false |
|
4564 |
"/ ] |
|
4565 |
"/ ] ifFalse:[ |
|
4566 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4567 |
"/ (filenameDirString = dropFileName directory asString |
|
4568 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4569 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4570 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4571 |
"/ ^ false |
|
4572 |
"/ ] |
|
4573 |
"/ ] |
|
4574 |
]. |
|
4575 |
self notify:nil. |
|
4576 |
^ true |
|
4577 |
! |
|
4578 |
||
4579 |
canDropObject:aDropObject into:aDirectory |
|
4580 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4581 |
||
4582 |
dropFileName := aDropObject theObject. |
|
4583 |
dropFileNameString := dropFileName asString. |
|
4584 |
dropFileName isDirectory ifTrue:[ |
|
4585 |
filenameDirString := aDirectory asString. |
|
4586 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4587 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4588 |
^ false |
|
4414 | 4589 |
] |
6284 | 4590 |
] ifFalse:[ |
4591 |
physicalPathName := dropFileName physicalPathName. |
|
4592 |
(aDirectory = dropFileName directory |
|
4593 |
or:[ aDropObject isFileInArchive not |
|
4594 |
and:[physicalPathName notNil |
|
4595 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4596 |
self notify:'Cannot drop a file into same directory'. |
|
4597 |
^ false |
|
4598 |
] |
|
4599 |
]. |
|
4600 |
^ true. |
|
3892 | 4601 |
! |
4602 |
||
7406 | 4603 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
4604 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
4605 |
||
4606 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4607 |
! |
|
4608 |
||
3892 | 4609 |
doStartDrag:aDropSource in:aView |
7829 | 4610 |
"set the cursors before starting the drag & drop operation" |
4611 |
||
3892 | 4612 |
|hdl| |
4613 |
||
4614 |
hdl := DragAndDropManager new. |
|
4615 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4616 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4617 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 4618 |
hdl alienCursor:nil. |
4619 |
||
4745 | 4620 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
4621 |
||
7829 | 4622 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 4623 |
! |
4624 |
||
7408 | 4625 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 4626 |
|fileEntryFieldHolder destDir dropObject fn d| |
4627 |
||
4628 |
fileEntryFieldHolder := self masterApplication notNil |
|
4629 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
4630 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
4631 |
||
4632 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4633 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4634 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4635 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4636 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4637 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4638 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4639 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4640 |
]. |
7990 | 4641 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4642 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4643 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4644 |
]. |
6479 | 4645 |
|
4646 |
destDir := self currentDirectory. |
|
4647 |
destDir isNil ifTrue:[^ self]. |
|
4648 |
||
8601 | 4649 |
self withWaitCursorDo:[ |
4650 |
aCollectionOfDropObjects do:[:dropObject | |
|
4651 |
|fn| |
|
4652 |
||
4653 |
dropObject isFileObject ifTrue:[ |
|
4654 |
fn := dropObject theObject asFilename. |
|
4655 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
4656 |
fn recursiveCopyTo:destDir |
8601 | 4657 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
4658 |
fn copyTo:(destDir / fn baseName ) |
8601 | 4659 |
] |
6479 | 4660 |
] |
8601 | 4661 |
]. |
4662 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4663 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4664 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4665 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4666 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4667 |
]. |
7408 | 4668 |
|
4669 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 4670 |
! ! |
4671 |
||
4672 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
4673 |
||
4674 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 4675 |
"copy to" |
4676 |
||
7635 | 4677 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
4678 |
||
4679 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
4680 |
! |
|
4681 |
||
4682 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
4683 |
"copy to" |
|
4684 |
||
4685 |
|copyOperation msg| |
|
4686 |
||
4687 |
repairCorruptedFiles ifTrue:[ |
|
4688 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
4689 |
] ifFalse:[ |
|
4690 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
4691 |
]. |
|
4692 |
copyOperation result ifTrue:[ |
|
6190 | 4693 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 4694 |
] ifFalse:[ |
7635 | 4695 |
msg := copyOperation errorString. |
6190 | 4696 |
]. |
4697 |
self notify:msg. |
|
7635 | 4698 |
^ copyOperation result |
4699 |
||
4700 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 4701 |
! |
4702 |
||
4703 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 4704 |
|copy result| |
3892 | 4705 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4706 |
self withActivityIndicationDo:[ |
5961 | 4707 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 4708 |
copy result ifTrue:[ |
4709 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
4710 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4711 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4712 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4713 |
self updateCurrentDirectory. |
3892 | 4714 |
]. |
6374 | 4715 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4716 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4717 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 4718 |
! |
4719 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4720 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
12850 | 4721 |
|size msg answer file| |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4722 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4723 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4724 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4725 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4726 |
"/ 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
|
4727 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4728 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4729 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4730 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4731 |
"/ 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
|
4732 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4733 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4734 |
"/ 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
|
4735 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4736 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4737 |
"/ 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
|
4738 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4739 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4740 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4741 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4742 |
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
|
4743 |
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
|
4744 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4745 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4746 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4747 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4748 |
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
|
4749 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4750 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 4751 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4752 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4753 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4754 |
request:msg |
8127 | 4755 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
4756 |
image:(WarningBox iconBitmap) |
8127 | 4757 |
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
|
4758 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4759 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4760 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4761 |
^ answer. |
3892 | 4762 |
! |
4763 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4764 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 4765 |
"copy or move aColOfSourceFiles to aDirectory. |
4766 |
Asks the used if a move or a copy is wanted. |
|
4767 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
4768 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4769 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4770 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4771 |
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
|
4772 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4773 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4774 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4775 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4776 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4777 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4778 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4779 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4780 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4781 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4782 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4783 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 4784 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4785 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4786 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4787 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4788 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4789 |
|
4745 | 4790 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4791 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4792 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4793 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4794 |
^ true. |
3892 | 4795 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4796 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4797 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4798 |
^ true. |
3892 | 4799 |
]. |
4745 | 4800 |
^ false. |
3892 | 4801 |
! |
4802 |
||
6107 | 4803 |
copySelectionTo |
4804 |
"copy the selected file(s) to another directory" |
|
4805 |
||
13704 | 4806 |
self copySelectionToRepairingCorruptedFiles:false. |
4807 |
self updateCurrentDirectoryWithReread. |
|
7635 | 4808 |
|
4809 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
4810 |
! |
|
4811 |
||
4812 |
copySelectionToRepairingCorruptedFiles |
|
4813 |
"copy the selected file(s) to another directory" |
|
4814 |
||
13704 | 4815 |
self copySelectionToRepairingCorruptedFiles:true. |
4816 |
self updateCurrentDirectoryWithReread. |
|
7635 | 4817 |
|
4818 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
4819 |
! |
|
4820 |
||
4821 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
4822 |
"copy the selected file(s) to another directory" |
|
4823 |
||
6299 | 4824 |
|selectedFiles msg destination directory| |
4825 |
||
7560 | 4826 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 4827 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
4828 |
||
4829 |
msg := (selectedFiles size > 1) |
|
14588 | 4830 |
ifTrue:[ 'Copy Selected Items to Directory:' ] |
4831 |
ifFalse:[ 'Copy "%1" to Directory:' ]. |
|
6299 | 4832 |
|
4833 |
destination := Dialog |
|
14588 | 4834 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first baseName) |
7635 | 4835 |
default:(LastMoveDestination ? self currentDirectory) |
4836 |
ok:(resources string:'Copy') |
|
4837 |
abort:nil. |
|
4838 |
||
6299 | 4839 |
destination isEmptyOrNil ifTrue:[^ self]. |
4840 |
destination := destination asFilename. |
|
4841 |
||
4842 |
destination isDirectory ifFalse:[ |
|
4843 |
selectedFiles size == 1 ifTrue:[ |
|
4844 |
directory := destination directory. |
|
4845 |
directory isDirectory ifTrue:[ |
|
4846 |
LastMoveDestination := directory. |
|
7635 | 4847 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 4848 |
^ self. |
4849 |
] |
|
4850 |
] |
|
4851 |
]. |
|
4852 |
||
4853 |
LastMoveDestination := destination. |
|
7635 | 4854 |
repairingCorruptedFiles ifTrue:[ |
4855 |
selectedFiles do:[:eachFile | |
|
4856 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
4857 |
]. |
|
4858 |
^ self. |
|
4859 |
] ifFalse:[ |
|
4860 |
self copyFiles:selectedFiles to:destination |
|
4861 |
] |
|
4862 |
||
4863 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 4864 |
! |
4865 |
||
3892 | 4866 |
deleteFile:aFile |
6373 | 4867 |
"delete the selected files/directories" |
3892 | 4868 |
|
4869 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
4870 |
! |
|
4871 |
||
4872 |
deleteFiles:colOfFiles |
|
6373 | 4873 |
"delete some files/directories" |
4874 |
||
5081 | 4875 |
^ self deleteFiles:colOfFiles confirm:true. |
4876 |
! |
|
4877 |
||
4878 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 4879 |
"delete some files/directories" |
4880 |
||
5673 | 4881 |
|delete result| |
3892 | 4882 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4883 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4884 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4885 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4886 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4887 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4888 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4889 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4890 |
]. |
5673 | 4891 |
result notNil ifTrue:[ |
4892 |
result ifFalse:[ |
|
4893 |
self notify:delete errorString. |
|
5753 | 4894 |
] ifTrue:[ |
4895 |
self updateListAfterDelete:colOfFiles. |
|
4896 |
] |
|
4394 | 4897 |
]. |
5673 | 4898 |
]. |
4899 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4900 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4901 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 4902 |
! |
4903 |
||
6169 | 4904 |
eraseFiles:colOfFiles |
6373 | 4905 |
"erase (clear and delete) some files/directories" |
4906 |
||
6169 | 4907 |
^ self eraseFiles:colOfFiles confirm:true. |
4908 |
! |
|
4909 |
||
4910 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4911 |
"erase (clear and delete) some files/directories" |
4912 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4913 |
|deleteOperation result fileSize| |
6169 | 4914 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4915 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4916 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4917 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4918 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4919 |
ifTrue:[ |
4920 |
result := deleteOperation result. |
|
4921 |
] ifFalse:[ |
|
4922 |
ProgressIndicator |
|
4923 |
displayProgressNotifications:'Erasing' |
|
4924 |
abortable:true |
|
4925 |
at:nil |
|
4926 |
during:[ |
|
4927 |
result := deleteOperation result. |
|
4928 |
]. |
|
4929 |
]. |
|
4930 |
||
6169 | 4931 |
result notNil ifTrue:[ |
4932 |
result ifFalse:[ |
|
8294 | 4933 |
self notify:deleteOperation errorString. |
6169 | 4934 |
] ifTrue:[ |
4935 |
self updateListAfterDelete:colOfFiles. |
|
4936 |
] |
|
4937 |
]. |
|
4938 |
]. |
|
4939 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4940 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4941 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4942 |
! |
4943 |
||
3892 | 4944 |
moveFile:aSourceFile to:aDestFile |
6373 | 4945 |
"move a file/directory" |
3892 | 4946 |
|
4947 |
|move| |
|
4948 |
||
5961 | 4949 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4950 |
move result ifTrue:[ |
4523 | 4951 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4952 |
] ifFalse:[ |
4523 | 4953 |
self notify:move errorString. |
3892 | 4954 |
]. |
4955 |
self updateCurrentDirectory. |
|
4956 |
^ move result |
|
4957 |
! |
|
4958 |
||
4959 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4960 |
"move some files to aDirectory" |
4961 |
||
3892 | 4962 |
|move| |
4963 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4964 |
self withActivityIndicationDo:[ |
5961 | 4965 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4966 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4967 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4968 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4969 |
self updateCurrentDirectory. |
3892 | 4970 |
]. |
6373 | 4971 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4972 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4973 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4974 |
! |
4975 |
||
6107 | 4976 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4977 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4978 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4979 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4980 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4981 |
destinationDirectory := Dialog |
14588 | 4982 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items to Directory:') |
5789 | 4983 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4984 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4985 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4986 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4987 |
|
5789 | 4988 |
LastMoveDestination := destinationDirectory. |
13704 | 4989 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename. |
4990 |
self updateCurrentDirectoryWithReread. |
|
4991 |
||
7560 | 4992 |
|
4993 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4994 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4995 |
|
3892 | 4996 |
newDirectory |
4997 |
"ask for and create a new directory" |
|
4998 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4999 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5000 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5001 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5002 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5003 |
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
|
5004 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5005 |
]. |
4521 | 5006 |
|
5007 |
"/ 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
|
5008 |
selectedFiles := self currentSelectedFiles. |
4521 | 5009 |
selectedFiles size == 1 ifTrue:[ |
5010 |
singleSelectedFile := selectedFiles first. |
|
5011 |
||
5012 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
13714 | 5013 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5014 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
5015 |
||
5016 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
13714 | 5017 |
(mime notNil and:[mime isArchiveType]) ifTrue:[ |
4521 | 5018 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
5019 |
]. |
|
5020 |
]. |
|
5021 |
]. |
|
5022 |
||
5961 | 5023 |
|
4521 | 5024 |
defaultAnswer notNil ifTrue:[ |
5961 | 5025 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 5026 |
] ifFalse:[ |
5961 | 5027 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 5028 |
]. |
5029 |
createOp result ifFalse:[ ^ self]. |
|
5030 |
newFile := createOp createdFile. |
|
3892 | 5031 |
newFile notNil ifTrue:[ |
4414 | 5032 |
self updateCurrentDirectory. |
3892 | 5033 |
] |
5034 |
! |
|
5035 |
||
5036 |
newFile |
|
5037 |
"ask for and create a new file" |
|
5038 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5039 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5040 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5041 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5042 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5043 |
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
|
5044 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5045 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5046 |
|
3982 | 5047 |
curFile := self firstSelectedFile. |
3892 | 5048 |
curFile notNil ifTrue:[ |
4414 | 5049 |
file := curFile. |
3892 | 5050 |
] ifFalse:[ |
4414 | 5051 |
file := directory. |
3892 | 5052 |
]. |
5961 | 5053 |
create := FileOperation createFileIn:file. |
3892 | 5054 |
create result ifFalse:[ ^ self]. |
5055 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
5056 |
! |
|
5057 |
||
5058 |
newHardLink |
|
5059 |
"ask for and create a hard link (unix only)" |
|
5060 |
||
6151 | 5061 |
self newLink:#hard. |
5062 |
! |
|
5063 |
||
5064 |
newLink:typeOfLink |
|
3892 | 5065 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
5066 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5067 |
| sel dir create createdFile| |
3892 | 5068 |
|
7560 | 5069 |
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
|
5070 |
(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
|
5071 |
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
|
5072 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
5073 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5074 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5075 |
|
6151 | 5076 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 5077 |
create result ifFalse:[ ^ self]. |
5078 |
createdFile := create createdFile. |
|
5079 |
createdFile notNil ifTrue:[ |
|
6151 | 5080 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5081 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5082 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5083 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5084 |
] |
3892 | 5085 |
]. |
7560 | 5086 |
|
5087 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 5088 |
! |
5089 |
||
5090 |
newSoftLink |
|
5091 |
"ask for and create a soft link (unix only)" |
|
5092 |
||
6151 | 5093 |
self newLink:#soft. |
3892 | 5094 |
! |
5095 |
||
5096 |
pasteFiles |
|
6373 | 5097 |
"paste from clipBoard" |
5098 |
||
5099 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 5100 |
|
5101 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
5102 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 5103 |
|
5104 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
5105 |
||
3892 | 5106 |
buffer := self clipboard copy. |
3982 | 5107 |
directories := self currentSelectedDirectories. |
5880 | 5108 |
directories size ~~ 1 ifTrue:[ |
4414 | 5109 |
|box dirStringCol| |
5880 | 5110 |
|
4414 | 5111 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
5112 |
box := ListSelectionBox new. |
|
6373 | 5113 |
box title:'Paste into which directory ?'. |
4414 | 5114 |
box list:dirStringCol. |
5115 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5116 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5117 |
box destroy. |
3892 | 5118 |
] ifFalse:[ |
5880 | 5119 |
destination := directories anElement. |
3892 | 5120 |
]. |
6373 | 5121 |
|
5122 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 5123 |
buffer files copy do:[:aFile| |
5124 |
aFile directory = destination ifTrue:[ |
|
5125 |
buffer files remove:aFile. |
|
5126 |
]. |
|
5127 |
]. |
|
5128 |
]. |
|
5129 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 5130 |
copiedFiles notEmptyOrNil ifTrue:[ |
5131 |
thisIsAFileMoveOperation ifTrue:[ |
|
5132 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
5133 |
]. |
|
5134 |
||
5135 |
"/ select those pasted files. |
|
5136 |
self updateCurrentDirectory:true. |
|
5137 |
self currentFileNameHolder value:copiedFiles values. |
|
5138 |
] |
|
3892 | 5139 |
! |
5140 |
||
5141 |
renameFile:aFile |
|
5142 |
"rename the selected file(s)" |
|
5143 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5144 |
^ self renameFiles:(Array with:aFile). |
3892 | 5145 |
! |
5146 |
||
4230 | 5147 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 5148 |
"rename filename to newFileString" |
5149 |
||
5150 |
|rename| |
|
5151 |
||
5961 | 5152 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 5153 |
rename result ifTrue:[ |
4230 | 5154 |
aBoolean ifTrue:[ |
5155 |
self updateAndSelect:(rename renamedFiles). |
|
5156 |
]. |
|
3892 | 5157 |
] ifFalse:[ |
4523 | 5158 |
self notify:rename errorString. |
3892 | 5159 |
]. |
5160 |
^ rename result |
|
5161 |
! |
|
5162 |
||
5163 |
renameFiles:aColOfFiles |
|
6373 | 5164 |
"rename some file(s)" |
3892 | 5165 |
|
5166 |
|rename| |
|
5167 |
||
5961 | 5168 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 5169 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5170 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5171 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5172 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5173 |
^ rename |
3892 | 5174 |
! |
5175 |
||
5176 |
renameSelection |
|
5177 |
"rename the selected file(s)" |
|
5178 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5179 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5180 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5181 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5182 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5183 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5184 |
]. |
7560 | 5185 |
|
5186 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5187 |
! ! |
5188 |
||
4080 | 5189 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5190 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5191 |
bookmarksMenu |
3952 | 5192 |
<resource: #programMenu> |
5193 |
||
14941 | 5194 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec. |
5195 |
! |
|
5196 |
||
5197 |
bookmarksMenuForBaseSpec:aBaseMenuSpec |
|
5198 |
<resource: #programMenu> |
|
5199 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5200 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5201 |
|
14941 | 5202 |
menu := aBaseMenuSpec decodeAsLiteralArray. |
7763 | 5203 |
|
5204 |
"/ add the bookmark items ... |
|
5205 |
bookmarks := self class directoryBookmarks. |
|
5206 |
bookmarks notEmptyOrNil ifTrue:[ |
|
14604 | 5207 |
menu addSeparator. |
7763 | 5208 |
bookmarks do:[:dirName | |
12963 | 5209 |
menu addItem:(MenuItem |
5210 |
label:dirName asString |
|
5211 |
itemValue:[ |
|
5212 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5213 |
self setCurrentFileName:dirName. |
|
5214 |
]. |
|
5215 |
]). |
|
7763 | 5216 |
]. |
5217 |
]. |
|
4080 | 5218 |
menu findGuiResourcesIn:self. |
7763 | 5219 |
^ menu |
5220 |
||
11135 | 5221 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5222 |
! |
5223 |
||
5224 |
canBackward |
|
5225 |
^ self directoryHistory canBackward. |
|
5226 |
||
5227 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5228 |
! |
|
5229 |
||
5230 |
canForward |
|
5231 |
^ self directoryHistory canForward. |
|
5232 |
||
5233 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5234 |
! |
|
5235 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5236 |
gotoBookmarksMenu |
7763 | 5237 |
<resource: #programMenu> |
5238 |
||
14941 | 5239 |
^ self bookmarksMenuForBaseSpec:self class baseBookmarksMenuSpec2. |
6099 | 5240 |
! |
5241 |
||
3892 | 5242 |
menuDirHistory:backOrForward |
7763 | 5243 |
"initialize the history menu" |
5244 |
||
3892 | 5245 |
<resource: #programMenu > |
5246 |
||
7763 | 5247 |
|hist menu pathList currentSel currentPath| |
5248 |
||
5249 |
hist := self directoryHistory. |
|
5250 |
hist isEmpty ifTrue:[^ nil]. |
|
5251 |
||
3892 | 5252 |
backOrForward == #back ifTrue:[ |
6725 | 5253 |
currentSel := self currentSelectedDirectories. |
4347 | 5254 |
currentSel size == 1 ifTrue:[ |
5255 |
currentPath := currentSel first asString. |
|
5256 |
] ifFalse:[ |
|
5257 |
currentPath := nil. |
|
5258 |
]. |
|
7763 | 5259 |
pathList := hist getBackCollection. |
3892 | 5260 |
] ifFalse:[ |
7763 | 5261 |
pathList := hist getForwardCollection. |
3892 | 5262 |
]. |
4022 | 5263 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5264 |
|
6370 | 5265 |
pathList size > 30 ifTrue:[ |
5266 |
pathList := pathList copyTo:30 |
|
5267 |
]. |
|
7763 | 5268 |
|
5269 |
menu := Menu new. |
|
5270 |
||
3964 | 5271 |
pathList do:[:aPath| |
14593 | 5272 |
menu addItem:(MenuItem |
5273 |
label:aPath |
|
5274 |
itemValue:[ self setCurrentFileName:(aPath asFilename) ] |
|
5275 |
translateLabel:false). |
|
3952 | 5276 |
]. |
7763 | 5277 |
menu findGuiResourcesIn:self. |
3892 | 5278 |
^ menu |
7763 | 5279 |
|
11783 | 5280 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5281 |
! |
5282 |
||
5283 |
menuDirHistoryBack |
|
5284 |
"initialize the directory menu |
|
5285 |
" |
|
5286 |
<resource: #programMenu > |
|
5287 |
||
5288 |
^ self menuDirHistory:#back. |
|
5289 |
! |
|
5290 |
||
5291 |
menuDirHistoryForward |
|
5292 |
"initialize the directory menu |
|
5293 |
" |
|
5294 |
<resource: #programMenu > |
|
5295 |
||
5296 |
^ self menuDirHistory:#forward. |
|
3906 | 5297 |
! |
5298 |
||
5299 |
menuFileHistory |
|
5300 |
"initialize the file history menu |
|
5301 |
" |
|
5302 |
<resource: #programMenu > |
|
5303 |
||
7763 | 5304 |
|menu hist text removeItem| |
3906 | 5305 |
|
5306 |
hist := self fileHistory. |
|
5307 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5308 |
|
7763 | 5309 |
menu := Menu new. |
5310 |
||
5311 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5312 |
aFileItem fileName exists ifTrue:[ |
12963 | 5313 |
menu addItem:(MenuItem |
5314 |
label: aFileItem fileName asString |
|
14593 | 5315 |
itemValue: |
5316 |
[ |
|
5317 |
self setCurrentFileName:(aFileItem fileName). |
|
5318 |
self openApplByFileItem:aFileItem |
|
5319 |
] |
|
5320 |
translateLabel:false). |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5321 |
] ifFalse:[ |
7763 | 5322 |
"/ remove all not existing history entries |
5323 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5324 |
] |
3906 | 5325 |
]. |
7763 | 5326 |
menu addSeparator. |
5327 |
||
4080 | 5328 |
removeItem := MenuItem new. |
5329 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5330 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5331 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5332 |
removeItem label:text. |
11783 | 5333 |
removeItem |
5334 |
itemValue:[ |
|
5335 |
self fileHistory removeAll. |
|
5336 |
self enableFileHistory value:false. |
|
5337 |
]. |
|
3906 | 5338 |
menu addItem:removeItem. |
7763 | 5339 |
menu findGuiResourcesIn:self. |
3906 | 5340 |
^ menu |
7763 | 5341 |
|
11783 | 5342 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5343 |
! |
5344 |
||
4080 | 5345 |
sortMenu |
5346 |
<resource: #programMenu > |
|
5347 |
||
5348 |
|menu| |
|
5349 |
||
7763 | 5350 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5351 |
menu findGuiResourcesIn:self. |
5352 |
^ menu |
|
7763 | 5353 |
|
5354 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5355 |
! |
5356 |
||
5357 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5358 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5359 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5360 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5361 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5362 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5363 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5364 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5365 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5366 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5367 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5368 |
^ spec |
4080 | 5369 |
! |
5370 |
||
5371 |
viewInContentsBrowserMenu |
|
5009 | 5372 |
self |
5373 |
applicationNamed:#DirectoryContentsBrowser |
|
5374 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5375 |
||
5376 |
^ nil. |
|
4080 | 5377 |
! |
5378 |
||
3952 | 5379 |
visitedDirectoriesMenu |
5380 |
<resource: #programMenu > |
|
5381 |
||
5382 |
|menu histCopy text removeItem| |
|
5383 |
||
7763 | 5384 |
histCopy := self directoryHistory. |
5385 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5386 |
||
3952 | 5387 |
menu := Menu new. |
7763 | 5388 |
|
5389 |
histCopy do:[:aFile| |
|
12963 | 5390 |
menu addItem:(MenuItem |
5391 |
label:aFile asString |
|
5392 |
itemValue:[ |
|
5393 |
self setCurrentFileName:(aFile path asFilename). |
|
5394 |
]). |
|
7763 | 5395 |
]. |
5396 |
menu addSeparator. |
|
5397 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5398 |
"/ 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
|
5399 |
text := (resources string:'Clear History'). |
3952 | 5400 |
removeItem := MenuItem new. |
4040 | 5401 |
removeItem translateLabel:true. |
3952 | 5402 |
removeItem label:text. |
11783 | 5403 |
removeItem |
5404 |
itemValue:[ |
|
5405 |
self directoryHistory removeAll. |
|
5406 |
self enableForward value:self canForward. |
|
5407 |
self enableBack value:self canBackward. |
|
5408 |
]. |
|
7763 | 5409 |
|
3952 | 5410 |
menu addItem:removeItem. |
7763 | 5411 |
menu findGuiResourcesIn:self. |
3952 | 5412 |
^ menu |
7763 | 5413 |
|
11783 | 5414 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5415 |
! ! |
5416 |
||
5880 | 5417 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5418 |
||
5419 |
doCompareTwoFiles |
|
5420 |
self openDiffView. |
|
5421 |
! |
|
5422 |
||
5423 |
doGoDirectoryUp |
|
5960 | 5424 |
| upDir directory rootInTreeView| |
5880 | 5425 |
|
5426 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5427 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5428 |
directory := self currentDirectory. |
5429 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5430 |
] ifFalse:[ |
5431 |
rootInTreeView := self |
|
5432 |
applicationNamed:#DirectoryTreeBrowser |
|
5433 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5434 |
directory := rootInTreeView value asFilename. |
5435 |
]. |
|
5436 |
upDir := directory directory. |
|
5959 | 5437 |
self setCurrentFileName:upDir. |
5880 | 5438 |
! |
5439 |
||
5440 |
doGotoDefaultDirectory |
|
5441 |
self gotoFile:(Filename defaultDirectory). |
|
5442 |
! |
|
5443 |
||
8091 | 5444 |
doGotoDesktopDirectory |
5445 |
self gotoFile:(Filename desktopDirectory). |
|
5446 |
! |
|
5447 |
||
5880 | 5448 |
doGotoHomeDirectory |
8091 | 5449 |
self gotoFile:(Filename homeDirectory). |
5880 | 5450 |
! |
5451 |
||
6434 | 5452 |
doGotoSmalltalkDirectory |
5453 |
self gotoFile:(self smalltalkDirectory). |
|
5454 |
! |
|
5455 |
||
9677 | 5456 |
doGotoTempDirectory |
5457 |
self gotoFile:(self tempDirectory). |
|
5458 |
||
5459 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5460 |
! |
|
5461 |
||
9596 | 5462 |
doMakeCurrentDirectory |
5463 |
OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5464 |
self currentFileNameHolderChangedForCommon. |
|
5465 |
||
5466 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
5467 |
! |
|
5468 |
||
5880 | 5469 |
fileGetInfo:longInfo |
5470 |
"get info on selected file - show it in a box" |
|
5471 |
||
5472 |
|string box updater| |
|
5473 |
||
5474 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5475 |
string notNil ifTrue:[ |
|
5476 |
box := InfoBox title:string. |
|
5477 |
updater := [ |
|
5478 |
[true] whileTrue:[ |
|
5479 |
Delay waitForSeconds:2. |
|
5480 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5481 |
string isNil ifTrue:[ ^ self]. |
|
5482 |
box title:string |
|
5483 |
] |
|
5484 |
] fork. |
|
5485 |
box show. |
|
5486 |
updater terminate. |
|
5487 |
box destroy |
|
5488 |
] |
|
6434 | 5489 |
! |
5490 |
||
5491 |
smalltalkDirectory |
|
8590 | 5492 |
|stxPath| |
6434 | 5493 |
|
5494 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5495 |
stxPath isNil ifTrue:[ |
5496 |
^ Filename currentDirectory |
|
5497 |
]. |
|
5498 |
^ stxPath asFilename directory. |
|
9677 | 5499 |
! |
5500 |
||
5501 |
tempDirectory |
|
5502 |
^ Filename tempDirectory. |
|
5503 |
||
5504 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5505 |
! ! |
5506 |
||
11139 | 5507 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5508 |
||
14262 | 5509 |
addDirToJavaSourcePath |
5510 |
"add the current path to java's sourcePath |
|
5511 |
(only available with ST/J System" |
|
5512 |
||
5513 |
Java addToSourcePath:self currentDirectory pathName |
|
5514 |
||
5515 |
"Modified: 14.12.1996 / 15:37:47 / cg" |
|
5516 |
"Created: 2.8.1997 / 14:11:19 / cg" |
|
5517 |
! |
|
5518 |
||
11139 | 5519 |
copyFiles |
5520 |
self |
|
5521 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5522 |
! |
|
5523 |
||
5524 |
cutFiles |
|
5525 |
self |
|
5526 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5527 |
! |
|
5528 |
||
5529 |
deleteFiles |
|
5530 |
self |
|
5531 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5532 |
! |
|
5533 |
||
5534 |
eraseFiles |
|
5535 |
self |
|
5536 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
5537 |
! |
|
5538 |
||
14262 | 5539 |
fileAddToJavaSourcePath |
5540 |
"add the current path to java's sourcePath |
|
5541 |
(only available with ST/J System" |
|
5542 |
||
5543 |
self currentSelectedObjects do:[:each | |
|
5544 |
Java addToSourcePath:(each pathName) |
|
5545 |
]. |
|
5546 |
||
5547 |
"Created: / 9.11.1998 / 05:41:34 / cg" |
|
5548 |
"Modified: / 9.11.1998 / 05:56:00 / cg" |
|
5549 |
! |
|
5550 |
||
11139 | 5551 |
openSettingsDialog |
5552 |
|dialog| |
|
5553 |
||
5554 |
dialog := FileBrowserV2SettingsDialog new. |
|
5555 |
dialog settingsDialog:self. |
|
5556 |
dialog allButOpen. |
|
5557 |
dialog doReload. |
|
5558 |
dialog openWindow |
|
5559 |
! |
|
5560 |
||
5561 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
5562 |
|files dirs| |
|
5563 |
||
5564 |
files := self currentSelectedFiles. |
|
5565 |
files notEmpty ifTrue:[ |
|
5566 |
aBlock value:files. |
|
5567 |
] ifFalse:[ |
|
5568 |
dirs := self currentSelectedDirectories. |
|
5569 |
dirs notEmpty ifTrue:[ |
|
5570 |
aBlock value:dirs. |
|
5571 |
]. |
|
5572 |
]. |
|
5573 |
! ! |
|
5574 |
||
5575 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
5576 |
||
5577 |
openAboutThisApplication |
|
5578 |
"opens an about box for this application." |
|
5579 |
||
5580 |
Dialog aboutClass:self class. |
|
5581 |
! |
|
5582 |
||
5583 |
openHTMLDocument:relativeDocPath |
|
5584 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
5585 |
! ! |
|
5586 |
||
5587 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 5588 |
|
12777 | 5589 |
commitFilesToCVS:files |
5590 |
|numFiles| |
|
5591 |
||
5592 |
(numFiles := files size) > 0 ifTrue:[ |
|
5593 |
self withActivityIndicationDo:[ |
|
5594 |
self cvsCommitFiles:files |
|
5595 |
] |
|
5596 |
] |
|
5597 |
! |
|
5598 |
||
3892 | 5599 |
cvsAddAndCommit |
4849 | 5600 |
self cvsAddAndCommitAsBinary:false |
5601 |
! |
|
5602 |
||
5603 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 5604 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 5605 |
|
5606 |
log := Dialog |
|
11139 | 5607 |
requestText:(resources string:'Enter initial log message:') |
4414 | 5608 |
lines:10 |
5609 |
columns:70 |
|
5610 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
5611 |
log isNil ifTrue:[^ self]. |
3892 | 5612 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5613 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5614 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5615 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5616 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5617 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5618 |
|
8588 | 5619 |
binArg := ''. |
5620 |
asBinary ifTrue:[ |
|
5621 |
binArg := '-kb '. |
|
5622 |
]. |
|
3982 | 5623 |
sel := self currentSelectedFiles. |
11139 | 5624 |
executionBlock := |
5625 |
[:stream | |
|
5626 |
log notNil ifTrue:[ |
|
5627 |
sel size > 0 ifTrue:[ |
|
5628 |
sel do:[:fn | |
|
5629 |
|nameArg| |
|
5630 |
||
5631 |
nameArg := '"',fn baseName,'"'. |
|
5632 |
||
5633 |
dir := self getDirWithoutFileName:fn. |
|
5634 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
5635 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5636 |
||
5637 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5638 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 5639 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
5640 |
"/ support and need the 'admin -kb' command. |
|
5641 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
5642 |
asBinary ifTrue:[ |
|
5643 |
cmd := ('cvs admin -kb ' , nameArg). |
|
5644 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5645 |
||
5646 |
cmd := ('cvs upd ' , nameArg). |
|
5647 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5648 |
]. |
|
5649 |
] |
|
5650 |
] |
|
5651 |
] |
|
5652 |
]. |
|
4107 | 5653 |
nameString := 'Command> cvs add and commit'. |
3892 | 5654 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 5655 |
|
5656 |
"Modified (format): / 15-01-2012 / 16:02:07 / cg" |
|
3892 | 5657 |
! |
5658 |
||
4849 | 5659 |
cvsAddBinaryAndCommit |
5660 |
self cvsAddAndCommitAsBinary:true |
|
5661 |
! |
|
5662 |
||
3892 | 5663 |
cvsCommit |
12777 | 5664 |
|selectedFiles| |
3892 | 5665 |
|
3982 | 5666 |
selectedFiles:= self currentSelectedFiles. |
12777 | 5667 |
self cvsCommitFiles:selectedFiles |
5668 |
! |
|
5669 |
||
5670 |
cvsCommitFiles:files |
|
5671 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
5672 |
||
5673 |
nFiles := files size. |
|
5674 |
nFiles == 0 ifTrue:[^ self]. |
|
5675 |
||
5676 |
nFiles == 1 ifTrue:[ |
|
5677 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 5678 |
] ifFalse:[ |
12777 | 5679 |
nFiles > 1 ifTrue:[ |
5680 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 5681 |
] ifFalse:[ |
6627 | 5682 |
msg := resources string:'Enter log message for checkIn' |
4414 | 5683 |
] |
3892 | 5684 |
]. |
5685 |
||
5686 |
log := Dialog |
|
4414 | 5687 |
requestText:msg |
5688 |
lines:10 |
|
5689 |
columns:70 |
|
5690 |
initialAnswer:nil. |
|
3892 | 5691 |
|
4663 | 5692 |
log isNil ifTrue:[^ self]. |
12777 | 5693 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5694 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5695 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 5696 |
"/ save the log message into another tempFile ... |
13121 | 5697 |
s := FileStream newTemporary. |
5698 |
logTmp := s fileName. |
|
12777 | 5699 |
s nextPutAll:log. |
5700 |
s close. |
|
5701 |
||
5702 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5703 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5704 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5705 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5706 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5707 |
executionBlock := [:stream | |
12777 | 5708 |
[ |
5709 |
files do:[:fn | |
|
5710 |
| dir nameArg cmd | |
|
5711 |
||
5712 |
nameArg := '"',fn baseName,'"'. |
|
5713 |
dir := fn directory. |
|
5714 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
5715 |
stream showCR:fn pathName. |
|
5716 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 5717 |
] |
12777 | 5718 |
] ensure:[ |
5719 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
5720 |
]. |
|
4107 | 5721 |
]. |
5722 |
nameString := 'Command> cvs commit'. |
|
5723 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 5724 |
! |
5725 |
||
14527 | 5726 |
cvsCommitFolder |
5727 |
|dir log logTmp s logArg msg executionBlock nameString | |
|
5728 |
||
5729 |
(dir := self currentDirectory) isNil ifTrue:[ ^ self ]. |
|
5730 |
||
5731 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(dir baseName). |
|
5732 |
log := Dialog |
|
5733 |
requestText:msg |
|
5734 |
lines:10 |
|
5735 |
columns:70 |
|
5736 |
initialAnswer:nil. |
|
5737 |
||
5738 |
log isNil ifTrue:[^ self]. |
|
5739 |
log := log replChar:$" withString:'\"'. |
|
5740 |
||
5741 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5742 |
"/ save the log message into another tempFile ... |
|
5743 |
s := FileStream newTemporary. |
|
5744 |
logTmp := s fileName. |
|
5745 |
s nextPutAll:log. |
|
5746 |
s close. |
|
5747 |
||
5748 |
logArg := '-F "', logTmp pathName, '"'. |
|
5749 |
] ifFalse:[ |
|
5750 |
logArg := '-m ''' , log , ''''. |
|
5751 |
]. |
|
5752 |
||
5753 |
executionBlock := [:stream | |
|
5754 |
[ |
|
5755 |
|cmd| |
|
5756 |
||
5757 |
cmd := 'cvs commit ',logArg. |
|
5758 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5759 |
] ensure:[ |
|
5760 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
5761 |
]. |
|
5762 |
]. |
|
5763 |
||
5764 |
nameString := 'Command> cvs commit'. |
|
5765 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5766 |
! |
|
5767 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5768 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5769 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5770 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5771 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5772 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5773 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5774 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5775 |
out := WriteStream on:(String new:100). |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5776 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5777 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5778 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5779 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5780 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5781 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5782 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5783 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5784 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5785 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5786 |
|
3892 | 5787 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
5788 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
5789 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5790 |
|toRemove updateRunning executionBlock nameString| |
3892 | 5791 |
|
5792 |
updateRunning := self backgroundProcesses value notEmpty. |
|
5793 |
self killAllRunningBackgroundProcesses. |
|
5794 |
toRemove := OrderedCollection new. |
|
5795 |
||
12493 | 5796 |
executionBlock := |
5797 |
[:stream | |
|
5798 |
|cmd logArg prevDir prevFiles| |
|
5799 |
||
5800 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5801 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
5802 |
] ifFalse:[ |
|
5803 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
5804 |
]. |
|
5805 |
prevFiles := ''. |
|
5806 |
||
5807 |
filesToRemove do:[:fileName | |
|
5808 |
|dir file| |
|
5809 |
||
5810 |
dir := fileName directory. |
|
5811 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
5812 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
5813 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5814 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5815 |
prevFiles := ''. |
|
4414 | 5816 |
]. |
12493 | 5817 |
|
5818 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5819 |
"was not able to remove it" |
|
5820 |
| lastError msg | |
|
5821 |
lastError := OperatingSystem lastErrorString. |
|
5822 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5823 |
lastError isNil ifFalse:[ |
|
5824 |
msg := msg , '\\(' , lastError , ')' |
|
5825 |
]. |
|
5826 |
Dialog warn:msg withCRs |
|
5827 |
] do:[ |
|
5828 |
(fileName isSymbolicLink) ifFalse:[ |
|
5829 |
fileName remove. |
|
5830 |
file := fileName baseName. |
|
5831 |
cmd := ('cvs remove -f "',file,'"'). |
|
5832 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5833 |
"/ Transcript show:dir; space; showCR:cmd. |
|
5834 |
] |
|
5835 |
]. |
|
5836 |
prevDir := dir. |
|
5837 |
prevFiles := prevFiles,' ',file. |
|
4414 | 5838 |
]. |
12493 | 5839 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
5840 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5841 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5842 |
]. |
|
4107 | 5843 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 5844 |
filesToRemove size > 1 ifTrue:[ |
4414 | 5845 |
nameString := nameString, ' ...'. |
3892 | 5846 |
]. |
5847 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5848 |
! |
|
5849 |
||
5850 |
cvsRemoveFileAndCVSContainer |
|
12493 | 5851 |
|files| |
5852 |
||
5853 |
files := self currentSelectedFiles copy. |
|
5854 |
self removeFilesAndCVSContainers:files |
|
3892 | 5855 |
! |
5856 |
||
9338 | 5857 |
cvsRevisionLog |
5858 |
| cmd sel executionBlock nameString| |
|
5859 |
||
5860 |
sel := self currentSelectedObjects. |
|
5861 |
sel isEmpty ifTrue:[ ^ self ]. |
|
5862 |
||
5863 |
executionBlock := [:stream | |
|
5864 |
sel do:[:fn | |
|
5865 |
| dir nameArg | |
|
5866 |
||
5867 |
nameArg := '"',fn baseName,'"'. |
|
5868 |
dir := fn directory. |
|
5869 |
cmd := 'cvs log ' , nameArg. |
|
5870 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5871 |
] |
|
5872 |
]. |
|
5873 |
nameString := 'Command> cvs log'. |
|
5874 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5875 |
! |
|
5876 |
||
8562 | 5877 |
cvsTagSelection |
12856 | 5878 |
|tag tags cmd| |
5879 |
||
5880 |
tag := Dialog |
|
5881 |
request:(resources string:'Tag (possibly multiple, separated by ";"):') |
|
5882 |
initialAnswer:(CVSSourceCodeManager recentTag). |
|
5883 |
tag isEmptyOrNil ifTrue:[^ self ]. |
|
5884 |
||
5885 |
CVSSourceCodeManager recentTag:tag. |
|
8562 | 5886 |
|
5887 |
CVSSourceCodeManager notNil ifTrue:[ |
|
5888 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
5889 |
] ifFalse:[ |
|
5890 |
cmd := 'cvs'. |
|
5891 |
]. |
|
5892 |
||
12856 | 5893 |
tags := tag asCollectionOfSubstringsSeparatedByAny:',;'. |
5894 |
tags do:[:eachTag | |
|
5895 |
self executeCommand:('%1 tag -F "%2" %3' |
|
5896 |
bindWith:cmd |
|
12858 | 5897 |
with:(eachTag withoutSeparators) |
12856 | 5898 |
with:(self makeFileNameArgumentString)) |
5899 |
]. |
|
8562 | 5900 |
! |
5901 |
||
3892 | 5902 |
cvsUpdateAll |
5903 |
| cmd | |
|
5904 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5905 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5906 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5907 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5908 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5909 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5910 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5911 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 5912 |
! |
5913 |
||
5914 |
cvsUpdateAllRecursive |
|
5915 |
| cmd | |
|
5916 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5917 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5918 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5919 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5920 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5921 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5922 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 5923 |
! |
5924 |
||
5925 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5926 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5927 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5928 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5929 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5930 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5931 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5932 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5933 |
|
3892 | 5934 |
stream := WriteStream on:''. |
8563 | 5935 |
stream |
5936 |
nextPutAll:cmd; |
|
5937 |
nextPutAll:' upd '; |
|
5938 |
nextPutAll:(self makeFileNameArgumentString). |
|
5939 |
||
5940 |
self executeCommand:stream contents. |
|
5941 |
! |
|
5942 |
||
5943 |
makeFileNameArgumentString |
|
5944 |
|stream| |
|
5945 |
||
5946 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5947 |
self currentSelectedFiles do:[: file | |
8563 | 5948 |
stream nextPut:$". |
4414 | 5949 |
stream nextPutAll:file baseName. |
8563 | 5950 |
stream nextPutAll:'" '. |
5951 |
]. |
|
5952 |
^ stream contents. |
|
12493 | 5953 |
! |
5954 |
||
5955 |
removeFilesAndCVSContainers:files |
|
5956 |
|numFiles question aswer| |
|
5957 |
||
5958 |
(numFiles := files size) > 0 ifTrue:[ |
|
5959 |
numFiles > 1 ifTrue:[ |
|
5960 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
5961 |
] ifFalse:[ |
|
5962 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
5963 |
]. |
|
5964 |
||
5965 |
aswer := Dialog |
|
5966 |
confirm:question withCRs |
|
5967 |
yesLabel:(resources string:'Remove') |
|
5968 |
noLabel:(resources string:'Cancel'). |
|
5969 |
||
5970 |
aswer ifTrue:[ |
|
5971 |
self withActivityIndicationDo:[ |
|
5972 |
self cvsRemoveAndRemoveFromCVS:files |
|
5973 |
] |
|
5974 |
] |
|
5975 |
] |
|
3892 | 5976 |
! ! |
5977 |
||
14126 | 5978 |
|
11139 | 5979 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
5980 |
||
5981 |
mercurialAdd |
|
5982 |
|executionBlock sel maxCmdSize| |
|
5983 |
||
5984 |
maxCmdSize := 512. |
|
5985 |
||
5986 |
sel := self currentSelectedObjects. |
|
5987 |
sel isEmptyOrNil ifTrue:[ |
|
5988 |
^ self |
|
5989 |
]. |
|
5990 |
||
5991 |
executionBlock := |
|
5992 |
[:stream | |
|
5993 |
|prevDir cmd| |
|
5994 |
||
5995 |
prevDir := nil. |
|
5996 |
sel do:[:fn | |
|
5997 |
|nameArg dir| |
|
5998 |
||
5999 |
nameArg := '"',fn baseName,'"'. |
|
6000 |
dir := fn directory. |
|
6001 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6002 |
"/ flush |
|
6003 |
cmd notNil ifTrue:[ |
|
6004 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6005 |
cmd := nil. |
|
6006 |
] |
|
6007 |
]. |
|
6008 |
cmd isNil ifTrue:[ |
|
6009 |
cmd := 'hg add'. |
|
6010 |
]. |
|
6011 |
cmd := cmd,' ',nameArg. |
|
6012 |
prevDir := dir. |
|
6013 |
]. |
|
6014 |
cmd notNil ifTrue:[ |
|
6015 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6016 |
cmd := nil. |
|
6017 |
]. |
|
6018 |
stream nextPutLine:'Commit to finish the transaction'. |
|
6019 |
]. |
|
6020 |
||
6021 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
6022 |
||
6023 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
6024 |
! |
|
6025 |
||
6026 |
mercurialCommit |
|
6027 |
|dir executionBlock| |
|
6028 |
||
6029 |
"/ dir := self currentDirectory. |
|
6030 |
dir := self directoryContentsBrowser directory. |
|
6031 |
executionBlock := |
|
6032 |
[:stream | |
|
6033 |
(self getExecutionBlockForCommand:'hg commit' |
|
6034 |
inDirectory:dir) value:stream. |
|
6035 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 6036 |
]. |
11139 | 6037 |
|
6038 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
6039 |
||
6040 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
6041 |
! |
|
6042 |
||
11144 | 6043 |
mercurialInit |
6044 |
|dir executionBlock| |
|
6045 |
||
6046 |
dir := self directoryContentsBrowser directory. |
|
6047 |
||
6048 |
(Dialog confirm:(resources |
|
6049 |
string:'Initialize new Mercurial Repository in %1?' |
|
6050 |
with:dir baseName)) ifFalse:[^ self]. |
|
6051 |
||
6052 |
executionBlock := |
|
6053 |
[:stream | |
|
6054 |
(self getExecutionBlockForCommand:('hg init') |
|
6055 |
inDirectory:dir) value:stream. |
|
6056 |
]. |
|
6057 |
||
6058 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
6059 |
||
6060 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
6061 |
! |
|
6062 |
||
11139 | 6063 |
mercurialPush |
6064 |
|destination dir executionBlock| |
|
6065 |
||
6066 |
destination := Dialog request:'Mercurial Repository' |
|
6067 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
6068 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
6069 |
||
6070 |
LastMercurialRepository := destination. |
|
6071 |
||
6072 |
dir := self directoryContentsBrowser directory. |
|
6073 |
executionBlock := |
|
6074 |
[:stream | |
|
6075 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
6076 |
inDirectory:dir) value:stream. |
|
6077 |
]. |
|
6078 |
||
6079 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
6080 |
||
6081 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
6082 |
! |
|
6083 |
||
6084 |
mercurialStatus |
|
6085 |
|executionBlock sel maxCmdSize| |
|
6086 |
||
6087 |
maxCmdSize := 512. |
|
6088 |
||
6089 |
sel := self currentSelectedObjects. |
|
6090 |
sel isEmptyOrNil ifTrue:[ |
|
6091 |
^ self |
|
6092 |
]. |
|
6093 |
||
6094 |
executionBlock := |
|
6095 |
[:stream | |
|
6096 |
|prevDir cmd| |
|
6097 |
||
6098 |
prevDir := nil. |
|
6099 |
sel do:[:fn | |
|
6100 |
|nameArg dir| |
|
6101 |
||
6102 |
nameArg := '"',fn baseName,'"'. |
|
6103 |
dir := fn directory. |
|
6104 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
6105 |
"/ flush |
|
6106 |
cmd notNil ifTrue:[ |
|
6107 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6108 |
cmd := nil. |
|
6109 |
] |
|
6110 |
]. |
|
6111 |
cmd isNil ifTrue:[ |
|
6112 |
cmd := 'hg status'. |
|
6113 |
]. |
|
6114 |
cmd := cmd,' ',nameArg. |
|
6115 |
prevDir := dir. |
|
6116 |
]. |
|
6117 |
cmd notNil ifTrue:[ |
|
6118 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
6119 |
cmd := nil. |
|
6120 |
]. |
|
6121 |
]. |
|
6122 |
||
6123 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
6124 |
||
6125 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 6126 |
! ! |
6127 |
||
4849 | 6128 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 6129 |
|
8510 | 6130 |
allFilesInSelectedDirectoriesForWhich:aBlock |
6131 |
|directories allFiles| |
|
6132 |
||
6133 |
directories := self currentSelectedDirectories. |
|
6134 |
directories isEmpty ifTrue:[^ self]. |
|
6135 |
||
6136 |
allFiles := OrderedCollection new. |
|
6137 |
directories do:[:dir| |
|
6138 |
[ |
|
6139 |
|fileNames| |
|
6140 |
||
6141 |
fileNames := dir directoryContents. |
|
6142 |
fileNames notNil ifTrue:[ |
|
6143 |
fileNames := fileNames |
|
6144 |
collect:[:fn | dir construct:fn] |
|
6145 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
6146 |
allFiles addAll:fileNames. |
|
6147 |
] |
|
6148 |
] on:FileStream openErrorSignal do:[:ex| |
|
6149 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
6150 |
with:ex pathName |
|
6151 |
with:ex description). |
|
6152 |
ex proceedWith:nil. |
|
6153 |
]. |
|
6154 |
]. |
|
6155 |
||
6156 |
^ allFiles |
|
6157 |
! |
|
6158 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6159 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6160 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6161 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6162 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6163 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6164 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6165 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6166 |
"/ 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
|
6167 |
"/ 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
|
6168 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6169 |
conv := OrderedCollection new. |
4722 | 6170 |
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
|
6171 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6172 |
outSuffix = 'png' ifTrue:[ |
4722 | 6173 |
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
|
6174 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6175 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6176 |
outSuffix = 'gif' ifTrue:[ |
4722 | 6177 |
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
|
6178 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6179 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6180 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 6181 |
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
|
6182 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6183 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6184 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 6185 |
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
|
6186 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6187 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6188 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6189 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6190 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6191 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6192 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6193 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6194 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6195 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6196 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6197 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6198 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6199 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6200 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6201 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6202 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6203 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6204 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6205 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6206 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6207 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6208 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6209 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6210 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6211 |
|
4367 | 6212 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6213 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6214 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6215 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6216 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6217 |
self convertImageToSuffix:'jpg' |
4531 | 6218 |
! |
6219 |
||
6220 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6221 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6222 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6223 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6224 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6225 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6226 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6227 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6228 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6229 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6230 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6231 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6232 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6233 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6234 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6235 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6236 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6237 |
outFile exists ifTrue:[ |
4722 | 6238 |
|answer| |
6239 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6240 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6241 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6242 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6243 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6244 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6245 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6246 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6247 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6248 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6249 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6250 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6251 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6252 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6253 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6254 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6255 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6256 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6257 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6258 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6259 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6260 |
self updateAndSelect:nil. |
4367 | 6261 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6262 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6263 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6264 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6265 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6266 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6267 |
"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
|
6268 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6269 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6270 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6271 |
self convertImageToSuffix:'xpm' |
4367 | 6272 |
! |
6273 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6274 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
13121 | 6275 |
|inFile outFile chainOfConversions conversionStream |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6276 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6277 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6278 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6279 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6280 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6281 |
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
|
6282 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6283 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6284 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6285 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6286 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6287 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6288 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6289 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6290 |
eachConversionCommand == #readToXPM ifTrue:[ |
13121 | 6291 |
|image tempStreamXPM| |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6292 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6293 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6294 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6295 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6296 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6297 |
]. |
13121 | 6298 |
tempStreamXPM := FileStream newTemporaryWithSuffix:'xpm'. |
6299 |
XPMReader save:image onStream:tempStreamXPM. |
|
6300 |
tempStreamXPM close. |
|
6301 |
inFile := tempStreamXPM fileName. |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6302 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6303 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6304 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6305 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6306 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6307 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6308 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6309 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6310 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6311 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6312 |
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
|
6313 |
|
13121 | 6314 |
outFile := (FileStream newTemporaryWithSuffix:eachConversionSuffix) close pathName. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6315 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6316 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6317 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6318 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6319 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6320 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6321 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6322 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6323 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6324 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6325 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6326 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6327 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6328 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6329 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6330 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6331 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6332 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6333 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6334 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6335 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6336 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6337 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6338 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6339 |
] ifCurtailed:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6340 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6341 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6342 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6343 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6344 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6345 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6346 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6347 |
|
3892 | 6348 |
createProjectAndOpenProjectBrowser |
6349 |
|nm f s directory| |
|
6350 |
||
6351 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6352 |
directory := self currentDirectory. |
3892 | 6353 |
nm := directory baseName. |
6354 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6355 |
f exists ifTrue:[ |
|
4414 | 6356 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6357 |
^ self. |
|
3892 | 6358 |
]. |
6359 |
s := f writeStream. |
|
6360 |
s nextPutAll:' |
|
6361 |
name ''' , nm , ''' |
|
6362 |
type #classLibrary |
|
6363 |
package #''private:' , nm , ''' |
|
6364 |
prerequisites nil |
|
6365 |
||
6366 |
classes #( ) |
|
6367 |
'. |
|
6368 |
s close. |
|
6369 |
ProjectBrowser openOnFile:f. |
|
6370 |
! |
|
6371 |
||
5880 | 6372 |
doExecuteCommand |
6373 |
"execute an OperatingSystem-command" |
|
6374 |
||
6375 |
| action fileName| |
|
6376 |
||
6377 |
fileName := self firstSelectedFile. |
|
6378 |
action := [:command | |
|
6379 |
self addToCommandHistory:command for:fileName. |
|
6380 |
self executeCommand:command. |
|
6381 |
]. |
|
6382 |
self askForCommandFor:fileName thenDo:action |
|
6383 |
! |
|
6384 |
||
6385 |
doExecuteScript |
|
6386 |
"execute a smalltalk script" |
|
6387 |
||
6388 |
|textHolder dialog template dummyClass dummyInstance| |
|
6389 |
||
6390 |
template := |
|
6391 |
'"/ Smalltalk script: |
|
6392 |
||
6393 |
"/ the following variables are accessable: |
|
6394 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
6395 |
"/ selectedFiles (= ...) |
|
6396 |
"/ |
|
6397 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6398 |
"/ |
|
6399 |
"/ Useful operations are: |
|
6400 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6401 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6402 |
"/ directory directory |
|
6403 |
"/ |
|
6404 |
"/ example: move all files which match a aarticular pattern to |
|
6405 |
"/ a separate directory: |
|
6406 |
"/ |
|
6407 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6408 |
"/ |
|
6409 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6410 |
"/ |
|
6411 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6412 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6413 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6414 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6415 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6416 |
"/ newDir := directory construct:prefix. |
|
6417 |
"/ newDir exists ifFalse:[ |
|
6418 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6419 |
"/ newDir makeDirectory. |
|
6420 |
"/ ]. |
|
6421 |
"/ ]. |
|
6422 |
"/ newDir exists ifTrue:[ |
|
6423 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6424 |
"/ newFile := newDir construct:rest. |
|
6425 |
"/ oldFile moveTo:newFile |
|
6426 |
"/ ] |
|
6427 |
"/ ] |
|
6428 |
"/ ] |
|
6429 |
'. |
|
6430 |
||
6431 |
LastScriptBlockString isNil ifTrue:[ |
|
6432 |
LastScriptBlockString := template. |
|
6433 |
]. |
|
6434 |
||
6435 |
textHolder := ValueHolder new. |
|
6436 |
dialog := Dialog |
|
6437 |
forRequestText:(resources string:'Enter script') |
|
6438 |
editViewClass:CodeView |
|
6439 |
lines:25 |
|
6440 |
columns:70 |
|
6441 |
initialAnswer:LastScriptBlockString |
|
6442 |
model:textHolder. |
|
6443 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6444 |
dialog open. |
|
6445 |
dialog accepted ifFalse:[^ self]. |
|
6446 |
||
6447 |
LastScriptBlockString := textHolder value. |
|
6448 |
||
6449 |
Class classConventionViolationConfirmationQuerySignal |
|
6450 |
answer:true |
|
6451 |
do:[ |
|
6452 |
dummyClass := Object class |
|
6453 |
name:#Dummy |
|
6454 |
inEnvironment:nil |
|
6455 |
subclassOf:Object |
|
6456 |
instanceVariableNames:'directory selectedFiles' |
|
6457 |
variable:false |
|
6458 |
words:true |
|
6459 |
pointers:true |
|
6460 |
classVariableNames:'' |
|
6461 |
poolDictionaries:'' |
|
6462 |
category:#dummyCategory |
|
6463 |
comment:nil |
|
6464 |
changed:true. |
|
6465 |
]. |
|
6466 |
||
6467 |
dummyInstance := dummyClass basicNew. |
|
6468 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6469 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6470 |
||
6471 |
Compiler |
|
6472 |
evaluate:textHolder value |
|
6473 |
in:nil |
|
6474 |
receiver:dummyInstance |
|
6475 |
notifying:nil |
|
6476 |
logged:false |
|
6477 |
ifFail:[] |
|
6478 |
compile:true. |
|
6479 |
||
6480 |
"/ fileName := self firstSelectedFile. |
|
6481 |
"/ action := [:command | |
|
6482 |
"/ self addToCommandHistory:command for:fileName. |
|
6483 |
"/ self executeCommand:command. |
|
6484 |
"/ ]. |
|
6485 |
"/ self askForCommandFor:fileName thenDo:action |
|
6486 |
! |
|
6487 |
||
4230 | 6488 |
doMake |
7938 | 6489 |
|dir cmd| |
4230 | 6490 |
|
13856 | 6491 |
cmd := self makeCommandHolder value. |
6492 |
||
6493 |
"Make" |
|
6494 |
cmd = 'make' ifTrue:[ |
|
6495 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6496 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
6497 |
dir notNil ifTrue:[ |
|
6498 |
(dir construct:'bmake.bat') exists ifTrue:[ |
|
6499 |
cmd := 'bmake.bat'. |
|
6500 |
] |
|
7938 | 6501 |
] |
13856 | 6502 |
]. |
6503 |
self executeCommand:cmd. |
|
6504 |
^self. |
|
6505 |
]. |
|
6506 |
||
6507 |
"Apache ant" |
|
6508 |
cmd = 'ant' ifTrue:[ |
|
6509 |
self executeCommand:cmd. |
|
6510 |
^self. |
|
6511 |
]. |
|
6512 |
||
6513 |
"Add more here..." |
|
6514 |
||
6515 |
"Modified (comment): / 13-04-2012 / 17:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4230 | 6516 |
! |
6517 |
||
8256 | 6518 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6519 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6520 |
(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
|
6521 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6522 |
|
8256 | 6523 |
|destDir| |
6524 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6525 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6526 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6527 |
]. |
8256 | 6528 |
destDir := self currentDirectory. |
6529 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6530 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6531 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6532 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6533 |
! |
6534 |
||
7829 | 6535 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6536 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6537 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6538 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 6539 |
! |
6540 |
||
12473 | 6541 |
doOpenFinder |
6542 |
self currentDirectory asFilename openFinder |
|
6543 |
||
6544 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
6545 |
! |
|
6546 |
||
12811 | 6547 |
doOpenMonticelloBrowser |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6548 |
MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello']. |
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6549 |
|
12811 | 6550 |
self withWaitCursorDo:[ |
6551 |
self currentSelectedFiles do:[:fn | |
|
6552 |
|version snapshot| |
|
6553 |
||
6554 |
fn suffix asLowercase = 'mcz' ifTrue:[ |
|
6555 |
version := MCMczReader versionFromFile:fn. |
|
6556 |
snapshot := version snapshot. |
|
6557 |
(Tools::ChangeSetBrowser2 |
|
6558 |
on: snapshot asChangeSet |
|
6559 |
label: version info name) |
|
6560 |
beTwoColumn; |
|
6561 |
targetNamespace:nil; |
|
6562 |
targetPackage:nil; |
|
6563 |
open |
|
6564 |
] |
|
6565 |
] |
|
6566 |
] |
|
6567 |
! |
|
6568 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6569 |
doOpenSettings |
8168 | 6570 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6571 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6572 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6573 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6574 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6575 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6576 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6577 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6578 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6579 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6580 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6581 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6582 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6583 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6584 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6585 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6586 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6587 |
|
7104 | 6588 |
editMode:aSymbol |
6589 |
self |
|
6590 |
applicationNamed:#FileApplicationNoteBook |
|
6591 |
ifPresentDo:[:appl | |
|
6592 |
|subApp| |
|
6593 |
||
6594 |
subApp := appl selectedApplication. |
|
6595 |
subApp notNil ifTrue:[ |
|
6596 |
^ subApp perform:aSymbol |
|
6597 |
] |
|
6598 |
]. |
|
6599 |
||
6600 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
6601 |
! |
|
6602 |
||
6603 |
editModeInsert |
|
6604 |
self editMode:#editModeInsert |
|
6605 |
||
6606 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
6607 |
! |
|
6608 |
||
6609 |
editModeInsertAndSelect |
|
6610 |
self editMode:#editModeInsertAndSelect |
|
6611 |
||
6612 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
6613 |
! |
|
6614 |
||
6615 |
editModeOverwrite |
|
6616 |
self editMode:#editModeOverwrite |
|
6617 |
||
6618 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
6619 |
! |
|
6620 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6621 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6622 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6623 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6624 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6625 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6626 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6627 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
11889 | 6628 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6629 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6630 |
]. |
11889 | 6631 |
(Dialog confirm:(resources string:'File is big - proceed ?')) ifFalse:[^ self]. |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6632 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6633 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6634 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6635 |
|
3892 | 6636 |
fileFileIn |
6637 |
"fileIn the selected file(s)" |
|
6638 |
||
6639 |
self fileFileInLazy:false |
|
6640 |
! |
|
6641 |
||
7324 | 6642 |
fileFileIn:aFilename lazy:lazy |
6643 |
"fileIn a file" |
|
6644 |
||
6645 |
self withActivityIndicationDo:[ |
|
6646 |
self notify:('File in:', aFilename asFilename baseName). |
|
6647 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6648 |
self notify:nil. |
|
6649 |
] |
|
6650 |
||
6651 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
6652 |
! |
|
6653 |
||
3892 | 6654 |
fileFileInLazy |
6655 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
6656 |
||
6657 |
self fileFileInLazy:true |
|
6658 |
! |
|
6659 |
||
6660 |
fileFileInLazy:lazy |
|
6661 |
"fileIn the selected file(s)" |
|
6662 |
||
7324 | 6663 |
self currentSelectedFiles do:[:fileName | |
6664 |
self fileIn:fileName lazy:lazy |
|
6665 |
]. |
|
6666 |
||
6667 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 6668 |
! |
6669 |
||
12497 | 6670 |
fileFileInPackage |
6671 |
"assuming the current directory is a package directory, load it" |
|
6672 |
||
6673 |
|packageDir dir path top packageID| |
|
6674 |
||
6675 |
"/ find a reasonable package-id (walk up until we find stx) |
|
6676 |
path := ''. |
|
6677 |
dir := packageDir := self currentDirectory. |
|
6678 |
||
6679 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
6680 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
6681 |
path := dir baseName , '/' , path. |
|
6682 |
dir := dir directory. |
|
6683 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6684 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 6685 |
"/ should ask the user for a packageID and proceed... |
6686 |
^ self. |
|
6687 |
]. |
|
6688 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6689 |
packageID := path copyButLast:1. |
12497 | 6690 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
6691 |
! |
|
6692 |
||
3892 | 6693 |
fileFileInToNameSpace |
6694 |
"fileIn the selected file(s)<into a nameSpace" |
|
6695 |
||
6696 |
|ns listOfKnownNameSpaces| |
|
6697 |
||
6698 |
listOfKnownNameSpaces := Set new. |
|
6699 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
6700 |
allNameSpaces |
4414 | 6701 |
do:[:eachNameSpace | |
6702 |
listOfKnownNameSpaces add:eachNameSpace name |
|
6703 |
]. |
|
3892 | 6704 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
6705 |
||
6706 |
ns := Dialog |
|
4414 | 6707 |
request:'During fileIn, new classes are created in nameSpace:' |
6708 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
6709 |
list:listOfKnownNameSpaces. |
|
3892 | 6710 |
ns isEmptyOrNil ifTrue:[^ self]. |
6711 |
||
6712 |
LastEnforcedNameSpace := ns. |
|
6713 |
ns := NameSpace name:ns. |
|
6714 |
||
6715 |
Class nameSpaceQuerySignal |
|
4414 | 6716 |
answer:ns |
6717 |
do:[ |
|
6718 |
self fileFileInLazy:false |
|
6719 |
] |
|
3892 | 6720 |
! |
6721 |
||
6722 |
fileFindAllDuplicates |
|
6723 |
"scan directory and all subdirs for duplicate files" |
|
6724 |
||
6725 |
|fileNames dir infoDir filesBySize |
|
6726 |
result info dirPrefix myName stream textBox maxLength directories| |
|
6727 |
||
6728 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6729 |
self withActivityIndicationDo:[ |
4414 | 6730 |
result := Dictionary new. |
6731 |
myName := self class name asString. |
|
6732 |
directories := self currentSelectedDirectories. |
|
6733 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 6734 |
|
4414 | 6735 |
dir := directories first. |
3892 | 6736 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6737 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6738 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6739 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 6740 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
6741 |
with:ex pathName |
|
6742 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6743 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6744 |
]. |
4765 | 6745 |
fileNames := fileNames |
6746 |
collect:[:fn | dir construct:fn] |
|
6747 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 6748 |
|
6749 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 6750 |
infoDir := Dictionary new. |
6751 |
fileNames do:[:fn | |
|
6752 |
infoDir at:fn put:(fn fileSize) |
|
6753 |
]. |
|
6754 |
||
14497 | 6755 |
"/ for each, get the file's size. |
4414 | 6756 |
"/ in a first pass, look for files of the same size and |
6757 |
"/ compare them ... |
|
3892 | 6758 |
|
6759 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 6760 |
filesBySize := Dictionary new. |
6761 |
infoDir keysAndValuesDo:[:fn :sz | |
|
6762 |
|entry| |
|
6763 |
||
6764 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6765 |
entry add:fn. |
|
6766 |
]. |
|
6767 |
||
6768 |
"/ any of same size ? |
|
3892 | 6769 |
|
6770 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 6771 |
filesBySize do:[:entry | |
6772 |
|files| |
|
6773 |
||
6774 |
entry size > 1 ifTrue:[ |
|
6775 |
files := entry asArray. |
|
6776 |
1 to:files size-1 do:[:idx1 | |
|
6777 |
idx1+1 to:files size do:[:idx2 | |
|
6778 |
|fn1 fn2| |
|
6779 |
||
6780 |
fn1 := files at:idx1. |
|
6781 |
fn2 := files at:idx2. |
|
3892 | 6782 |
|
6783 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 6784 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
6785 |
"/ compare the files |
|
6786 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6787 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 6788 |
result at:fn1 put:fn2. |
6789 |
] |
|
6790 |
] |
|
6791 |
] |
|
6792 |
] |
|
6793 |
] |
|
6794 |
]. |
|
3892 | 6795 |
|
6796 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 6797 |
dirPrefix := dir pathName. |
6798 |
result := result associations. |
|
6799 |
result := result collect:[:assoc | |
|
6800 |
|f1 f2| |
|
6801 |
||
6802 |
f1 := assoc key name. |
|
6803 |
f2 := assoc value name. |
|
6804 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
6805 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
6806 |
]. |
|
6807 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
6808 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
6809 |
]. |
|
6810 |
f1 < f2 ifTrue:[ |
|
6811 |
f2 -> f1 |
|
6812 |
] ifFalse:[ |
|
6813 |
f1 -> f2 |
|
6814 |
] |
|
6815 |
]. |
|
6816 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
6817 |
||
6818 |
info := OrderedCollection new. |
|
6819 |
result do:[:assoc | |
|
6820 |
info add:(assoc key , ' same as ' , assoc value) |
|
6821 |
]. |
|
6822 |
info isEmpty ifTrue:[ |
|
11889 | 6823 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 6824 |
^ self. |
4414 | 6825 |
]. |
3892 | 6826 |
]. |
6827 |
||
6828 |
stream := WriteStream on:''. |
|
11688 | 6829 |
stream nextPutAllLines:info. |
5542 | 6830 |
|
3892 | 6831 |
textBox := TextBox new. |
6832 |
textBox initialText:(stream contents). |
|
5542 | 6833 |
stream close. |
11889 | 6834 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 6835 |
textBox readOnly:true. |
6836 |
textBox noCancel. |
|
11889 | 6837 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 6838 |
maxLength := 10. |
6839 |
info do:[: el | |
|
4414 | 6840 |
maxLength := maxLength max:(el size). |
3892 | 6841 |
]. |
6842 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 6843 |
textBox maxExtent:Screen current extent. |
6844 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6845 |
|
11688 | 6846 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 6847 |
! |
6848 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6849 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6850 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6851 |
|
10306 | 6852 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6853 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6854 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6855 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6856 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6857 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6858 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6859 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6860 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6861 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6862 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6863 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6864 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6865 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6866 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6867 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6868 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6869 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6870 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6871 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6872 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6873 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6874 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6875 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6876 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6877 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6878 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6879 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6880 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6881 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6882 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6883 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6884 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6885 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6886 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6887 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6888 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6889 |
stream := WriteStream on:''. |
10306 | 6890 |
stream nextPutLine:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6891 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6892 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6893 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6894 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6895 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6896 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6897 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6898 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6899 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6900 |
]. |
10306 | 6901 |
stream nextPutLine:'Files without duplicates:'. |
6902 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6903 |
do:[:origFile | |
|
6904 |
|sameFiles| |
|
6905 |
||
6906 |
sameFiles := samePerFile at:origFile. |
|
6907 |
sameFiles isEmpty ifTrue:[ |
|
6908 |
stream nextPutLine:origFile baseName. |
|
6909 |
]. |
|
6910 |
]. |
|
6911 |
||
6912 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
6913 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
6914 |
LastMustMatchPattern := mustHaveMatches. |
|
6915 |
||
6916 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
6917 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6918 |
do:[:origFile | |
|
6919 |
|sameFiles| |
|
6920 |
||
6921 |
sameFiles := samePerFile at:origFile. |
|
6922 |
sameFiles notEmpty ifTrue:[ |
|
6923 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
6924 |
stream nextPutLine:origFile baseName. |
|
6925 |
] |
|
6926 |
]. |
|
6927 |
]. |
|
6928 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6929 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6930 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6931 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6932 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6933 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6934 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6935 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6936 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6937 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6938 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6939 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6940 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6941 |
|
3892 | 6942 |
fileFindDuplicates |
6943 |
"scan directory for duplicate files" |
|
6944 |
||
8510 | 6945 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
6946 |
||
6947 |
directories := self currentSelectedDirectories. |
|
3892 | 6948 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6949 |
self withActivityIndicationDo:[ |
4355 | 6950 |
result := Dictionary new. |
6951 |
||
6952 |
directories := self currentSelectedDirectories. |
|
6953 |
directories isEmpty ifTrue:[^ self]. |
|
6954 |
||
8510 | 6955 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 6956 |
|
6957 |
infoDir := Dictionary new. |
|
6958 |
allFiles do:[:fn | |
|
6959 |
infoDir at:fn put:(fn info) |
|
6960 |
]. |
|
6961 |
||
14497 | 6962 |
"/ for each, get the file's size. |
4355 | 6963 |
"/ in a first pass, look for files of the same size and |
6964 |
"/ compare them ... |
|
6965 |
||
6966 |
filesBySize := Dictionary new. |
|
6967 |
infoDir keysAndValuesDo:[:fn :info | |
|
6968 |
|sz entry| |
|
6969 |
||
6970 |
sz := info size. |
|
6971 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6972 |
entry add:fn. |
|
6973 |
]. |
|
6974 |
||
6975 |
"/ any of same size ? |
|
6976 |
||
6977 |
filesBySize do:[:entry | |
|
6978 |
|files| |
|
6979 |
||
6980 |
entry size > 1 ifTrue:[ |
|
6981 |
files := entry asArray. |
|
6982 |
1 to:files size-1 do:[:idx1 | |
|
6983 |
idx1+1 to:files size do:[:idx2 | |
|
6984 |
|fn1 fn2| |
|
6985 |
||
6986 |
fn1 := files at:idx1. |
|
6987 |
fn2 := files at:idx2. |
|
6988 |
||
6989 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
6990 |
"/ compare the files |
|
6991 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6992 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 6993 |
result at:fn1 put:fn2. |
6994 |
] |
|
6995 |
] |
|
6996 |
] |
|
6997 |
] |
|
6998 |
] |
|
6999 |
]. |
|
7000 |
||
7001 |
result := result associations. |
|
7002 |
result := result collect:[:assoc | |
|
7003 |
|f1 f2| |
|
7004 |
||
7005 |
f1 := assoc key asString. |
|
7006 |
f2 := assoc value asString. |
|
7007 |
f1 < f2 ifTrue:[ |
|
7008 |
f2 -> f1 |
|
7009 |
] ifFalse:[ |
|
7010 |
f1 -> f2 |
|
7011 |
] |
|
7012 |
]. |
|
5789 | 7013 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
7014 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 7015 |
|
7016 |
info := OrderedCollection new. |
|
7017 |
size := self getBestDirectory asString size. |
|
7018 |
result do:[:assoc | |
|
7019 |
|fn1 fn2| |
|
7020 |
||
7021 |
fn1 := assoc key. |
|
7022 |
fn2 := assoc value. |
|
7023 |
size > 1 ifTrue:[ |
|
7024 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
7025 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
7026 |
]. |
|
7027 |
(fn1 includes:Character space) ifTrue:[ |
|
7028 |
fn1 := '"' , fn1 , '"' |
|
7029 |
]. |
|
7030 |
(fn2 includes:Character space) ifTrue:[ |
|
7031 |
fn2 := '"' , fn2 , '"' |
|
7032 |
]. |
|
7033 |
info add:(fn1 , ' same as ' , fn2) |
|
7034 |
]. |
|
7035 |
info isEmpty ifTrue:[ |
|
5543 | 7036 |
Dialog information:'No duplicate files found.'. |
7037 |
^ self. |
|
4355 | 7038 |
]. |
3892 | 7039 |
]. |
7040 |
stream := WriteStream on:''. |
|
11688 | 7041 |
stream nextPutAllLines:info. |
7042 |
||
3892 | 7043 |
titleStream := WriteStream on:''. |
12602 | 7044 |
titleStream nextPutAll:'File duplicates in directory'. |
3892 | 7045 |
directories size == 1 ifTrue:[ |
12602 | 7046 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 7047 |
] ifFalse:[ |
4535 | 7048 |
titleStream nextPutLine:'ies: '. |
4355 | 7049 |
directories do:[:dir| |
7050 |
size > 1 ifTrue:[ |
|
7051 |
titleStream nextPutAll:'..'. |
|
4535 | 7052 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 7053 |
] ifFalse:[ |
4535 | 7054 |
titleStream nextPutLine:(dir asString). |
4355 | 7055 |
]. |
7056 |
] |
|
3892 | 7057 |
]. |
5543 | 7058 |
|
3892 | 7059 |
textBox := TextBox new. |
7060 |
textBox initialText:(stream contents). |
|
7061 |
textBox title:(titleStream contents). |
|
7062 |
textBox readOnly:true. |
|
7063 |
textBox noCancel. |
|
14715 | 7064 |
stream := WriteStream on:''. |
7065 |
stream nextPutAll:'Duplicates in '. |
|
4170 | 7066 |
directories do:[ :aDirectory | |
4355 | 7067 |
stream nextPutAll:aDirectory baseName. |
7068 |
stream space. |
|
4050 | 7069 |
]. |
4170 | 7070 |
textBox label:stream contents. |
3892 | 7071 |
maxLength := 10. |
7072 |
info do:[: el | |
|
4355 | 7073 |
maxLength := maxLength max:(el size). |
3892 | 7074 |
]. |
5092 | 7075 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
7076 |
textBox maxExtent:Screen current extent. |
|
4355 | 7077 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7078 |
|
11688 | 7079 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 7080 |
! |
7081 |
||
7082 |
fileFindFile |
|
5961 | 7083 |
|filename| |
7084 |
||
7085 |
filename := self firstSelectedFileName. |
|
7086 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
7087 |
filename := Filename homeDirectory. |
3892 | 7088 |
]. |
4101 | 7089 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 7090 |
! |
7091 |
||
8510 | 7092 |
fileFindSimilarImages |
7093 |
"scan directory for similar image files" |
|
7094 |
||
8512 | 7095 |
|result stream textBox directories imageFiles histogramsV histogramsH |
7096 |
similarV similarH similar alreadyPrinted| |
|
8510 | 7097 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7098 |
self withWaitCursorDo:[ |
8510 | 7099 |
self withActivityIndicationDo:[ |
7100 |
result := Dictionary new. |
|
7101 |
||
7102 |
directories := self currentSelectedDirectories. |
|
7103 |
directories isEmpty ifTrue:[^ self]. |
|
7104 |
||
13714 | 7105 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImageType]. |
8511 | 7106 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
7107 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
7108 |
||
8510 | 7109 |
"/ for each, get the color histogram |
7110 |
histogramsV := Dictionary new. |
|
7111 |
histogramsH := Dictionary new. |
|
7112 |
imageFiles do:[:fn | |
|
7113 |
|hist image| |
|
7114 |
||
7115 |
image := Image fromFile:fn. |
|
7116 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
7117 |
hist := ImageColorHistogram new forImage:image. |
|
7118 |
histogramsV at:fn put:(hist histogramVectorV). |
|
7119 |
histogramsH at:fn put:(hist histogramVectorH). |
|
7120 |
]. |
|
7121 |
||
7122 |
similarH := Dictionary new. |
|
7123 |
similarV := Dictionary new. |
|
7124 |
similar := Dictionary new. |
|
7125 |
||
8512 | 7126 |
(self firstSelectedFile notNil |
7127 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
7128 |
ifFalse:[ imageFiles ]) |
|
7129 |
do:[:eachFile1 | |
|
8510 | 7130 |
|setOfSimilar distancesV distancesH| |
7131 |
||
7132 |
distancesV := OrderedCollection new. |
|
7133 |
distancesH := OrderedCollection new. |
|
7134 |
setOfSimilar := OrderedCollection new. |
|
7135 |
||
7136 |
imageFiles do:[:eachFile2 | |
|
7137 |
|v1 v2 dV dH| |
|
7138 |
||
7139 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
7140 |
v1 := histogramsV at:eachFile1. |
|
7141 |
v2 := histogramsV at:eachFile2. |
|
7142 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7143 |
distancesV add:(eachFile2 -> dV). |
|
7144 |
v1 := histogramsH at:eachFile1. |
|
7145 |
v2 := histogramsH at:eachFile2. |
|
7146 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7147 |
distancesH add:(eachFile2 -> dH). |
|
7148 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 7149 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 7150 |
]. |
7151 |
] |
|
7152 |
]. |
|
7153 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
7154 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
7155 |
similarV at:eachFile1 put:distancesV. |
|
7156 |
similarH at:eachFile1 put:distancesH. |
|
7157 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
7158 |
]. |
|
7159 |
||
7160 |
similar isEmpty ifTrue:[ |
|
7161 |
Dialog information:'No similarities found.'. |
|
7162 |
^ self. |
|
7163 |
]. |
|
7164 |
]. |
|
7165 |
||
7166 |
stream := WriteStream on:''. |
|
8512 | 7167 |
alreadyPrinted := Set new. |
7168 |
||
7169 |
imageFiles do:[:eachFile | |
|
7170 |
|eachSet| |
|
7171 |
||
7172 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
7173 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
7174 |
eachSet notNil ifTrue:[ |
|
7175 |
stream nextPutLine:eachFile pathName. |
|
7176 |
eachSet do:[:info | |
|
7177 |
|fn2 dist| |
|
7178 |
||
7179 |
fn2 := info key. |
|
7180 |
dist := info value. |
|
7181 |
stream nextPutAll:' '. |
|
7182 |
stream nextPutAll:fn2 pathName. |
|
7183 |
stream nextPutLine:' (',dist printString,')'. |
|
7184 |
alreadyPrinted add:fn2. |
|
7185 |
]. |
|
7186 |
stream cr. |
|
7187 |
]. |
|
8510 | 7188 |
]. |
7189 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7190 |
]. |
8510 | 7191 |
|
7192 |
textBox := TextBox new. |
|
7193 |
textBox initialText:(stream contents). |
|
7194 |
textBox title:'File similarities:'. |
|
7195 |
textBox readOnly:true. |
|
7196 |
textBox noCancel. |
|
7197 |
||
7198 |
textBox label:'File similarities'. |
|
7199 |
textBox extent:(400@((similar size max:40)* 10)). |
|
7200 |
textBox maxExtent:Screen current extent. |
|
7201 |
textBox openModeless. "/ showAtPointer. |
|
7202 |
||
7203 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
7204 |
! |
|
7205 |
||
4618 | 7206 |
fileHexDump |
7207 |
||
7208 |
| file item| |
|
7209 |
||
7210 |
file := self firstSelectedFile. |
|
7211 |
file notNil ifTrue:[ |
|
7212 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 7213 |
self |
7214 |
applicationNamed:#FileApplicationNoteBook |
|
7215 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 7216 |
]. |
7217 |
! |
|
7218 |
||
7324 | 7219 |
fileIn:aFilename |
7220 |
"fileIn a file" |
|
7221 |
||
7222 |
self fileIn:aFilename lazy:false |
|
7223 |
||
7224 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
7225 |
! |
|
7226 |
||
7227 |
fileIn:aFilename lazy:lazy |
|
7228 |
"fileIn a file" |
|
7229 |
||
7230 |
self withActivityIndicationDo:[ |
|
7231 |
self notify:('File in:', aFilename asFilename baseName). |
|
7232 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7233 |
self notify:nil. |
|
7234 |
] |
|
7235 |
||
7236 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
7237 |
! |
|
7238 |
||
4930 | 7239 |
filterSelectedFiles:whichFilter |
7240 |
|selectedFiles numFiles msg filterBlock| |
|
7241 |
||
7560 | 7242 |
selectedFiles := self currentSelectedObjects. |
4930 | 7243 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7244 |
||
7245 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7246 |
numFiles > 1 ifTrue:[ |
|
7247 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7248 |
]. |
|
7249 |
||
7250 |
(Dialog |
|
6352 | 7251 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7252 |
initialAnswer:false |
7253 |
) ifFalse:[ |
|
7254 |
^ self |
|
7255 |
]. |
|
7256 |
||
7257 |
whichFilter == #rot13 ifTrue:[ |
|
7258 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7259 |
]. |
|
7260 |
"/ add more here... |
|
7261 |
||
7262 |
filterBlock isNil ifTrue:[ |
|
7263 |
self information:'No such filter: ' , whichFilter. |
|
7264 |
^ self. |
|
7265 |
]. |
|
7266 |
||
7267 |
selectedFiles do:[:fileName | |
|
7268 |
|s| |
|
7269 |
||
7270 |
self notify:('Processing:', fileName baseName). |
|
7271 |
fileName isDirectory ifFalse:[ |
|
7272 |
[ |
|
7273 |
|inFile outFile in out| |
|
7274 |
||
7275 |
inFile := fileName asFilename. |
|
7276 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7277 |
||
7278 |
[ |
|
7279 |
|charIn charOut| |
|
7280 |
||
7281 |
in := inFile readStream. |
|
7282 |
out := outFile writeStream. |
|
7283 |
[in atEnd] whileFalse:[ |
|
7284 |
charIn := in next. |
|
7285 |
charOut := filterBlock value:charIn. |
|
7286 |
out nextPut:charOut. |
|
7287 |
]. |
|
13683 | 7288 |
out close. out:= nil. |
4930 | 7289 |
outFile renameTo:inFile. |
7290 |
] ensure:[ |
|
7291 |
out notNil ifTrue:[ out close ]. |
|
7292 |
in notNil ifTrue:[ in close ]. |
|
7293 |
outFile delete. |
|
7294 |
] |
|
7295 |
] on:FileStream openErrorSignal do:[:ex| |
|
7296 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7297 |
]. |
|
7298 |
] |
|
7299 |
]. |
|
6190 | 7300 |
self notify:nil. |
7560 | 7301 |
|
7302 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7303 |
! |
7304 |
||
9784 | 7305 |
forEachParsedXmlFileDo:aBlock |
7306 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7307 |
||
7308 |
self withActivityIndicationDo:[ |
|
7309 |
| selectedFiles xmlDocument | |
|
7310 |
||
7311 |
selectedFiles:= self currentSelectedFiles. |
|
7312 |
selectedFiles do:[:fileName | |
|
7313 |
XML::XMLSignal handle:[:ex | |
|
14551 | 7314 |
Dialog |
7315 |
information:('Error while reading XML:\ %1' bindWith:ex description) withCRs |
|
7316 |
title:'XML Error'. |
|
9784 | 7317 |
^ self. |
7318 |
] do:[ |
|
7319 |
|s d magic encoder document| |
|
7320 |
||
7321 |
s := fileName asFilename readStream. |
|
14012 | 7322 |
[ |
7323 |
s binary. |
|
7324 |
magic := (s next:2). |
|
7325 |
magic = #[254 255] ifTrue:[ |
|
7326 |
"/ UTF16BE |
|
7327 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7328 |
] ifFalse:[ |
|
7329 |
magic = #[255 254] ifTrue:[ |
|
7330 |
"/ UTF16LE |
|
7331 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7332 |
]. |
|
7333 |
]. |
|
7334 |
] ensure:[ |
|
7335 |
s close. |
|
7336 |
]. |
|
9784 | 7337 |
document notNil ifTrue:[ |
7338 |
xmlDocument := XML::XMLParser |
|
7339 |
processDocumentString:document |
|
7340 |
beforeScanDo:[:parse| parse validate:false]. |
|
7341 |
] ifFalse:[ |
|
7342 |
xmlDocument := XML::XMLParser |
|
7343 |
processDocumentInFilename:fileName |
|
7344 |
beforeScanDo:[:parse| parse validate:false]. |
|
7345 |
] |
|
7346 |
]. |
|
7347 |
aBlock value:xmlDocument. |
|
7348 |
]. |
|
7349 |
] |
|
7350 |
||
7351 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7352 |
! |
|
7353 |
||
8832 | 7354 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7355 |
|numItems path files| |
|
7356 |
||
7357 |
files := self currentSelectedFiles. |
|
7358 |
||
7359 |
(numItems := files size) > 2 ifTrue:[ |
|
7360 |
(self |
|
7361 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7362 |
with:numItems)) ifFalse:[^ self]. |
|
7363 |
]. |
|
7364 |
||
7365 |
self withActivityIndicationDo:[ |
|
7366 |
files do:[:fileName | |
|
7367 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7368 |
fileName isAbsolute ifTrue:[ |
|
7369 |
path := fileName getName. |
|
7370 |
] ifFalse:[ |
|
7371 |
path := fileName pathName. |
|
7372 |
]. |
|
7373 |
aBlock value:path |
|
7374 |
] |
|
7375 |
]. |
|
7376 |
]. |
|
7377 |
! |
|
7378 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7379 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7380 |
"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
|
7381 |
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
|
7382 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7383 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7384 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7385 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7386 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7387 |
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
|
7388 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7389 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7390 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7391 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7392 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7393 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7394 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7395 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7396 |
]. |
13677 | 7397 |
self updateCurrentDirectoryWithReread. |
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7398 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7399 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7400 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7401 |
|
13783 | 7402 |
generatePatchInstallerForSelectedFiles |
7403 |
"generate an expecco patch, which installs the selected file(s). |
|
7404 |
Opens a dialog asking for the target directory and if the patch should be signed" |
|
7405 |
||
7406 |
|dialog targetDirHolder targetDir |
|
14049 | 7407 |
generateSignedPatchHolder patchFileNameHolder patchFileName| |
13783 | 7408 |
|
7409 |
targetDirHolder := '.' asValue. |
|
14049 | 7410 |
generateSignedPatchHolder := true asValue. |
13783 | 7411 |
patchFileNameHolder := '/tmp/00nn_patchFile.st' asValue. |
7412 |
||
7413 |
dialog := Dialog new. |
|
7414 |
dialog label:(resources string:'Patch Installer for File(s)'). |
|
7415 |
dialog addTextLabel:'Patchfile Name' adjust:#left. |
|
7416 |
dialog addInputFieldOn:patchFileNameHolder tabable:true. |
|
7417 |
dialog addTextLabel:'Target directory (relative to executable''s directory at execution time)' adjust:#left. |
|
7418 |
dialog addInputFieldOn:targetDirHolder tabable:true. |
|
14049 | 7419 |
dialog addCheckBox:'Generate Signed Patch' on:generateSignedPatchHolder. |
13783 | 7420 |
dialog addAbortAndOkButtons. |
7421 |
dialog open. |
|
7422 |
||
7423 |
dialog accepted ifFalse:[^ self]. |
|
7424 |
||
7425 |
targetDir := targetDirHolder value asFilename. |
|
7426 |
patchFileName := patchFileNameHolder value asFilename. |
|
7427 |
||
7428 |
self withActivityIndicationDo:[ |
|
7429 |
|outStream zipArchive pkcs7SignedData signatureFilename| |
|
7430 |
||
7431 |
self notify:'Generating self extracting st script: ', patchFileName name, '...'. |
|
7432 |
outStream := patchFileName writeStream. |
|
7433 |
outStream nextPutAll:' |
|
7434 |
|patchStream zipArchive| |
|
7435 |
patchStream := Expecco::Browser::CurrentPatchStreamQuery query. |
|
7436 |
patchStream isNil ifTrue:[ self error:''sorry, this patch can only be installed in expecco 2.6.2 and newer (missing CurrentPatchStreamQuery)'']. |
|
7437 |
zipArchive := ZipArchive readingFrom:patchStream. |
|
7438 |
zipArchive members do:[:each | zipArchive extract:each fileName]. |
|
7439 |
patchStream setToEnd. "/ to force fileIn to finish |
|
7440 |
!! |
|
7441 |
||
7442 |
!! !! |
|
7443 |
||
7444 |
'. |
|
7445 |
zipArchive := ZipArchive writingTo:outStream. "/ newFileNamed:(patchFileName). |
|
7446 |
||
7447 |
self currentSelectedFiles do:[:fn | |
|
7448 |
|inStream signatureFilename| |
|
7449 |
||
7450 |
inStream := fn asFilename readStream. |
|
7451 |
zipArchive addFile: (targetDir construct:fn asFilename baseName) name fromStream:inStream. |
|
7452 |
inStream close. |
|
7453 |
]. |
|
7454 |
||
7455 |
zipArchive closeFile. |
|
7456 |
||
14049 | 7457 |
generateSignedPatchHolder value ifTrue:[ |
13783 | 7458 |
self notify:'Generating signed file from: ', patchFileName name, '...'. |
7459 |
||
7460 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:patchFileName contentsOfEntireFile. |
|
7461 |
signatureFilename := patchFileName withSuffix:'expeccoPatch'. |
|
7462 |
signatureFilename contents:pkcs7SignedData. |
|
7463 |
]. |
|
7464 |
self notify:nil. |
|
7465 |
] |
|
7466 |
! |
|
7467 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7468 |
generateSignaturesForSelectedFiles |
13783 | 7469 |
"generate signed pkcs7 files from the contents of the selected files. |
7470 |
These can be delivered as expeccoPatch files" |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7471 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7472 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7473 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7474 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7475 |
|
8646 | 7476 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7477 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7478 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7479 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7480 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7481 |
]. |
13677 | 7482 |
self updateCurrentDirectoryWithReread. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7483 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7484 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7485 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7486 |
|
9784 | 7487 |
inspectXmlFile |
7488 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7489 |
a plain inspector on the XML tree" |
|
7490 |
||
7491 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7492 |
XML::XMLInspector notNil ifTrue:[ |
|
7493 |
XML::XMLInspector openOn:xmlDocument. |
|
7494 |
] ifFalse:[ |
|
7495 |
"fall back..." |
|
7496 |
xmlDocument inspect. |
|
7497 |
] |
|
7498 |
]. |
|
7499 |
||
7500 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7501 |
! |
|
7502 |
||
3892 | 7503 |
installAllAsAutoloaded |
7504 |
"install all classes found here as autoloaded classes" |
|
7505 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7506 |
self installAllAsAutoloadedRecursive:false |
3892 | 7507 |
! |
7508 |
||
6521 | 7509 |
installAllAsAutoloadedRecursive |
7510 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7511 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7512 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7513 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7514 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7515 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7516 |
"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
|
7517 |
|
6521 | 7518 |
[ |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7519 |
|installAction| |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7520 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7521 |
installAction := |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7522 |
[:fn | |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7523 |
(fn suffix = 'st') ifTrue:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7524 |
self notify:('Install as autoloaded: ', fn baseName). |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7525 |
self installAsAutoloaded:fn. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7526 |
] |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7527 |
]. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7528 |
|
6521 | 7529 |
self withActivityIndicationDo:[ |
6725 | 7530 |
self currentSelectedDirectories do:[:dir| |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7531 |
aBoolean ifTrue:[ |
9675
704831da3132
changed: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9674
diff
changeset
|
7532 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7533 |
] ifFalse:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7534 |
dir directoryContentsAsFilenamesDo:installAction |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7535 |
]. |
6521 | 7536 |
]. |
7537 |
self notify:nil. |
|
7538 |
] |
|
7539 |
] fork. |
|
7540 |
! |
|
7541 |
||
3892 | 7542 |
installAsAutoloaded:aFilename |
7543 |
"install aFilename as autoloaded class" |
|
7544 |
||
13292 | 7545 |
Smalltalk installAutoloadedClassFromSourceFile:aFilename |
7546 |
||
7547 |
"Modified: / 01-08-2013 / 16:58:09 / cg" |
|
3892 | 7548 |
! |
7549 |
||
4558 | 7550 |
joinSelectedFiles |
6264 | 7551 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 7552 |
|
7560 | 7553 |
selectedFiles := self currentSelectedObjects. |
4558 | 7554 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
7555 |
||
7556 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 7557 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 7558 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
7559 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 7560 |
|
7561 |
outStream := outFile writeStream. |
|
7562 |
||
7563 |
selectedFiles do:[:fileName | |
|
7564 |
|inStream| |
|
7565 |
||
7566 |
self notify:('Adding:', fileName baseName). |
|
7567 |
inStream := fileName readStream. |
|
7568 |
inStream copyToEndInto:outStream. |
|
7569 |
inStream close. |
|
7570 |
]. |
|
7571 |
outStream close. |
|
6190 | 7572 |
self notify:nil. |
7560 | 7573 |
|
7574 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 7575 |
! |
7576 |
||
6292 | 7577 |
loadImageThenDo:aBlock |
3892 | 7578 |
|img path files| |
7579 |
||
3982 | 7580 |
files := self currentSelectedFiles. |
3892 | 7581 |
files isEmpty ifTrue:[ ^ self]. |
7582 |
files do:[:fileName | |
|
4414 | 7583 |
path := fileName. |
7584 |
path isDirectory ifFalse:[ |
|
7585 |
img := Image fromFile:(path pathName). |
|
7586 |
img notNil ifTrue:[ |
|
6292 | 7587 |
aBlock value:img |
4414 | 7588 |
] ifFalse:[ |
6292 | 7589 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 7590 |
] |
7591 |
] |
|
3892 | 7592 |
]. |
7593 |
! |
|
7594 |
||
13089 | 7595 |
loadSignatureSupport |
7596 |
Expecco::KeyFileGenerator isNil ifTrue:[ |
|
14047 | 7597 |
Smalltalk loadPackage:'exept:expecco/license' |
13089 | 7598 |
]. |
7599 |
! |
|
7600 |
||
3892 | 7601 |
openASN1Browser |
7602 |
||
7603 |
self openTool:OSI::ASN1Browser |
|
7604 |
! |
|
7605 |
||
7606 |
openAppletViewer |
|
7607 |
|numItems files| |
|
7608 |
||
3982 | 7609 |
files := self currentSelectedFiles. |
3892 | 7610 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 7611 |
(self |
7612 |
confirm:(resources string:'open for each of the %1 items ?' |
|
7613 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 7614 |
]. |
7615 |
||
7616 |
Java startupJavaSystem. |
|
7617 |
"/ Java markAllClassesUninitialized. |
|
7618 |
"/ Java initAllStaticFields. |
|
7619 |
"/ Java initAllClasses. |
|
7620 |
||
7621 |
files do:[:fileName | |
|
4414 | 7622 |
|p path| |
7623 |
||
7624 |
path := fileName. |
|
7625 |
path isDirectory ifFalse:[ |
|
7626 |
p := Java |
|
7627 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
7628 |
argumentString:path pathName. |
|
7629 |
p resume. |
|
7630 |
] |
|
3892 | 7631 |
]. |
7632 |
! |
|
7633 |
||
7634 |
openCBrowser |
|
6031 | 7635 |
|dir files| |
5880 | 7636 |
|
7637 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7638 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7639 |
self withActivityIndicationDo:[ |
7560 | 7640 |
files := self currentSelectedObjects. |
6031 | 7641 |
files notEmptyOrNil ifTrue:[ |
7642 |
CBrowser::Browser openOn:files first. |
|
7643 |
] ifFalse:[ |
|
7644 |
CBrowser::Browser openIn:dir. |
|
7645 |
] |
|
3892 | 7646 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7647 |
|
7560 | 7648 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 7649 |
! |
7650 |
||
4230 | 7651 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7652 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7653 |
|
4230 | 7654 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7655 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 7656 |
with:#openOnFile: |
7657 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7658 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7659 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 7660 |
! |
7661 |
||
3892 | 7662 |
openChangesBrowser |
7663 |
"open a change browser on the selected file(s)" |
|
7664 |
||
7665 |
self openTool:(UserPreferences current changesBrowserClass) |
|
7666 |
! |
|
7667 |
||
7668 |
openDiffView |
|
7669 |
"open a diff-view" |
|
7670 |
||
6388 | 7671 |
|name1 name2 text1 text2 d err nm l1 files title |
12850 | 7672 |
defaultName defaultDir sameContents msg| |
6460 | 7673 |
|
7674 |
files := self currentSelectedObjects. |
|
3892 | 7675 |
files isEmpty ifTrue:[ |
6460 | 7676 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 7677 |
^ self. |
3892 | 7678 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7679 |
|
3892 | 7680 |
(files size == 2) ifTrue:[ |
4414 | 7681 |
name1 := files last. |
7682 |
name2 := files first. |
|
3892 | 7683 |
] ifFalse:[ |
4414 | 7684 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 7685 |
LastFileDiffFile exists ifTrue:[ |
7686 |
name1 := LastFileDiffFile. |
|
7687 |
]. |
|
7688 |
"/ | directory | |
|
7689 |
"/ directory := self currentDirectory. |
|
7690 |
"/ directory notNil ifTrue:[ |
|
7691 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
7692 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
7693 |
"/ name1 := lastFile. |
|
7694 |
"/ ] |
|
7695 |
"/ ] |
|
4414 | 7696 |
]. |
7697 |
name2 := files first. |
|
6460 | 7698 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 7699 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 7700 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 7701 |
name1 := DialogBox |
7702 |
requestFileName:title |
|
7703 |
default:defaultName |
|
6460 | 7704 |
ok:(resources string:'OK') |
7705 |
abort:(resources string:'Compare against File List') |
|
4414 | 7706 |
pattern:'*' |
11052 | 7707 |
fromDirectory:defaultDir. |
3892 | 7708 |
]. |
7709 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7710 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7711 |
(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
|
7712 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
14126 | 7713 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l string]]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7714 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7715 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7716 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7717 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7718 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7719 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7720 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7721 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7722 |
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
|
7723 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7724 |
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
|
7725 |
]. |
4414 | 7726 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7727 |
l1 := name1 pathName |
4414 | 7728 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7729 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7730 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7731 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7732 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7733 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7734 |
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
|
7735 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7736 |
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
|
7737 |
]. |
4414 | 7738 |
]. |
7739 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7740 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7741 |
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
|
7742 |
^ self |
6176 | 7743 |
]. |
7744 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7745 |
self withActivityIndicationDo:[ |
11494 | 7746 |
((name1 notNil and:[name1 fileSize > (1024*1024*32)]) |
7747 |
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
|
7748 |
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
|
7749 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7750 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7751 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7752 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7753 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7754 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7755 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7756 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7757 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7758 |
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
|
7759 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7760 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7761 |
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
|
7762 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7763 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7764 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7765 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7766 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7767 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7768 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7769 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7770 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7771 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7772 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7773 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7774 |
text2 := name2 directoryContents asString. |
6460 | 7775 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7776 |
text2 := name2 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7777 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7778 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7779 |
(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
|
7780 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7781 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7782 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7783 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7784 |
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
|
7785 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7786 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7787 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7788 |
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
|
7789 |
d topView label:(resources string:'File Differences'). |
6460 | 7790 |
] |
4414 | 7791 |
] |
3892 | 7792 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7793 |
|
11494 | 7794 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
3892 | 7795 |
! |
7796 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7797 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7798 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7799 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7800 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7801 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7802 |
files := self currentSelectedObjects. |
11108 | 7803 |
files notEmpty ifTrue:[ |
7804 |
name1 := files first asFilename. |
|
7805 |
name1 asFilename isDirectory ifFalse:[ |
|
7806 |
name1 := name1 directory |
|
7807 |
]. |
|
7808 |
]. |
|
7809 |
||
7810 |
(files size == 2) ifTrue:[ |
|
7811 |
name2 := files second. |
|
7812 |
] ifFalse:[ |
|
7813 |
(files size ~= 1) ifTrue:[ |
|
7814 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
7815 |
^ self. |
|
7816 |
]. |
|
7817 |
name2 := Dialog |
|
7818 |
requestDirectoryName:(resources |
|
7819 |
string:'Recursive compare "%1" with folder:' |
|
7820 |
with:name1 asFilename baseName) |
|
7821 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
7822 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
7823 |
LastFileDiffDirectory := name2. |
|
7824 |
]. |
|
7825 |
name2 := name2 asFilename. |
|
7826 |
||
7827 |
name2 asFilename isDirectory ifFalse:[ |
|
7828 |
name2 := name2 directory |
|
7829 |
]. |
|
7830 |
||
7831 |
self |
|
7832 |
applicationNamed:#FileApplicationNoteBook |
|
7833 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7834 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7835 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7836 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7837 |
|
3892 | 7838 |
openEditor |
7839 |
self openTool:EditTextView |
|
7840 |
! |
|
7841 |
||
4957 | 7842 |
openGV |
7843 |
self openOSCommandWithFiles:'gv' |
|
7844 |
! |
|
7845 |
||
3892 | 7846 |
openHTMLReader |
7847 |
||
7848 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
7849 |
! |
|
7850 |
||
7851 |
openImageEditor |
|
6292 | 7852 |
[ |
7853 |
self loadImageThenDo:[:img | img edit] |
|
7854 |
] fork |
|
3892 | 7855 |
! |
7856 |
||
7857 |
openImageInspector |
|
6292 | 7858 |
[ |
7859 |
self loadImageThenDo:[:img | img inspect] |
|
7860 |
] fork |
|
3892 | 7861 |
! |
7862 |
||
7863 |
openImagePreview |
|
5778 | 7864 |
[ |
7865 |
self |
|
6292 | 7866 |
loadImageThenDo: |
5778 | 7867 |
[:img | |
7868 |
|i top viewer| |
|
7869 |
||
7870 |
top := StandardSystemView new. |
|
7871 |
||
7872 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
7873 |
i := img. |
|
7874 |
top extent:200@200. |
|
7875 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
7876 |
top openAndWait. |
|
7877 |
||
7878 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
7879 |
i := i magnifiedPreservingRatioTo:200@200. |
|
7880 |
]. |
|
7881 |
viewer image:i. |
|
7882 |
]. |
|
3892 | 7883 |
] fork |
7884 |
! |
|
7885 |
||
7886 |
openMP3Player |
|
7887 |
|file| |
|
7888 |
||
3982 | 7889 |
file := self currentSelectedFiles. |
3892 | 7890 |
(file isEmpty) ifTrue:[ |
4414 | 7891 |
^ self. |
3892 | 7892 |
]. |
7893 |
file := file first. |
|
7894 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
7895 |
! |
|
7896 |
||
4957 | 7897 |
openOSCommandWithFiles:command |
7898 |
|files fileNames| |
|
7899 |
||
7900 |
files := self currentSelectedFiles. |
|
7901 |
(files isEmpty) ifTrue:[ |
|
7902 |
^ self. |
|
7903 |
]. |
|
7904 |
||
7905 |
fileNames := files collect:[:each | |
|
7906 |
'"' , each asFilename pathName , '"' |
|
7907 |
]. |
|
7908 |
||
7909 |
[ |
|
7910 |
OperatingSystem |
|
4959 | 7911 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
7912 |
inDirectory:(files first asFilename directory). |
|
4957 | 7913 |
] fork |
7914 |
! |
|
7915 |
||
4820 | 7916 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7917 |
|files fileNames cmd arg| |
4820 | 7918 |
|
7919 |
files := self currentSelectedFiles. |
|
7920 |
(files isEmpty) ifTrue:[ |
|
7921 |
^ self. |
|
7922 |
]. |
|
12972 | 7923 |
cmd := MIMETypes defaultCommandTemplateToOpenMimeType:'application/pdf'. |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7924 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7925 |
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
|
7926 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7927 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7928 |
|
4820 | 7929 |
fileNames := |
7930 |
files |
|
7931 |
collect: |
|
7932 |
[:each | |
|
7933 |
'"' , each asFilename pathName , '"' |
|
7934 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7935 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7936 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7937 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7938 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7939 |
]. |
4820 | 7940 |
|
4950 | 7941 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7942 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 7943 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7944 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7945 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 7946 |
! |
7947 |
||
4958 | 7948 |
openRP |
7949 |
self openOSCommandWithFiles:'realplay' |
|
7950 |
! |
|
7951 |
||
8426 | 7952 |
openResourceFileEditor |
7953 |
||
7954 |
self |
|
7955 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
7956 |
with: #openOnFile: |
|
7957 |
! |
|
7958 |
||
3892 | 7959 |
openSlideShow |
5880 | 7960 |
|dir| |
7961 |
||
7962 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7963 |
dir isNil ifTrue:[^ self]. |
|
7964 |
||
3892 | 7965 |
CodingExamples_GUI::SlideShow openIn:dir. |
7966 |
! |
|
7967 |
||
7968 |
openSnapshotImageBrowser |
|
4491 | 7969 |
"Sorry, for now, only the old browser can handle snapShotImages." |
7970 |
||
3892 | 7971 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
7972 |
! |
|
7973 |
||
7974 |
openTerminal |
|
5880 | 7975 |
|dir| |
7976 |
||
7977 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 7978 |
|
5300 | 7979 |
TerminalApplication notNil ifTrue:[ |
7980 |
TerminalApplication openIn:dir |
|
7981 |
] ifFalse:[ |
|
7982 |
VT100TerminalView openShellIn:dir. |
|
7983 |
]. |
|
3892 | 7984 |
! |
7985 |
||
7986 |
openTool:aToolClass |
|
7987 |
"open a tool on the selected file(s)" |
|
7988 |
||
7989 |
^ self openTool:aToolClass ignoreDirectories:true |
|
7990 |
! |
|
7991 |
||
7992 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
7993 |
"open a tool on the selected file(s)" |
|
7994 |
||
7995 |
^ self |
|
4414 | 7996 |
openTool:aToolClass |
7997 |
with:#openOn: |
|
7998 |
ignoreDirectories:ignoreDirs |
|
3892 | 7999 |
! |
8000 |
||
8426 | 8001 |
openTool:aToolClass with:aSelector |
8002 |
"open a tool on the selected file(s)" |
|
8003 |
||
8004 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
8005 |
! |
|
8006 |
||
3892 | 8007 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
8008 |
"open a tool on the selected file(s)" |
|
8009 |
||
8832 | 8010 |
|tool| |
3892 | 8011 |
|
8012 |
aToolClass isNil ifTrue:[ |
|
4414 | 8013 |
Dialog warn:'Sorry, that tool seems to be not available'. |
8014 |
^ nil. |
|
3892 | 8015 |
]. |
8832 | 8016 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
8017 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 8018 |
]. |
8019 |
^ tool |
|
8832 | 8020 |
! |
8021 |
||
8022 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8023 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8024 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8025 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8026 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8027 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8028 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8029 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8030 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8031 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8032 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
8033 |
]. |
3892 | 8034 |
! |
8035 |
||
6022 | 8036 |
openWorkspace |
8037 |
self |
|
8038 |
openTool:WorkspaceApplication |
|
8039 |
with:#openOnFile: |
|
8040 |
ignoreDirectories:true |
|
8041 |
! |
|
8042 |
||
4950 | 8043 |
openXV |
4957 | 8044 |
self openOSCommandWithFiles:'xv' |
4950 | 8045 |
! |
8046 |
||
3892 | 8047 |
openZipTool |
5880 | 8048 |
|zipTool| |
3892 | 8049 |
|
8050 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 8051 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 8052 |
]. |
8053 |
! |
|
8054 |
||
8055 |
readAbbrevFile |
|
8056 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
8057 |
||
5880 | 8058 |
|directories| |
3892 | 8059 |
|
3982 | 8060 |
directories := self currentSelectedDirectories. |
3892 | 8061 |
directories isEmpty ifTrue:[^ self]. |
8062 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8063 |
self withActivityIndicationDo:[ |
5880 | 8064 |
directories do:[:eachDir | |
8065 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
8066 |
] |
|
5828 | 8067 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8068 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8069 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 8070 |
! |
8071 |
||
6460 | 8072 |
readAndShowResources |
8073 |
self withActivityIndicationDo:[ |
|
8074 |
| selectedFiles| |
|
8075 |
||
8076 |
selectedFiles:= self currentSelectedFiles. |
|
8077 |
selectedFiles do:[:fileName | |
|
8078 |
resources := ResourcePack fromFile:fileName. |
|
8079 |
resources inspect. |
|
8080 |
]. |
|
8081 |
] |
|
8082 |
! |
|
8083 |
||
3892 | 8084 |
singleFileFileIn:fileName lazy:lazy |
8085 |
"fileIn the selected file(s)" |
|
8086 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8087 |
|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
|
8088 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8089 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8090 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8091 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8092 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8093 |
[ |
4345 | 8094 |
(ObjectFileLoader notNil |
5491 | 8095 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 8096 |
AbortOperationRequest catch:[ |
8097 |
|p| |
|
8098 |
||
8099 |
"/ |
|
8100 |
"/ look if already loaded ... then unload first |
|
8101 |
"/ |
|
8102 |
p := fileName pathName. |
|
8103 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
8104 |
(Dialog confirm:(resources |
|
8105 |
string:'%1 is already loaded; load anyway ?' |
|
8106 |
with:p)) ifFalse:[ |
|
8107 |
^ self |
|
8108 |
]. |
|
8109 |
notifyString := 'unloading old ' , p , ' ...'. |
|
8110 |
Transcript showCR:notifyString. |
|
4523 | 8111 |
self notify:notifyString. |
4345 | 8112 |
ObjectFileLoader unloadObjectFile:p. |
8113 |
]. |
|
8114 |
||
8115 |
notifyString := 'loading ' , p , ' ...'. |
|
8116 |
Transcript showCR:notifyString. |
|
4523 | 8117 |
self notify:notifyString. |
12426 | 8118 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
8119 |
notifyString := 'Error: could not load ' , p. |
|
8120 |
Transcript showCR:notifyString. |
|
8121 |
self notify:notifyString. |
|
8122 |
] ifFalse:[ |
|
8123 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
8124 |
]. |
|
4345 | 8125 |
] |
8126 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
8127 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
8128 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8129 |
aStream := fileName readStreamOrNil. |
4345 | 8130 |
aStream notNil ifTrue:[ |
8131 |
aStream fileInBinary. |
|
8132 |
] |
|
8133 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8134 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 8135 |
"/ loading a java class file |
8136 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 8137 |
JavaClassReader loadFile:fileName |
4345 | 8138 |
] |
8139 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
8140 |
"/ loading a sif (smalltalk interchange format) file |
|
8141 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
8142 |
SmalltalkInterchangeFileManager newForFileIn |
|
8143 |
fileName: fileName pathName; |
|
8144 |
fileIn. |
|
8145 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
8146 |
Parcel isNil ifTrue:[ |
|
8147 |
Dialog warn:'Parcel support not loaded.' |
|
8148 |
] ifFalse:[ |
|
8149 |
Parcel loadParcelFrom: fileName pathName |
|
8150 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8151 |
] ifFalse:[ (fileName hasSuffix:'jar') ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8152 |
JavaVM isNil ifTrue:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8153 |
Dialog warn: (resources string: 'Java support is not loaded.'). |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8154 |
^ self. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8155 |
] ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8156 |
JavaVM booted ifFalse:[ |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8157 |
(Dialog confirm: (resources string: 'Java is not initialized. Initialize now?')) ifFalse:[ ^ self. ]. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8158 |
JavaVM boot. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8159 |
]. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8160 |
JavaVM loadClassesIn: fileName. |
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8161 |
] |
4345 | 8162 |
] ifFalse:[ |
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8163 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8164 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
14360 | 8165 |
(lang isNil and:[(fileName hasSuffix:'js')]) ifTrue:[ |
14362 | 8166 |
Smalltalk loadPackage:'stx:libjavascript'. |
14360 | 8167 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
8168 |
]. |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8169 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8170 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8171 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8172 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8173 |
Error handle:[:ex | |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8174 |
self errorNotify:'Error on file in: ', ex description. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8175 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8176 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8177 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8178 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8179 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8180 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8181 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8182 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8183 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8184 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8185 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
8186 |
] |
4345 | 8187 |
] |
8188 |
] |
|
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8189 |
]]]] |
4345 | 8190 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8191 |
] 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
|
8192 |
|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
|
8193 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8194 |
isRedef := false. |
12684 | 8195 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8196 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8197 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8198 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8199 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8200 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8201 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8202 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8203 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8204 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8205 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8206 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8207 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8208 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8209 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8210 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8211 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8212 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8213 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8214 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8215 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8216 |
sender := ex suspendedContext. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8217 |
msg := msg , '\\in ' , sender receiver class name , '>>' , sender sender selector |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8218 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8219 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8220 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8221 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8222 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8223 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8224 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8225 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8226 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8227 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8228 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8229 |
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
|
8230 |
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
|
8231 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8232 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8233 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8234 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8235 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8236 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8237 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8238 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8239 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8240 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8241 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8242 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8243 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8244 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8245 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8246 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8247 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8248 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8249 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8250 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8251 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8252 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8253 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8254 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8255 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8256 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8257 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8258 |
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
|
8259 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8260 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8261 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8262 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8263 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8264 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8265 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8266 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8267 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8268 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
8269 |
(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
|
8270 |
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
|
8271 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8272 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8273 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8274 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8275 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8276 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8277 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8278 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8279 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8280 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8281 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8282 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8283 |
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
|
8284 |
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
|
8285 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8286 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8287 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8288 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8289 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8290 |
] |
7040 | 8291 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8292 |
"Modified: / 22-11-2011 / 13:52:17 / cg" |
13968
45cdc56fd50a
Added support for filing-in .jar files.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13910
diff
changeset
|
8293 |
"Modified: / 19-02-2014 / 12:49:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4531 | 8294 |
! |
8295 |
||
4558 | 8296 |
splitFile:infile intoPiecesOfSize:kiloBytes |
8297 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
8298 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
8299 |
||
8300 |
bufferSize := 32*1024. |
|
8301 |
||
8302 |
inStream := infile readStream. |
|
8303 |
||
8304 |
bytesPerSplit := kiloBytes * 1024. |
|
8305 |
||
8306 |
remaining := infile fileSize. |
|
8307 |
splitIndex := 1. |
|
8308 |
[remaining > 0] whileTrue:[ |
|
8309 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8310 |
outStream := outFile asFilename writeStream. |
|
8311 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
8312 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
8313 |
buffer := ByteArray new:bufferSize. |
|
8314 |
n := inStream |
|
8315 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
8316 |
into:buffer |
|
8317 |
startingAt:1. |
|
8318 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
8319 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
8320 |
remaining := remaining - n. |
|
8321 |
]. |
|
8322 |
outStream close. |
|
8323 |
splitIndex := splitIndex + 1. |
|
8324 |
]. |
|
8325 |
inStream close. |
|
8326 |
! |
|
8327 |
||
8328 |
splitSelectedFiles |
|
6264 | 8329 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8330 |
|
12871 | 8331 |
selectedFiles := self currentSelectedFiles. |
4558 | 8332 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8333 |
||
6265 | 8334 |
msg := (numFiles > 1) |
8335 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8336 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8337 |
|
6352 | 8338 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8339 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8340 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8341 |
kiloBytes isNil ifTrue:[^ self]. |
8342 |
||
8343 |
selectedFiles do:[:fileName | |
|
8344 |
self notify:('Splitting:', fileName baseName). |
|
8345 |
fileName isDirectory ifFalse:[ |
|
8346 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8347 |
] |
|
8348 |
]. |
|
6190 | 8349 |
self notify:nil. |
6265 | 8350 |
|
7560 | 8351 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8352 |
! |
8353 |
||
4531 | 8354 |
truncateSelectedFilesToZeroSize |
4554 | 8355 |
|selectedFiles numFiles msg| |
4531 | 8356 |
|
7560 | 8357 |
selectedFiles := self currentSelectedObjects. |
4554 | 8358 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8359 |
||
4930 | 8360 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 8361 |
numFiles > 1 ifTrue:[ |
4930 | 8362 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 8363 |
]. |
4531 | 8364 |
|
8365 |
(Dialog |
|
6352 | 8366 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 8367 |
initialAnswer:false |
8368 |
) ifFalse:[ |
|
8369 |
^ self |
|
8370 |
]. |
|
8371 |
||
8372 |
selectedFiles do:[:fileName | |
|
8373 |
|s| |
|
8374 |
||
8375 |
self notify:('Truncating:', fileName baseName). |
|
8376 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8377 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8378 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8379 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8380 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 8381 |
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
|
8382 |
]. |
4531 | 8383 |
] |
8384 |
]. |
|
6190 | 8385 |
self notify:nil. |
7560 | 8386 |
|
8387 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 8388 |
! ! |
8389 |
||
4849 | 8390 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 8391 |
|
8392 |
canCvsAddAndCommit |
|
8393 |
||
3982 | 8394 |
|selectedFiles| |
8395 |
||
8396 |
selectedFiles := self currentSelectedFiles. |
|
8397 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 8398 |
! |
8399 |
||
8400 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
8401 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8402 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8403 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8404 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8405 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8406 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 8407 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8408 |
]. |
3892 | 8409 |
! ! |
8410 |
||
4849 | 8411 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8412 |
|
6521 | 8413 |
anySTFilesOrDirectoriesPresent |
8414 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
8415 |
! |
|
8416 |
||
3892 | 8417 |
anySTFilesPresent |
8418 |
^ self anyFilesPresentWithSuffix:'st' |
|
8419 |
! |
|
8420 |
||
8421 |
canCreateNewProject |
|
8422 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
12811 | 8423 |
^ self currentSelectedFiles contains:[:fileName| |
8424 |
| suffix| |
|
8425 |
suffix := fileName suffix asLowercase. |
|
8426 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8427 |
] |
|
3892 | 8428 |
! |
8429 |
||
8430 |
canDoTerminal |
|
8431 |
||
8432 |
^ OperatingSystem isUNIXlike |
|
8433 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8434 |
! |
|
8435 |
||
8436 |
canDoTerminalAndSystemIsDOS |
|
8437 |
||
8438 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8439 |
! |
|
8440 |
||
8441 |
canDoTerminalAndSystemIsUnix |
|
8442 |
||
8443 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8444 |
! |
|
8445 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8446 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8447 |
"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
|
8448 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8449 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8450 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8451 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8452 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8453 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8454 |
|
12811 | 8455 |
canOpenMonticelloBrowser |
8456 |
^ self currentSelectedFiles |
|
8457 |
contains:[:fileName| |
|
8458 |
fileName suffix asLowercase = 'mcz' |
|
8459 |
] |
|
8460 |
! |
|
8461 |
||
3892 | 8462 |
canReadAbbrevFile |
8463 |
||
5960 | 8464 |
|currentDirectory| |
3892 | 8465 |
|
8466 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 8467 |
currentDirectory := self currentDirectory. |
8468 |
^ currentDirectory notNil |
|
8469 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 8470 |
! |
8471 |
||
8472 |
canRemoveFromSourcePath |
|
8473 |
||
8474 |
^ false |
|
8475 |
! |
|
8476 |
||
13089 | 8477 |
cannotGenerateSignatureFiles |
8478 |
^ self canGenerateSignatureFiles not |
|
8479 |
! |
|
8480 |
||
3892 | 8481 |
hasASN1 |
8482 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 8483 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 8484 |
|
8485 |
! |
|
8486 |
||
8487 |
hasASN1AndSelection |
|
8488 |
^ [ self hasSelection value |
|
4414 | 8489 |
and:[self currentSelectedFiles size > 0 |
8490 |
and:[OSI::ASN1Parser notNil |
|
8491 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 8492 |
! |
8493 |
||
8494 |
hasCBrowser |
|
8495 |
^ [ CBrowser::Browser notNil ] |
|
8496 |
! |
|
8497 |
||
8498 |
hasJava |
|
8499 |
||
14298 | 8500 |
^ [ JavaVM notNil |
8501 |
and:[JavaClassReader notNil |
|
8502 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 8503 |
! |
8504 |
||
8505 |
hasJavaAndSelection |
|
8506 |
||
12871 | 8507 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 8508 |
and:[JavaClassReader notNil |
8509 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 8510 |
! |
8511 |
||
8512 |
hasMP3Player |
|
8513 |
||
8514 |
^ [ MP3PlayerApplication notNil |
|
4414 | 8515 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 8516 |
! |
8517 |
||
8518 |
hasMP3PlayerAndSelection |
|
8519 |
||
12871 | 8520 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 8521 |
and:[ self hasMP3Player value]] |
3892 | 8522 |
! |
8523 |
||
8426 | 8524 |
hasResourceFileSelected |
12871 | 8525 |
^ (self currentSelectedFiles) |
8526 |
contains:[:fn | |
|
12811 | 8527 |
fn suffix asLowercase = 'rs' |
8528 |
]. |
|
8426 | 8529 |
! |
8530 |
||
3892 | 8531 |
hasSlideShow |
8532 |
||
8533 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
8534 |
! |
|
8535 |
||
8536 |
hasSnapshotSelection |
|
8537 |
||
8538 |
^ [ |
|
4414 | 8539 |
| files | |
8426 | 8540 |
|
4414 | 8541 |
files := self currentSelectedFiles. |
8542 |
((files size == 1) |
|
8543 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 8544 |
] |
8545 |
! |
|
8546 |
||
7869 | 8547 |
hasXml |
9206 | 8548 |
^ [ XML::XMLParser notNil ] |
7869 | 8549 |
! |
8550 |
||
8551 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8552 |
"/ 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
|
8553 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 8554 |
|
8426 | 8555 |
^ [ |
8556 |
|sel fileName| |
|
7869 | 8557 |
|
8558 |
sel := self currentSelectedFiles. |
|
8559 |
sel size == 1 ifTrue:[ |
|
8560 |
fileName := sel first. |
|
8561 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8562 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 8563 |
] ifFalse:[ |
8564 |
false |
|
8565 |
] |
|
8566 |
] ifFalse:[ |
|
8567 |
false |
|
8568 |
] |
|
8569 |
] |
|
8570 |
! |
|
8571 |
||
3892 | 8572 |
hasZipFileSelected |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8573 |
|sel fileName suff| |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8574 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8575 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8576 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8577 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8578 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8579 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8580 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8581 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8582 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8583 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8584 |
^ fileName mimeTypeOfContents = 'application/x-zip-compressed' |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8585 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8586 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8587 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8588 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8589 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8590 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8591 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8592 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 8593 |
! |
8594 |
||
8595 |
javaSupportLoaded |
|
8596 |
||
8597 |
^ false |
|
8598 |
! ! |
|
8599 |
||
14126 | 8600 |
|
8601 |
||
3906 | 8602 |
!AbstractFileBrowser methodsFor:'presentation'! |
8603 |
||
8604 |
getModeString:modeBits |
|
8605 |
"convert file-mode bits into a more user-friendly string. |
|
8606 |
This is wrong here - should be moved into OperatingSystem." |
|
8607 |
||
8608 |
^ self getModeString:modeBits |
|
4414 | 8609 |
with:#( 'owner:' $r $w $x |
8610 |
' group:' $r $w $x |
|
8611 |
' others:' $r $w $x ) |
|
3906 | 8612 |
! |
8613 |
||
8614 |
getModeString:modeBits with:texts |
|
8615 |
"convert file-mode bits into a more user-friendly string. |
|
8616 |
This is wrong here - should be moved into OperatingSystem." |
|
8617 |
||
8618 |
|bits modeString| |
|
8619 |
||
8620 |
bits := modeBits bitAnd:8r777. |
|
8621 |
modeString := ''. |
|
8622 |
||
8623 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
8624 |
with: texts do:[:bitMask :access | |
|
4414 | 8625 |
|ch| |
8626 |
||
8627 |
bitMask isNil ifTrue:[ |
|
8628 |
modeString := modeString , access |
|
8629 |
] ifFalse:[ |
|
8630 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
8631 |
ch := $- |
|
8632 |
] ifFalse:[ |
|
8633 |
ch := access |
|
8634 |
]. |
|
8635 |
modeString := modeString copyWith:ch |
|
8636 |
] |
|
3906 | 8637 |
]. |
8638 |
^ modeString |
|
8639 |
! ! |
|
8640 |
||
5880 | 8641 |
!AbstractFileBrowser methodsFor:'private'! |
8642 |
||
8643 |
theSingleSelectedDirectoryOrHomeDir |
|
8644 |
|dir| |
|
8645 |
||
5888 | 8646 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 8647 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
8648 |
^ dir. |
|
8649 |
! |
|
8650 |
||
8651 |
theSingleSelectedDirectoryOrNil |
|
8652 |
|dirs| |
|
8653 |
||
8654 |
dirs := self currentSelectedDirectories. |
|
8655 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
8656 |
^ dirs anElement. |
|
14577 | 8657 |
! |
8658 |
||
8659 |
theSingleSelectedFileOrNil |
|
8660 |
|dirs| |
|
8661 |
||
8662 |
dirs := self currentSelectedFiles. |
|
8663 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
8664 |
^ dirs anElement. |
|
5880 | 8665 |
! ! |
8666 |
||
3892 | 8667 |
!AbstractFileBrowser methodsFor:'queries'! |
8668 |
||
8256 | 8669 |
cBrowserLoaded |
8670 |
^ CBrowser::Browser notNil |
|
8671 |
! |
|
8672 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8673 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8674 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8675 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8676 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8677 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8678 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8679 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8680 |
"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
|
8681 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8682 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8683 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8684 |
|
3906 | 8685 |
getFileInfoStringForFirstSelectedFile:longInfo |
8686 |
"get stat info on selected file - return a string which can be |
|
8687 |
shown in a box" |
|
8688 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
8689 |
|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
|
8690 |
sizeString fileSize tAccess tModification buffer| |
3906 | 8691 |
|
7560 | 8692 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8693 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 8694 |
filename := selFiles first. |
8695 |
||
8364 | 8696 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8697 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8698 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8699 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8700 |
]. |
8364 | 8701 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
8702 |
buffer := Text writeStream. |
4765 | 8703 |
|
8704 |
buffer |
|
8705 |
nextPutAll:'filename: '; |
|
8706 |
nextPutLine:filename asString. |
|
8707 |
||
8364 | 8708 |
OperatingSystem isMSDOSlike ifTrue: [ |
8709 |
(info alternativeName notNil |
|
8710 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
8711 |
buffer nextPutAll:'shortname: '. |
|
8712 |
buffer nextPutLine:info alternativeName. |
|
8713 |
] |
|
8714 |
]. |
|
8715 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8716 |
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
|
8717 |
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
|
8718 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8719 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8720 |
]. |
4765 | 8721 |
buffer |
8722 |
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
|
8723 |
nextPutLine:(info path ? '???'). |
3906 | 8724 |
] 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
|
8725 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8726 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8727 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8728 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8729 |
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
|
8730 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8731 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8732 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8733 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8734 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8735 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8736 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8737 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8738 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8739 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8740 |
fileSize > 1024 ifTrue:[ |
8172 | 8741 |
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
|
8742 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8743 |
]. |
4765 | 8744 |
buffer nextPutLine:sizeString. |
3906 | 8745 |
|
8746 |
modeBits := info mode. |
|
8747 |
modeString := self getModeString:modeBits. |
|
4765 | 8748 |
|
8749 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 8750 |
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
|
8751 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 8752 |
]. |
4765 | 8753 |
buffer |
8754 |
cr; |
|
8755 |
nextPutAll:'owner: '; |
|
8756 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
8757 |
||
3906 | 8758 |
longInfo ifTrue:[ |
4765 | 8759 |
buffer |
8760 |
nextPutAll:'group: '; |
|
8761 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
8762 |
||
8763 |
tAccess := info accessTime. |
|
8764 |
buffer |
|
8765 |
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
|
8766 |
nextPutAll:tAccess asDate printString; |
4765 | 8767 |
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
|
8768 |
nextPutLine:tAccess asTime printString. |
4765 | 8769 |
|
8770 |
tModification := info modificationTime. |
|
8771 |
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
|
8772 |
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
|
8773 |
nextPutAll:tModification asDate printString; |
4765 | 8774 |
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
|
8775 |
nextPutLine:tModification asTime printString. |
3906 | 8776 |
]. |
4765 | 8777 |
^ buffer contents |
7560 | 8778 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
8779 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 8780 |
! |
8781 |
||
8510 | 8782 |
hasImageColorHistogram |
8783 |
^ ImageColorHistogram notNil |
|
8784 |
! |
|
8785 |
||
10258 | 8786 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
8787 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 8788 |
|
8789 |
"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
|
8790 |
"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
|
8791 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 8792 |
! |
8793 |
||
3892 | 8794 |
initialCommandFor:fileName into:aBox |
8795 |
"set a useful initial command for execute box." |
|
8796 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
8797 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 8798 |
! |
8799 |
||
8800 |
isAbstractFileBrowser |
|
8801 |
||
8802 |
^ true |
|
8803 |
! |
|
8804 |
||
8805 |
systemIsDOS |
|
8806 |
||
8807 |
^ OperatingSystem isMSDOSlike |
|
8808 |
! |
|
8809 |
||
12473 | 8810 |
systemIsOSX |
8811 |
||
8812 |
^ OperatingSystem isOSXlike |
|
8813 |
! |
|
8814 |
||
3892 | 8815 |
systemIsUnix |
8816 |
^ OperatingSystem isUNIXlike |
|
8817 |
! ! |
|
8818 |
||
8819 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
8820 |
||
8821 |
allItemsOfCurrentDirectory |
|
5009 | 8822 |
self |
4774 | 8823 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 8824 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
8825 |
||
8826 |
^ nil |
|
3892 | 8827 |
! |
8828 |
||
8829 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 8830 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8831 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
8832 |
(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
|
8833 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 8834 |
]. |
8835 |
^ false. |
|
8836 |
! |
|
8837 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8838 |
commonPrefixOfSelectedFiles |
4773 | 8839 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8840 |
|
7560 | 8841 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8842 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8843 |
|
4772 | 8844 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 8845 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8846 |
stringCol from:2 do:[:el| |
4773 | 8847 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8848 |
]. |
4773 | 8849 |
^ firstPre asFilename |
7560 | 8850 |
|
8851 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8852 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8853 |
|
12481 | 8854 |
compressTabsOnSave |
8855 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
8856 |
when saving. |
|
8857 |
Default is true" |
|
8858 |
||
8859 |
^ true |
|
8860 |
! |
|
8861 |
||
3892 | 8862 |
currentFilesAreInSameDirectory |
8863 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8864 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 8865 |
! |
8866 |
||
8867 |
currentFilesHasDirectories |
|
8868 |
||
6725 | 8869 |
^ self currentSelectedDirectories notEmpty. |
3892 | 8870 |
! |
8871 |
||
3982 | 8872 |
directoriesForFiles:aFileCol |
11743 | 8873 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 8874 |
! |
8875 |
||
3892 | 8876 |
fileListIsEmpty |
5009 | 8877 |
self |
8878 |
applicationNamed:#DirectoryContentsBrowser |
|
8879 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
8880 |
||
8881 |
^ nil. |
|
3892 | 8882 |
! |
8883 |
||
8884 |
fileListIsNotEmpty |
|
8885 |
||
8886 |
^ self fileListIsEmpty not. |
|
8887 |
! |
|
8888 |
||
8889 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 8890 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 8891 |
|
8892 |
| file1 file2 | |
|
8893 |
||
6284 | 8894 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 8895 |
file1 := aFilename1 asFilename. |
8896 |
file2 := aFilename2 asFilename. |
|
6284 | 8897 |
|
3892 | 8898 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 8899 |
|
3892 | 8900 |
((file1 isDirectory) |
8901 |
and:[(file2 isDirectory) |
|
8902 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 8903 |
^ file1 baseName = file2 baseName |
3892 | 8904 |
]. |
3982 | 8905 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 8906 |
! |
8907 |
||
8908 |
getAllFilesAsStringCollection |
|
5009 | 8909 |
self |
8910 |
applicationNamed:#DirectoryContentsBrowser |
|
8911 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
8912 |
||
8913 |
^ nil |
|
3892 | 8914 |
! |
8915 |
||
8916 |
getBestDirectory |
|
8917 |
||
8918 |
|selFiles stringCol firstPre| |
|
8919 |
||
6725 | 8920 |
selFiles := self currentSelectedDirectories. |
3892 | 8921 |
selFiles isEmpty ifTrue:[^ nil]. |
8922 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 8923 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 8924 |
firstPre := stringCol at:1. |
8925 |
stringCol from:2 do:[:el| |
|
4414 | 8926 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 8927 |
]. |
8928 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 8929 |
firstPre removeLast. |
3892 | 8930 |
]. |
8931 |
^ firstPre asFilename |
|
8932 |
! |
|
8933 |
||
8934 |
getDirWithoutFileName:aFileName |
|
8935 |
||
8936 |
| dir | |
|
8937 |
aFileName isNil ifTrue:[ |
|
4414 | 8938 |
^ aFileName. |
3892 | 8939 |
]. |
8940 |
dir := aFileName asFilename. |
|
8941 |
dir isDirectory ifFalse:[ |
|
4414 | 8942 |
dir := dir directory. |
3892 | 8943 |
]. |
8944 |
^ dir. |
|
8945 |
! |
|
8946 |
||
8947 |
getInfoItem |
|
8948 |
"get filename of a description-file (.dir.info, README etc.); |
|
8949 |
This file is automatically shown when a directory is enterred. |
|
8950 |
You can add more names below if you like." |
|
8951 |
||
5880 | 8952 |
|dir| |
8953 |
||
8954 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8955 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 8956 |
|
8957 |
#( |
|
8958 |
'.dir.info' |
|
8959 |
'README' |
|
8960 |
'ReadMe' |
|
8961 |
'Readme' |
|
8962 |
'readme' |
|
8963 |
'read.me' |
|
8964 |
'Read.me' |
|
8965 |
'READ.ME' |
|
8966 |
'README.TXT' |
|
8967 |
'readme.txt' |
|
8968 |
'Readme.txt' |
|
8969 |
'Info.txt' |
|
8970 |
'info.txt' |
|
8971 |
'INFO.TXT' |
|
8972 |
) do:[:f | |
|
5883 | 8973 |
|n| |
4414 | 8974 |
|
5880 | 8975 |
n := dir construct:f. |
4414 | 8976 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
8977 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
8978 |
] |
|
3892 | 8979 |
]. |
8980 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8981 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8982 |
|
12497 | 8983 |
hasPackageDirectorySelected |
8984 |
|dir| |
|
8985 |
||
8986 |
dir := self currentDirectory. |
|
8987 |
^ dir notNil |
|
8988 |
and:[ dir exists |
|
8989 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
8990 |
! |
|
8991 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8992 |
parentDirectoriesOfCurrentFiles |
11743 | 8993 |
^ self currentSelectedObjects |
8994 |
collect:[:file | file directory] as:Set |
|
7560 | 8995 |
|
8996 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 8997 |
! |
8998 |
||
8999 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 9000 |
^ true. "/ the code below is too slow for a menu enabling operation |
9001 |
||
9002 |
"/ |directories| |
|
9003 |
"/ |
|
9004 |
"/ directories := self currentDirectories value. |
|
9005 |
"/ directories do:[:dir| |
|
9006 |
"/ [ |
|
9007 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
9008 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
9009 |
"/ ] |
|
9010 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
9011 |
"/ ]. |
|
9012 |
"/ ^ false. |
|
6586 | 9013 |
! |
9014 |
||
9015 |
recursiveAnySTFilesPresent |
|
9016 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 9017 |
! ! |
9018 |
||
9019 |
!AbstractFileBrowser methodsFor:'selection'! |
|
9020 |
||
9021 |
currentSelectedDirectories |
|
6725 | 9022 |
^ self currentDirectoriesValue. |
3982 | 9023 |
! |
9024 |
||
9025 |
currentSelectedFiles |
|
12824 | 9026 |
^ self currentSelectedObjects reject:[:file | file isDirectory]. |
7560 | 9027 |
|
9028 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 9029 |
! |
9030 |
||
6460 | 9031 |
currentSelectedObjects |
9032 |
^ self currentFileNameHolder value |
|
9033 |
! |
|
9034 |
||
3982 | 9035 |
firstSelectedFile |
7560 | 9036 |
^ self currentSelectedObjects |
12102 | 9037 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9038 |
ifNone:[]. |
7560 | 9039 |
|
9040 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 9041 |
! |
9042 |
||
9490 | 9043 |
hasOnlyDirectoriesSelected |
9044 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
9045 |
||
9046 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
9047 |
! |
|
9048 |
||
4414 | 9049 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9050 |
|
7560 | 9051 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
9052 |
||
9053 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 9054 |
! |
9055 |
||
9490 | 9056 |
hasTwoDirectoriesSelected |
9057 |
||
9058 |
^ self currentSelectedObjects size == 2 |
|
9059 |
and:[self hasOnlyDirectoriesSelected] |
|
9060 |
||
9061 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
9062 |
! |
|
9063 |
||
4414 | 9064 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9065 |
|
7560 | 9066 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
9067 |
and:[self hasOnlyFilesSelected] |
7560 | 9068 |
|
9069 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
14577 | 9070 |
! |
9071 |
||
9072 |
selectNextFile |
|
9073 |
self |
|
9074 |
applicationNamed:#DirectoryContentsBrowser |
|
9075 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectNextFile ]]. |
|
9076 |
! |
|
9077 |
||
9078 |
selectPreviousFile |
|
9079 |
self |
|
9080 |
applicationNamed:#DirectoryContentsBrowser |
|
9081 |
ifPresentDo:[:appl | appl ~~ self ifTrue:[ appl selectPreviousFile ]]. |
|
3892 | 9082 |
! ! |
9083 |
||
3964 | 9084 |
!AbstractFileBrowser methodsFor:'sorting'! |
9085 |
||
3989 | 9086 |
currentSortOrder |
4027 | 9087 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 9088 |
! |
9089 |
||
9090 |
sortBlockHolder |
|
9091 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 9092 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9093 |
selector:#fileName |
|
9094 |
sortCaseless:self sortCaseless value |
|
9095 |
sortReverse:false) asValue. |
|
3989 | 9096 |
]. |
9097 |
! |
|
9098 |
||
9099 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9100 |
|v| |
4027 | 9101 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9102 |
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
|
9103 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
9104 |
^ v. |
3989 | 9105 |
! |
9106 |
||
9107 |
sortCaseless |
|
4201 | 9108 |
" aspect for sort caseless " |
3989 | 9109 |
|
13000 | 9110 |
^ self |
9111 |
aspectFor:#sortCaseless |
|
9112 |
ifAbsent:[ (Filename isCaseSensitive not) asValue ] |
|
3989 | 9113 |
! |
9114 |
||
4074 | 9115 |
sortDirectoriesBeforeFiles |
9116 |
||
4201 | 9117 |
" aspect for sort directories always before files" |
4074 | 9118 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
9119 |
! |
|
9120 |
||
3989 | 9121 |
sortFileListsBy:instanceName |
9122 |
||
9123 |
self sortFileListsBy:instanceName withReverse:true |
|
9124 |
! |
|
9125 |
||
9126 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
9127 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 9128 |
|
9129 |
aSymbol := instanceName asSymbol. |
|
4027 | 9130 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 9131 |
sortCaselessLocal := self sortCaseless value. |
4027 | 9132 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9133 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9134 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 9135 |
currentSortOrder at:#column put:aSymbol. |
9136 |
currentSortOrder at:#reverse put:false. |
|
9137 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 9138 |
] ifFalse:[ |
4343 | 9139 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
9140 |
"/ sort caseless changed |
|
9141 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
9142 |
] ifFalse:[ |
|
9143 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
9144 |
"/ same column like before - change sort order ifReverse is true |
|
9145 |
aBoolean ifTrue:[ |
|
9146 |
isReverse := currentSortOrder at:#reverse. |
|
9147 |
currentSortOrder at:#reverse put:(isReverse not). |
|
9148 |
]. |
|
9149 |
] ifFalse:[ |
|
9150 |
"/ another column - remark column |
|
9151 |
currentSortOrder at:#column put:aSymbol. |
|
9152 |
] |
|
9153 |
] |
|
3964 | 9154 |
]. |
4027 | 9155 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
9156 |
|
5383 | 9157 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
9158 |
selector:instanceName |
|
9159 |
sortCaseless:sortCaselessLocal |
|
9160 |
sortReverse:(currentSortOrder at:#reverse). |
|
9161 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9162 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
9163 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 9164 |
! ! |
9165 |
||
3892 | 9166 |
!AbstractFileBrowser methodsFor:'startup & release'! |
9167 |
||
9168 |
makeDependent |
|
4074 | 9169 |
self filterModel addDependent:self. |
4004 | 9170 |
self currentFileNameHolder addDependent:self. |
4074 | 9171 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 9172 |
self sortCaseless addDependent:self. |
4011 | 9173 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
9174 |
self rootHolder addDependent:self. |
3892 | 9175 |
! |
9176 |
||
9177 |
masterApplication:anApplication |
|
9178 |
||
9179 |
masterApplication isNil ifTrue:[ |
|
4414 | 9180 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
9181 |
aspects := anApplication aspects |
|
9182 |
] ifFalse:[ |
|
9183 |
aspects isNil ifTrue:[ |
|
9184 |
aspects := IdentityDictionary new. |
|
9185 |
aspects at:#applications put:(IdentityDictionary new). |
|
9186 |
] |
|
9187 |
]. |
|
9188 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9189 |
"/ self makeDependent. |
3892 | 9190 |
]. |
3952 | 9191 |
^ super masterApplication:anApplication. |
3892 | 9192 |
! |
9193 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9194 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9195 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9196 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9197 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
9198 |
|
3892 | 9199 |
postOpenWith:aBuilder |
9200 |
||
9201 |
super postOpenWith:aBuilder. |
|
14655 | 9202 |
"/ now done for all windowGroups by the group itself |
9203 |
"/ self windowGroup showWaitCursorWhenBusyForMillis:100. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9204 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
9205 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 9206 |
! ! |
9207 |
||
9208 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
9209 |
||
9210 |
files |
|
9211 |
"return the value of the instance variable 'files' (automatically generated)" |
|
9212 |
||
9213 |
^ files |
|
9214 |
! |
|
9215 |
||
9216 |
files:something |
|
9217 |
"set the value of the instance variable 'files' (automatically generated)" |
|
9218 |
||
9219 |
files := something. |
|
9220 |
! |
|
9221 |
||
9222 |
method |
|
9223 |
"return the value of the instance variable 'method' (automatically generated)" |
|
9224 |
||
9225 |
^ method |
|
9226 |
! |
|
9227 |
||
9228 |
method:something |
|
9229 |
"set the value of the instance variable 'method' (automatically generated)" |
|
9230 |
||
9231 |
method := something. |
|
9232 |
! ! |
|
9233 |
||
9234 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
9235 |
||
9236 |
locked |
|
9237 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
9238 |
||
9239 |
locked isNil ifTrue:[ |
|
4414 | 9240 |
locked := false. |
3892 | 9241 |
]. |
9242 |
^ locked |
|
9243 |
! ! |
|
9244 |
||
9245 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
9246 |
||
9247 |
doIfUnLocked:aBlock |
|
9248 |
||
9249 |
self locked ifFalse:[ |
|
4414 | 9250 |
aBlock value. |
3892 | 9251 |
]. |
9252 |
! |
|
9253 |
||
9254 |
doLocked:aBlock |
|
9255 |
||
9256 |
locked := true. |
|
4004 | 9257 |
aBlock ensure:[ |
4414 | 9258 |
locked := false. |
4004 | 9259 |
] |
3892 | 9260 |
! ! |
9261 |
||
3952 | 9262 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
9263 |
||
6369 | 9264 |
defaultHistorySize |
9265 |
^ 50 |
|
3892 | 9266 |
! ! |
9267 |
||
6371 | 9268 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 9269 |
|
9270 |
new |
|
6371 | 9271 |
^ (super new) initializeHistory. |
6369 | 9272 |
! ! |
9273 |
||
9274 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
9275 |
||
9276 |
historySize |
|
9277 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
9278 |
^ historySize |
|
9279 |
! |
|
9280 |
||
9281 |
historySize:aNumber |
|
9282 |
historySize := aNumber |
|
4032 | 9283 |
! ! |
9284 |
||
3892 | 9285 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
9286 |
||
3952 | 9287 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9288 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9289 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9290 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9291 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9292 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
9293 |
pathToAdd := pathToAdd copyButLast:(Filename separator asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9294 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9295 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9296 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9297 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9298 |
self backForwardListAdd:pathToAdd. |
3952 | 9299 |
item isNil ifTrue:[ |
4347 | 9300 |
" not already in history" |
6369 | 9301 |
self size >= self historySize ifTrue:[ |
4347 | 9302 |
self removeLast. |
9303 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9304 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 9305 |
] ifFalse:[ |
4347 | 9306 |
"already been there before; move the entry to |
9307 |
the beginning, so it will fall out later." |
|
9308 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9309 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9310 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9311 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9312 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 9313 |
! |
9314 |
||
4347 | 9315 |
backForwardListAdd:aPath |
9316 |
|pathIndex| |
|
9317 |
||
9318 |
pathIndex := backForwardList indexOf:aPath. |
|
9319 |
pathIndex == 0 ifTrue:[ |
|
9320 |
" a new path comes in remove forward paths " |
|
9321 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
9322 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
9323 |
]. |
|
9324 |
] ifFalse:[ |
|
9325 |
backForwardList remove:aPath. |
|
9326 |
pathIndex <= backForwardIndex ifTrue:[ |
|
9327 |
backForwardIndex := backForwardIndex - 1. |
|
9328 |
] |
|
4022 | 9329 |
]. |
4347 | 9330 |
backForwardList add:aPath afterIndex:backForwardIndex. |
9331 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 9332 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 9333 |
backForwardList removeFirst. |
9334 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 9335 |
]. |
4347 | 9336 |
! |
9337 |
||
9338 |
goBackward |
|
4288 | 9339 |
"return the first path of the backward list; |
9340 |
remove it from the back list and add it ti the forward list." |
|
4022 | 9341 |
|
4347 | 9342 |
|retPath| |
9343 |
||
9344 |
self canBackward ifTrue:[ |
|
9345 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
9346 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 9347 |
]. |
4022 | 9348 |
^ retPath. |
9349 |
! |
|
9350 |
||
9351 |
goForward |
|
4288 | 9352 |
"return the first path of the forward list; |
9353 |
remove it from the list." |
|
4022 | 9354 |
|
4347 | 9355 |
|retPath| |
9356 |
||
9357 |
self canForward ifTrue:[ |
|
9358 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9359 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9360 |
]. |
4022 | 9361 |
^ retPath. |
9362 |
! |
|
9363 |
||
9364 |
resetForwardBackward |
|
9365 |
||
4347 | 9366 |
self initialize |
4022 | 9367 |
! |
9368 |
||
9369 |
setPosition:aPosition for:aPath |
|
9370 |
||
9371 |
self do:[:item| |
|
4414 | 9372 |
item path = aPath ifTrue:[ |
9373 |
item position:aPosition. |
|
9374 |
] |
|
4022 | 9375 |
]. |
3892 | 9376 |
! ! |
9377 |
||
4870 | 9378 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9379 |
|
6371 | 9380 |
initializeHistory |
4032 | 9381 |
|
4347 | 9382 |
backForwardList := OrderedCollection new. |
9383 |
self reverseDo:[:el| |
|
9384 |
backForwardList add:el path. |
|
9385 |
]. |
|
9386 |
backForwardIndex := backForwardList size. |
|
4032 | 9387 |
! ! |
9388 |
||
3892 | 9389 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9390 |
||
4288 | 9391 |
canBackward |
4347 | 9392 |
|
9393 |
^ backForwardIndex > 1 |
|
4288 | 9394 |
! |
9395 |
||
3892 | 9396 |
canForward |
4347 | 9397 |
|
9398 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9399 |
! |
|
9400 |
||
9401 |
getBackCollection |
|
9402 |
||
9403 |
| backCol | |
|
9404 |
||
9405 |
backCol := OrderedCollection new. |
|
9406 |
self canBackward ifTrue:[ |
|
9407 |
| tmpCol | |
|
9408 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9409 |
tmpCol reverseDo:[ :el| |
|
9410 |
backCol add:el. |
|
9411 |
] |
|
9412 |
]. |
|
9413 |
^ backCol |
|
3952 | 9414 |
! |
9415 |
||
9416 |
getForwardCollection |
|
9417 |
||
4347 | 9418 |
| forwCol | |
9419 |
||
9420 |
forwCol := OrderedCollection new. |
|
9421 |
self canForward ifTrue:[ |
|
9422 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9423 |
]. |
|
9424 |
^ forwCol |
|
3952 | 9425 |
! |
9426 |
||
9427 |
getItemFor:aPath |
|
6627 | 9428 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9429 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9430 |
"/ ^ nil. |
|
3952 | 9431 |
! |
9432 |
||
9433 |
getPositionFor:aPath |
|
9434 |
||
9435 |
|item| |
|
9436 |
||
9437 |
item := self getItemFor:aPath. |
|
9438 |
||
9439 |
item notNil ifTrue:[ |
|
4414 | 9440 |
^ item position. |
3952 | 9441 |
]. |
9442 |
^ nil |
|
9443 |
! |
|
9444 |
||
9445 |
includesPath:aPath |
|
6627 | 9446 |
^ self contains:[:item | item path = aPath]. |
9447 |
||
9448 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
9449 |
"/ ^ false. |
|
4347 | 9450 |
! |
9451 |
||
9452 |
nextBackwardItem |
|
9453 |
"return the first path of the backward list" |
|
9454 |
||
9455 |
|retPath| |
|
9456 |
||
9457 |
self canBackward ifTrue:[ |
|
9458 |
retPath := backForwardList at:backForwardIndex. |
|
9459 |
]. |
|
9460 |
^ retPath. |
|
9461 |
! |
|
9462 |
||
9463 |
nextForwardItem |
|
9464 |
"return the first path of the forward list" |
|
9465 |
||
9466 |
|retPath| |
|
9467 |
||
9468 |
self canForward ifTrue:[ |
|
9469 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9470 |
]. |
|
9471 |
^ retPath. |
|
3952 | 9472 |
! ! |
9473 |
||
9474 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
9475 |
||
9476 |
path:aPath |
|
9477 |
||
9478 |
^ self new path:aPath |
|
9479 |
! ! |
|
9480 |
||
9481 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
9482 |
||
6433 | 9483 |
asFilename |
9484 |
^ path asFilename |
|
9485 |
! |
|
9486 |
||
3952 | 9487 |
path |
9488 |
"return the value of the instance variable 'path' (automatically generated)" |
|
9489 |
||
9490 |
^ path |
|
9491 |
! |
|
9492 |
||
9493 |
path:something |
|
9494 |
"set the value of the instance variable 'path' (automatically generated)" |
|
9495 |
||
9496 |
path := something. |
|
9497 |
! |
|
9498 |
||
9499 |
position |
|
9500 |
"return the value of the instance variable 'position' (automatically generated)" |
|
9501 |
||
9502 |
^ position |
|
9503 |
! |
|
9504 |
||
9505 |
position:something |
|
9506 |
"set the value of the instance variable 'position' (automatically generated)" |
|
9507 |
||
9508 |
position := something. |
|
9509 |
! |
|
9510 |
||
9511 |
printString |
|
9512 |
||
9513 |
^ self path asString |
|
3892 | 9514 |
! ! |
9515 |
||
9516 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
9517 |
||
9518 |
withValue:aValue isHolder:aBoolean |
|
9519 |
||
9520 |
| instance | |
|
9521 |
||
9522 |
instance := self basicNew. |
|
9523 |
instance value:aValue. |
|
9524 |
instance isHolder:aBoolean. |
|
9525 |
^ instance |
|
9526 |
! ! |
|
9527 |
||
9528 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
9529 |
||
9530 |
isHolder |
|
9531 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
9532 |
||
9533 |
^ isHolder |
|
9534 |
! |
|
9535 |
||
9536 |
isHolder:something |
|
9537 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
9538 |
||
9539 |
isHolder := something. |
|
9540 |
! |
|
9541 |
||
9542 |
value |
|
9543 |
"return the value of the instance variable 'value' (automatically generated)" |
|
9544 |
||
9545 |
^ value |
|
9546 |
! |
|
9547 |
||
9548 |
value:something |
|
9549 |
"set the value of the instance variable 'value' (automatically generated)" |
|
9550 |
||
9551 |
value := something. |
|
9552 |
! ! |
|
9553 |
||
9554 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
9555 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9556 |
version |
14941 | 9557 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.572 2014-11-28 12:31:39 cg Exp $' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9558 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9559 |
|
8832 | 9560 |
version_CVS |
14941 | 9561 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.572 2014-11-28 12:31:39 cg Exp $' |
3892 | 9562 |
! ! |
12094 | 9563 |