author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 12 Jun 2013 16:47:06 +0100 | |
branch | jv |
changeset 13170 | c9b815af5777 |
parent 12819 | 0ce340e972c4 |
parent 12874 | f08360e7ac62 |
child 13173 | e9da2324940d |
permissions | -rw-r--r-- |
5140 | 1 |
" |
2 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3892 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
14 |
ApplicationModel subclass:#AbstractFileBrowser |
|
4959 | 15 |
instanceVariableNames:'aspects' |
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
16 |
classVariableNames:'VisitedDirectories RuntimeAspects DirectoryBookmarks |
4959 | 17 |
LastEnforcedNameSpace CommandHistory DefaultCommandPerSuffix |
18 |
CommandHistorySize LastFileDiffFile DefaultFilters RootHolder |
|
10306 | 19 |
LastFileSelection LastMoveDestination LastScriptBlockString |
11139 | 20 |
LastMustMatchPattern LastFileDiffDirectory |
21 |
LastMercurialRepository' |
|
4959 | 22 |
poolDictionaries:'' |
23 |
category:'Interface-Tools-File' |
|
3892 | 24 |
! |
25 |
||
26 |
AbstractFileBrowser class instanceVariableNames:'DisabledCursorImage EnabledCursorImage' |
|
27 |
||
28 |
" |
|
29 |
The following class instance variables are inherited by this class: |
|
30 |
||
4959 | 31 |
ApplicationModel - ClassResources |
32 |
Model - |
|
33 |
Object - |
|
3892 | 34 |
" |
35 |
! |
|
36 |
||
37 |
Object subclass:#Clipboard |
|
4959 | 38 |
instanceVariableNames:'method files' |
39 |
classVariableNames:'' |
|
40 |
poolDictionaries:'' |
|
41 |
privateIn:AbstractFileBrowser |
|
3892 | 42 |
! |
43 |
||
44 |
Object subclass:#CodeExecutionLock |
|
4959 | 45 |
instanceVariableNames:'locked' |
46 |
classVariableNames:'' |
|
47 |
poolDictionaries:'' |
|
48 |
privateIn:AbstractFileBrowser |
|
3892 | 49 |
! |
50 |
||
4366 | 51 |
List subclass:#DirectoryHistory |
4959 | 52 |
instanceVariableNames:'forwardList backList lastWasForwardPath lastBackPath lastAddPath |
6369 | 53 |
backForwardList backForwardIndex historySize' |
4959 | 54 |
classVariableNames:'HistorySize' |
55 |
poolDictionaries:'' |
|
56 |
privateIn:AbstractFileBrowser |
|
3952 | 57 |
! |
58 |
||
59 |
Object subclass:#DirectoryHistoryItem |
|
4959 | 60 |
instanceVariableNames:'path position' |
61 |
classVariableNames:'' |
|
62 |
poolDictionaries:'' |
|
63 |
privateIn:AbstractFileBrowser::DirectoryHistory |
|
3892 | 64 |
! |
65 |
||
66 |
Object subclass:#SaveAspectItem |
|
4959 | 67 |
instanceVariableNames:'value isHolder' |
68 |
classVariableNames:'' |
|
69 |
poolDictionaries:'' |
|
70 |
privateIn:AbstractFileBrowser |
|
3892 | 71 |
! |
72 |
||
5140 | 73 |
!AbstractFileBrowser class methodsFor:'documentation'! |
74 |
||
75 |
copyright |
|
76 |
" |
|
77 |
COPYRIGHT (c) 2002 by eXept Software AG |
|
78 |
All Rights Reserved |
|
79 |
||
80 |
This software is furnished under a license and may be used |
|
81 |
only in accordance with the terms of that license and with the |
|
82 |
inclusion of the above copyright notice. This software may not |
|
83 |
be provided or otherwise made available to, or used by, any |
|
84 |
other person. No title to or ownership of the software is |
|
85 |
hereby transferred. |
|
86 |
" |
|
5967 | 87 |
! |
88 |
||
89 |
documentation |
|
90 |
" |
|
91 |
[Author:] |
|
92 |
Christian Penk |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
93 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
94 |
Notice: this certainly needs a redesign - all those abstract-abstract classes which |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
95 |
define stuff which is only needed in some parts makes this hard to understand. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
96 |
Especially the fact, that AbstractFileBrowser defines things both as abstract superclass |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
97 |
and as a container is almost incomprehensable... |
5967 | 98 |
" |
5140 | 99 |
! ! |
3892 | 100 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
101 |
!AbstractFileBrowser class methodsFor:'accessing'! |
3952 | 102 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
103 |
currentSelection |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
104 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
105 |
LastFileSelection isNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
106 |
LastFileSelection := #(). |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
107 |
]. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
108 |
^ LastFileSelection |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
109 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
110 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
111 |
currentSelection:aFilenameCol |
6589 | 112 |
aFilenameCol notEmptyOrNil ifTrue:[ |
12102 | 113 |
LastFileSelection := aFilenameCol collect:[:file | (file ? '') asFilename] |
6589 | 114 |
] |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
115 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
116 |
|
3952 | 117 |
directoryHistory |
118 |
||
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
119 |
VisitedDirectories isNil ifTrue:[ |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
120 |
VisitedDirectories := self directoryHistoryClass new. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
121 |
"/ VisitedDirectories inspect. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
122 |
]. |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
123 |
^ VisitedDirectories |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
124 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
125 |
"Modified: / 21-11-2012 / 08:45:49 / cg" |
3952 | 126 |
! |
127 |
||
128 |
resetClassVars |
|
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
129 |
VisitedDirectories := nil. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
130 |
LastFileSelection := nil. |
5936 | 131 |
|
132 |
" |
|
133 |
AbstractFileBrowser resetClassVars |
|
134 |
" |
|
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
135 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
136 |
"Modified: / 21-11-2012 / 08:45:53 / cg" |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
137 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
138 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
139 |
rootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
140 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
141 |
^ RootHolder |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
142 |
! |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
143 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
144 |
rootHolder:aRoot |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
145 |
|
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
146 |
RootHolder := aRoot |
3952 | 147 |
! ! |
148 |
||
4915 | 149 |
!AbstractFileBrowser class methodsFor:'accessing-bookmarks'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
150 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
151 |
addBookmark:aDirectoryPath |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
152 |
"add aDirectoryPath to the list of our known bookmarks. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
153 |
Do not add duplicates." |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
154 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
155 |
|bookmarks| |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
156 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
157 |
bookmarks := self directoryBookmarks. |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
158 |
(bookmarks includes:aDirectoryPath) ifFalse:[ |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
159 |
bookmarks add:aDirectoryPath asFilename. |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
160 |
]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
161 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
162 |
|
8013 | 163 |
bookmarksFrom:aFileNameOrString |
12390 | 164 |
|bookmarks s fileName line| |
8013 | 165 |
|
166 |
fileName := aFileNameOrString asFilename. |
|
167 |
[ |
|
168 |
s := fileName readStream. |
|
169 |
] on:OpenError do:[:ex| |
|
170 |
^ nil. |
|
171 |
]. |
|
172 |
||
173 |
bookmarks := OrderedCollection new. |
|
174 |
[s atEnd] whileFalse:[ |
|
12390 | 175 |
line := s nextLine. |
176 |
(line startsWith:';') ifFalse:[ |
|
177 |
bookmarks add:(Base64Coder decode:line) asString. |
|
178 |
] |
|
8013 | 179 |
]. |
180 |
s close. |
|
181 |
||
182 |
^ bookmarks |
|
183 |
! |
|
184 |
||
4679 | 185 |
defaultBookMarksFileDirectory |
12390 | 186 |
"the directory, where the default bookmarks are stored (as defaultBookMarksFilename)" |
187 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
188 |
^ Filename homeDirectory |
4679 | 189 |
! |
190 |
||
191 |
defaultBookMarksFilename |
|
12390 | 192 |
"the filename, in which the default bookmarks are stored (in defaultBookMarksDirectory)" |
193 |
||
4679 | 194 |
^ '.fileBrowserBookmarks' |
195 |
! |
|
196 |
||
197 |
directoryBookmarks |
|
198 |
DirectoryBookmarks isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
199 |
self loadBookmarksFrom:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename). |
4679 | 200 |
|
201 |
DirectoryBookmarks isEmptyOrNil ifTrue:[ |
|
202 |
DirectoryBookmarks := OrderedCollection new. |
|
203 |
DirectoryBookmarks add:Filename homeDirectory asAbsoluteFilename. |
|
204 |
DirectoryBookmarks add:Filename currentDirectory asAbsoluteFilename. |
|
205 |
] |
|
206 |
]. |
|
207 |
^ DirectoryBookmarks |
|
208 |
||
209 |
" |
|
5438
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
210 |
DirectoryBookmarks := nil. |
fa19d526d85d
directoryBookmarks must be stored without lineLimit (see base64 encoder)
Claus Gittinger <cg@exept.de>
parents:
5437
diff
changeset
|
211 |
self directoryBookmarks. |
4679 | 212 |
" |
213 |
! |
|
214 |
||
8013 | 215 |
directoryBookmarks: collectionOfFilenames |
216 |
||
217 |
DirectoryBookmarks := collectionOfFilenames. |
|
218 |
self saveBookmarksInDefaultBookmarksFile. |
|
219 |
! |
|
220 |
||
221 |
editBookmarksWithDefault: aFilenameOrNil |
|
222 |
| oldBookmarks newBookmarks | |
|
223 |
||
224 |
oldBookmarks := self directoryBookmarks copy. |
|
225 |
newBookmarks := BookmarksEditDialog openWith: oldBookmarks defaultBookmark: aFilenameOrNil. |
|
226 |
newBookmarks isNil ifTrue:[^ self]. |
|
227 |
self directoryBookmarks: newBookmarks. |
|
9681
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
228 |
|
00195b8c6cf6
comment/format in: #editBookmarksWithDefault:
Claus Gittinger <cg@exept.de>
parents:
9677
diff
changeset
|
229 |
"Modified: / 13-01-2011 / 12:52:28 / cg" |
8013 | 230 |
! |
231 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
232 |
hasBookmarks |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
233 |
^ self directoryBookmarks notEmptyOrNil |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
234 |
! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
235 |
|
4679 | 236 |
loadBookmarksFrom:aFileNameOrString |
8013 | 237 |
|bookmarks| |
238 |
||
239 |
bookmarks := self bookmarksFrom: aFileNameOrString. |
|
240 |
bookmarks isNil ifTrue:[^ self]. |
|
4679 | 241 |
|
242 |
DirectoryBookmarks := OrderedCollection new. |
|
243 |
bookmarks do:[:eachPath | |
|
244 |
self addBookmark:eachPath asFilename |
|
245 |
]. |
|
246 |
! |
|
247 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
248 |
removeBookmark:aDirectoryPath |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
249 |
|bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
250 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
251 |
bookmarks := self directoryBookmarks. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
252 |
bookmarks isEmptyOrNil ifTrue:[ ^ self]. |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
253 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
254 |
bookmarks remove:aDirectoryPath ifAbsent:[]. |
4679 | 255 |
! |
256 |
||
257 |
saveBookmarks |
|
258 |
|fn| |
|
259 |
||
260 |
fn := Dialog |
|
9607 | 261 |
requestFileNameForSave:(self resources string:'Save Bookmarks') |
4679 | 262 |
default:(self defaultBookMarksFilename) |
263 |
fromDirectory:(self defaultBookMarksFileDirectory). |
|
264 |
fn isEmptyOrNil ifTrue:[^ self]. |
|
265 |
||
266 |
self saveBookmarksIn:fn |
|
9607 | 267 |
|
268 |
"Modified: / 27-10-2010 / 11:27:09 / cg" |
|
4679 | 269 |
! |
270 |
||
8013 | 271 |
saveBookmarks: bookmarks in:aFileNameOrString |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
272 |
"save the bokmarks in aFileNameOrString. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
273 |
Use Base64 coding" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
274 |
|
8013 | 275 |
| bookmarkStream fileName coder| |
4679 | 276 |
|
277 |
fileName := aFileNameOrString asFilename. |
|
278 |
fileName exists ifTrue:[ |
|
279 |
fileName renameTo:(fileName withSuffix:'sav'). |
|
280 |
]. |
|
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
281 |
bookmarkStream := fileName writeStream. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
282 |
|
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
283 |
"save each bookmark in one line" |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
284 |
coder := (Base64Coder on:bookmarkStream) lineLimit:nil. |
4679 | 285 |
bookmarks do:[:eachPath | |
6114
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
286 |
eachPath asFilename pathName acceptVisitor:coder. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
287 |
coder flush. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
288 |
bookmarkStream cr. |
36fb19194510
Rename Base64Coder>>#decodingOf: to #decode:
Stefan Vogel <sv@exept.de>
parents:
6113
diff
changeset
|
289 |
]. |
12391 | 290 |
bookmarkStream syncData; close. |
5960 | 291 |
! |
292 |
||
8013 | 293 |
saveBookmarksIn:aFileNameOrString |
294 |
"save the bokmarks in aFileNameOrString. |
|
295 |
Use Base64 coding" |
|
296 |
||
297 |
| bookmarks | |
|
298 |
||
299 |
bookmarks := self directoryBookmarks. |
|
300 |
self saveBookmarks: bookmarks in:aFileNameOrString |
|
301 |
! |
|
302 |
||
5960 | 303 |
saveBookmarksInDefaultBookmarksFile |
304 |
self saveBookmarksIn:(self defaultBookMarksFileDirectory construct:self defaultBookMarksFilename) |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
305 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
306 |
|
4915 | 307 |
!AbstractFileBrowser class methodsFor:'accessing-classes'! |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
308 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
309 |
directoryHistoryClass |
12062
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
310 |
^ DirectoryHistory |
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
311 |
|
0056d17cf012
conflict classVar vs. private class
Claus Gittinger <cg@exept.de>
parents:
11996
diff
changeset
|
312 |
"Modified: / 21-11-2012 / 08:46:34 / cg" |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
313 |
! ! |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
314 |
|
3892 | 315 |
!AbstractFileBrowser class methodsFor:'defaults'! |
316 |
||
317 |
commandHistory |
|
318 |
||
319 |
CommandHistory isNil ifTrue:[ |
|
4414 | 320 |
CommandHistory := OrderedCollection new. |
3892 | 321 |
]. |
322 |
^ CommandHistory |
|
323 |
! |
|
324 |
||
325 |
commandHistorySize |
|
4190 | 326 |
"max no of entries in the HistoryList " |
6369 | 327 |
|
3892 | 328 |
CommandHistorySize isNil ifTrue:[ |
6369 | 329 |
CommandHistorySize := 150 |
3892 | 330 |
]. |
331 |
^ CommandHistorySize |
|
332 |
! |
|
333 |
||
334 |
defaultFilterList |
|
335 |
||
336 |
DefaultFilters isNil ifTrue:[ |
|
4414 | 337 |
DefaultFilters := #( '*' |
338 |
'*.st' |
|
339 |
'*.[h,c]*' |
|
12760 | 340 |
'*.txt; *.htm*' |
341 |
'*.gif; *.xpm; *.jpg; *.png' |
|
342 |
'~*o; ~*.obj; ~*.dll;' |
|
4414 | 343 |
) |
3892 | 344 |
]. |
345 |
^ DefaultFilters. |
|
12760 | 346 |
|
347 |
" |
|
348 |
DefaultFilters := nil |
|
349 |
" |
|
3892 | 350 |
! |
351 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
352 |
initialCommandFor:fileName in:aDirectory intoBox:aBox |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
353 |
"set a useful initial command in an execute box." |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
354 |
|
4523 | 355 |
|mime cmd select path suffix baseName pathName| |
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
356 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
357 |
path := aDirectory filenameFor:fileName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
358 |
baseName := path baseName. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
359 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
360 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
361 |
mime := MIMETypes mimeTypeForSuffix:suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
362 |
"/ mime notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
363 |
"/ cmd := self initialCommandForMIME:mime file:path |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
364 |
"/ ]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
365 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
366 |
"/ XXX should be changed to take stuff from a config file |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
367 |
"/ XXX or from resources. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
368 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
369 |
(path type == #regular) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
370 |
path isExecutableProgram ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
371 |
aBox initialText:(path pathName , ' <arguments>'). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
372 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
373 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
374 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
375 |
select := true. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
376 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
377 |
"some heuristics - my personal preferences ... |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
378 |
(actually this should come from a configfile)" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
379 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
380 |
(baseName endsWith:'akefile') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
381 |
aBox initialText:'make target' selectFrom:6 to:11. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
382 |
^ self |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
383 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
384 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
385 |
cmd := MIMETypes defaultCommandPerMIME at:mime ifAbsent:nil. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
386 |
cmd notNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
387 |
select := false |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
388 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
389 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
390 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
391 |
suffix := path suffix. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
392 |
(suffix = 'C') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
393 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
394 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
395 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
396 |
suffix := suffix asLowercase. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
397 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
398 |
(suffix = 'taz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
399 |
aBox initialText:'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
400 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
401 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
402 |
(suffix = 'tar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
403 |
cmd := 'tar tvf %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
404 |
select := 7. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
405 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
406 |
(suffix = 'zoo') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
407 |
cmd := 'zoo -list %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
408 |
select := 9. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
409 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
410 |
(suffix = 'zip') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
411 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
412 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
413 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
414 |
(suffix = 'jar') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
415 |
cmd := 'unzip -l %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
416 |
select := 8. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
417 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
418 |
(suffix = 'z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
419 |
(baseName asLowercase endsWith:'tar.z') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
420 |
cmd := 'zcat %1 | tar tvf -'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
421 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
422 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
423 |
cmd := 'uncompress %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
424 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
425 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
426 |
(suffix = 'gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
427 |
(baseName asLowercase endsWith:'tar.gz') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
428 |
cmd := ('gunzip < %1 | tar tvf -' ). |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
429 |
select := false. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
430 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
431 |
cmd := 'gunzip %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
432 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
433 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
434 |
(suffix = 'html') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
435 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
436 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
437 |
(suffix = 'htm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
438 |
cmd := 'netscape %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
439 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
440 |
(suffix = 'uue') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
441 |
cmd := 'uudecode %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
442 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
443 |
(suffix = 'c') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
444 |
cmd := 'cc -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
445 |
select := 5. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
446 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
447 |
(suffix = 'cc') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
448 |
cmd := 'g++ -c %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
449 |
select := 6. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
450 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
451 |
(suffix = 'xbm') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
452 |
cmd := 'bitmap %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
453 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
454 |
(suffix = 'ps') ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
455 |
cmd := 'ghostview %1' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
456 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
457 |
((suffix = '1') or:[suffix = 'man']) ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
458 |
cmd := 'nroff -man %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
459 |
select := 10. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
460 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
461 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
462 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
463 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
464 |
cmd isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
465 |
DefaultCommandPerSuffix isNil ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
466 |
cmd := '<cmd>' |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
467 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
468 |
cmd := DefaultCommandPerSuffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
469 |
at:suffix |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
470 |
ifAbsent:'<cmd>'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
471 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
472 |
cmd := cmd , ' %1'. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
473 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
474 |
|
4523 | 475 |
pathName := path pathName. |
476 |
OperatingSystem isUNIXlike ifTrue:[ |
|
477 |
pathName includesSeparator ifTrue:[ |
|
478 |
pathName := '"' , pathName , '"' |
|
479 |
] |
|
480 |
]. |
|
481 |
||
482 |
cmd := cmd bindWith:pathName. |
|
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
483 |
select == false ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
484 |
aBox initialText:cmd |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
485 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
486 |
select class == Interval ifTrue:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
487 |
aBox initialText:cmd selectFrom:select start to:select stop |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
488 |
] ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
489 |
select isInteger ifFalse:[ |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
490 |
select := (cmd indexOf:Character space ifAbsent:[cmd size + 1]) - 1. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
491 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
492 |
aBox initialText:cmd selectFrom:1 to:select |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
493 |
]. |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
494 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
495 |
] |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
496 |
|
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
497 |
"Modified: / 24.9.1997 / 16:34:52 / stefan" |
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
498 |
"Modified: / 9.4.1998 / 17:15:57 / cg" |
3892 | 499 |
! |
500 |
||
5941 | 501 |
listOfRuntimeValuesToRemember |
502 |
" list of all aspects that will be remembered after closing a FileBrowserV2" |
|
503 |
||
504 |
^ #( |
|
505 |
"/ #filterModel |
|
506 |
#enableFileHistory |
|
507 |
#fileHistory |
|
508 |
#currentSortOrder |
|
509 |
#sortBlockProperty |
|
510 |
) |
|
3892 | 511 |
! |
512 |
||
513 |
resetAspects |
|
514 |
||
515 |
RuntimeAspects := nil. |
|
516 |
||
5941 | 517 |
" |
518 |
self resetAspects |
|
519 |
" |
|
3892 | 520 |
! |
521 |
||
522 |
runtimeAspects |
|
523 |
||
524 |
RuntimeAspects isNil ifTrue:[ |
|
4414 | 525 |
RuntimeAspects := Dictionary new. |
3892 | 526 |
]. |
527 |
^ RuntimeAspects |
|
528 |
! |
|
529 |
||
4201 | 530 |
userPreferencesAspectList |
531 |
" list of all aspects that will be saved with save settings |
|
532 |
that aspects will be image consistent if the settings are saved in Launcher |
|
11501 | 533 |
don't forget to add a access methods in UserPreferences if you add a aspect here |
4201 | 534 |
" |
535 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
536 |
^ Dictionary |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
537 |
withKeysAndValues:#( |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
538 |
viewDirsInContentsBrowser true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
539 |
showDirectoryTree true |
11501 | 540 |
showHiddenFiles true |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
541 |
viewDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
542 |
viewDetails true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
543 |
viewDirectoryDescription false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
544 |
viewFilesInDirectoryTree false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
545 |
viewGroup false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
546 |
viewOwner false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
547 |
viewPermissions false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
548 |
viewPreview false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
549 |
viewSize true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
550 |
viewSizeInKiloBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
551 |
viewSizeInBytes false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
552 |
viewTime true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
553 |
viewType false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
554 |
openMultipleApplicationsForType false |
7788 | 555 |
filenameEntryFieldVisibleHolder true |
556 |
toolBarVisibleHolder true |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
557 |
sortDirectoriesBeforeFiles true |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
558 |
openAlwaysInTextEditor false |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
559 |
sortCaseless false |
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
560 |
useCodeView2InTools true |
4201 | 561 |
) |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
562 |
|
11501 | 563 |
"Modified: / 11-05-2012 / 09:22:04 / cg" |
3892 | 564 |
! ! |
565 |
||
5398 | 566 |
!AbstractFileBrowser class methodsFor:'help specs'! |
567 |
||
8261 | 568 |
basicFlyByHelpSpec |
6099 | 569 |
<resource: #help> |
570 |
||
8261 | 571 |
^ super flyByHelpSpec addPairsFrom:#( |
6099 | 572 |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
573 |
#lockFileEncoding |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
574 |
'Do not guess the encoding from the file''s contents.' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
575 |
|
6100 | 576 |
#closeTabButton |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
577 |
'Close this tab' |
6100 | 578 |
|
6099 | 579 |
#addTerminal |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
580 |
'Add a Shell terminal view' |
6099 | 581 |
|
582 |
#make |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
583 |
'Call the make command' |
6099 | 584 |
|
585 |
#searchFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
586 |
'Search a file' |
6099 | 587 |
|
588 |
#directoryUp |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
589 |
'Directory up' |
6099 | 590 |
|
591 |
#directoryBack |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
592 |
'Directory back' |
6099 | 593 |
|
594 |
#directoryForward |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
595 |
'Directory forward' |
6099 | 596 |
|
597 |
#directoryHistory |
|
598 |
'Directory' |
|
599 |
||
600 |
#copyFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
601 |
'Copy the selected file(s)' |
6099 | 602 |
|
603 |
#cutFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
604 |
'Cut the selected file(s)' |
6099 | 605 |
|
606 |
#editFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
607 |
'Edit the selected file' |
6099 | 608 |
|
609 |
#fileHome |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
610 |
'Goto home directory' |
6099 | 611 |
|
8093 | 612 |
#fileDesktop |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
613 |
'Goto desktop directory' |
8093 | 614 |
|
6099 | 615 |
#fileGotoDefault |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
616 |
'Goto default directory (ST/X start directory)' |
6099 | 617 |
|
6454 | 618 |
#fileGotoSmalltalkDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
619 |
'Goto Smalltalk directory (ST/X application)' |
6454 | 620 |
|
6456 | 621 |
#fileGotoDefaultDirectory |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
622 |
'Goto current directory' |
6456 | 623 |
|
6099 | 624 |
#pasteFile |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
625 |
'Paste file(s)' |
6099 | 626 |
|
627 |
#deleteFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
628 |
'Delete the selected file(s)' |
6099 | 629 |
|
630 |
#fileIn |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
631 |
'File in' |
6099 | 632 |
|
633 |
#fileHistory |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
634 |
'File history' |
6099 | 635 |
|
636 |
#fileGotoBookmark |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
637 |
'Goto bookmarked directory' |
6099 | 638 |
|
639 |
#hideToolBar |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
640 |
'Hide toolbar' |
6099 | 641 |
|
642 |
#hideFilenameEntryField |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
643 |
'Hide filename & filter fields' |
6099 | 644 |
|
645 |
#openChangeBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
646 |
'Open a Changebrowser on file' |
6099 | 647 |
|
648 |
#showFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
649 |
'Show file details' |
6099 | 650 |
|
651 |
#hideFileDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
652 |
'Hide file details' |
6099 | 653 |
|
654 |
#toggleDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
655 |
'Show/hide file details' |
6099 | 656 |
|
657 |
#viewDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
658 |
'Show/hide file details' |
6099 | 659 |
|
660 |
#selectDetails |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
661 |
'Select file details to be shown' |
6099 | 662 |
|
8088 | 663 |
#showDifferences |
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
664 |
'Show differences between file and editor versions' |
8088 | 665 |
|
666 |
#toggleHexDisplay |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
667 |
'Toggle between hexadecimal and textual representation' |
8088 | 668 |
|
669 |
#findInBrowser |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
670 |
'Navigate the browser''s file list to the edited file' |
8088 | 671 |
|
672 |
#saveFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
673 |
'Save the editor''s contents into the file' |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
674 |
|
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
675 |
#saveFileAs |
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
676 |
'Save the editor''s contents into another file' |
8088 | 677 |
|
678 |
#reloadFile |
|
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
679 |
'Reload from the file' |
8088 | 680 |
|
681 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
682 |
'Send to the printer' |
8088 | 683 |
|
6099 | 684 |
). |
685 |
||
8261 | 686 |
" |
687 |
self flyByHelpSpec |
|
688 |
" |
|
689 |
||
10775
d5be49adfc5e
changed: #basicFlyByHelpSpec
Claus Gittinger <cg@exept.de>
parents:
10762
diff
changeset
|
690 |
"Modified: / 06-10-2011 / 14:55:27 / cg" |
8261 | 691 |
! |
692 |
||
693 |
flyByHelpSpec |
|
694 |
<resource: #programHelp> |
|
695 |
||
696 |
|spec hist resources| |
|
697 |
||
698 |
spec := self basicFlyByHelpSpec. |
|
699 |
||
700 |
"/ add help items for the history |
|
6099 | 701 |
hist := self directoryHistory. |
702 |
hist notNil ifTrue:[ |
|
703 |
resources := self classResources. |
|
704 |
hist canForward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
705 |
spec at:#directoryForward put:[ resources string:'Forward to: %1' with:hist nextForwardItem ]. |
6099 | 706 |
]. |
707 |
hist canBackward ifTrue:[ |
|
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
708 |
spec at:#directoryBack put:[ resources string:'Back to: %1' with:hist nextBackwardItem ]. |
6099 | 709 |
]. |
710 |
]. |
|
711 |
^ spec. |
|
712 |
||
713 |
" |
|
714 |
self flyByHelpSpec |
|
715 |
" |
|
716 |
||
7879
9c64dea1b14a
block as a flyByHelpText item.
Claus Gittinger <cg@exept.de>
parents:
7869
diff
changeset
|
717 |
"Modified: / 03-11-2007 / 12:05:01 / cg" |
5398 | 718 |
! ! |
719 |
||
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
720 |
!AbstractFileBrowser class methodsFor:'image specs'! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
721 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
722 |
clearHistoryIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
723 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
724 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
725 |
^ Icon deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
726 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
727 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
728 |
copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
729 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
730 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
731 |
^ ToolbarIconLibrary copyIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
732 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
733 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
734 |
cutIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
735 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
736 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
737 |
^ ToolbarIconLibrary cut20x20Icon2 "cut28x28Icon" |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
738 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
739 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
740 |
deleteIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
741 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
742 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
743 |
^ ToolbarIconLibrary erase20x20Icon "/ delete28x28Icon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
744 |
! |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
745 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
746 |
directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
747 |
<resource: #programImage> |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
748 |
|
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
749 |
^ ToolbarIconLibrary directoryUpIcon |
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
750 |
! |
3892 | 751 |
|
6337 | 752 |
disabledCursorIcon |
753 |
"This resource specification was automatically generated |
|
754 |
by the ImageEditor of ST/X." |
|
755 |
||
756 |
"Do not manually edit this!! If it is corrupted, |
|
757 |
the ImageEditor may not be able to read the specification." |
|
758 |
||
759 |
" |
|
760 |
self disabledCursorImage inspect |
|
761 |
ImageEditor openOnClass:self andSelector:#disabledCursorImage |
|
762 |
Icon flushCachedIcons |
|
763 |
" |
|
764 |
||
765 |
<resource: #image> |
|
766 |
||
767 |
^Icon |
|
8473 | 768 |
constantNamed:#'AbstractFileBrowser class disabledCursorIcon' |
6337 | 769 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
770 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@XF@@@H@P@@DOB@@BLLP@AA@"@@RHD @H1AD@BRHI@@$QBP@IBH$@BPQI@@"BLP@D QH@ADBB@@H0Q@@AC |
|
771 |
8 @@H@P@@A X@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
772 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@_ @@@_>@@@O?0@@G?>@@C<O0@A?@>@@_8G @O?A<@C38O@@<_C0@OC8<@C0_O@@>C?0@G _8@A<C>@@O0_@@A? |
|
773 |
? @@O?0@@A?8@@@G8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
774 |
! |
|
775 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
776 |
disabledCursorImage |
6337 | 777 |
"/ DisabledCursorImage isNil ifTrue:[ |
778 |
"/ DisabledCursorImage := self disabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/no_entry.xpm' |
|
779 |
"/ ]. |
|
3892 | 780 |
^ DisabledCursorImage |
781 |
! |
|
782 |
||
6337 | 783 |
enabledCursorIcon |
784 |
"This resource specification was automatically generated |
|
785 |
by the ImageEditor of ST/X." |
|
786 |
||
787 |
"Do not manually edit this!! If it is corrupted, |
|
788 |
the ImageEditor may not be able to read the specification." |
|
789 |
||
790 |
" |
|
791 |
self enabledCursorImage inspect |
|
792 |
ImageEditor openOnClass:self andSelector:#enabledCursorImage |
|
793 |
Icon flushCachedIcons |
|
794 |
" |
|
795 |
||
796 |
<resource: #image> |
|
797 |
||
798 |
^Icon |
|
8473 | 799 |
constantNamed:#'AbstractFileBrowser class enabledCursorIcon' |
6337 | 800 |
ifAbsentPut:[(Depth1Image new) width: 32; height: 32; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
801 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@T@@@@E@@@@AP@@@@@@@@?0_0@@@@@@C?A?@@@@@@@@AP@@@@T@@@@E@@@@A |
|
802 |
P@@@@T@@@@E@@@@AP@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 32; height: 32; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
803 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@@G@@@@A0@@@@\@@@?8?0@O>O<@C?#?@@@G@@@@A0@@@@\@@@@G@@@@A |
|
804 |
0@@@@\@@@@G@@@@A0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; yourself); yourself] |
|
805 |
! |
|
806 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
807 |
enabledCursorImage |
6337 | 808 |
"/ EnabledCursorImage isNil ifTrue:[ |
809 |
"/ EnabledCursorImage := self enabledCursorIcon. "/ Image fromFile:'xpmBitmaps/cursors/double_crossHair.xpm' |
|
810 |
"/ ]. |
|
3892 | 811 |
^ EnabledCursorImage |
6083 | 812 |
! |
813 |
||
3892 | 814 |
fileInIcon |
815 |
<resource: #programImage> |
|
816 |
||
6116 | 817 |
^ ToolbarIconLibrary fileInIcon |
3892 | 818 |
! |
819 |
||
6079 | 820 |
historyBackIcon |
821 |
<resource: #programImage> |
|
822 |
||
823 |
^ ToolbarIconLibrary historyBackIcon |
|
824 |
! |
|
825 |
||
826 |
historyForwardIcon |
|
827 |
<resource: #programImage> |
|
828 |
||
829 |
^ ToolbarIconLibrary historyForwardIcon |
|
830 |
! |
|
831 |
||
3892 | 832 |
homeIcon |
833 |
<resource: #programImage> |
|
834 |
||
6079 | 835 |
^ ToolbarIconLibrary homeIcon |
3892 | 836 |
! |
837 |
||
6074 | 838 |
homeIcon2 |
6079 | 839 |
<resource: #programImage> |
840 |
||
841 |
^ ToolbarIconLibrary homeIcon2 |
|
6074 | 842 |
! |
843 |
||
844 |
htmlReloadIcon |
|
845 |
<resource: #programImage> |
|
846 |
||
847 |
^ ToolbarIconLibrary reload22x22Icon |
|
848 |
! |
|
849 |
||
3892 | 850 |
leftDownIcon |
851 |
"This resource specification was automatically generated |
|
852 |
by the ImageEditor of ST/X." |
|
853 |
||
854 |
"Do not manually edit this!! If it is corrupted, |
|
855 |
the ImageEditor may not be able to read the specification." |
|
856 |
||
857 |
" |
|
858 |
self leftDownIcon inspect |
|
859 |
ImageEditor openOnClass:self andSelector:#leftDownIcon |
|
860 |
" |
|
861 |
||
862 |
<resource: #image> |
|
863 |
||
864 |
^Icon |
|
4414 | 865 |
constantNamed:#'AbstractFileBrowser class leftDownIcon' |
866 |
ifAbsentPut:[(Depth2Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
3892 | 867 |
UUUUUUUUUUUPAUUUUUUUP@UUUUUUUPB!!UUUUUU@B*AUUUUU@B*(UUUUUPB** UUUUPB***AUUUTB***(EUUUB****%UUUR*****UUUUU@*%UUUUUUPJ)UUUU |
868 |
UUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*%UUUUUUPJ)UUUUUUTB*UUUUUUU@*$@@@@AUPJ*****)UTB******UU@******%UPJ*****)UTAUUUU |
|
869 |
UUUU@@@@@@@AUUUUUUUUUP@a') ; colorMapFromArray:#[255 255 255 0 0 0 40 40 100 255 0 0]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
870 |
@@@@@@@@@@@@ @@@@\@@@@O @@@G<@@@C? @@A?<@@@?? @@_?<@@G?? @@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C<@@@@?@@@@O0@@@C??? @???8@O? |
|
871 |
?>@C??? @???8@O??>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
872 |
! |
|
873 |
||
874 |
menuHistoryList9x20Icon |
|
875 |
"This resource specification was automatically generated |
|
876 |
by the ImageEditor of ST/X." |
|
877 |
||
878 |
"Do not manually edit this!! If it is corrupted, |
|
879 |
the ImageEditor may not be able to read the specification." |
|
880 |
||
881 |
" |
|
882 |
self menuHistoryList9x20Icon inspect |
|
883 |
ImageEditor openOnClass:self andSelector:#menuHistoryList9x20Icon |
|
884 |
Icon flushCachedIcons |
|
885 |
" |
|
886 |
||
887 |
<resource: #image> |
|
888 |
||
889 |
^Icon |
|
4414 | 890 |
constantNamed:#'AbstractFileBrowser class menuHistoryList9x20Icon' |
891 |
ifAbsentPut:[(Depth1Image new) width: 9; height: 20; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 9; height: 20; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@A0@G@@\@A0@G@@\@A0@G@@\@A0@G@A?@C8@G@@H@G<@@@@@@@@a') ; yourself); yourself] |
|
3892 | 892 |
! |
893 |
||
894 |
menuHistoryListIcon |
|
895 |
"This resource specification was automatically generated |
|
896 |
by the ImageEditor of ST/X." |
|
897 |
||
898 |
"Do not manually edit this!! If it is corrupted, |
|
899 |
the ImageEditor may not be able to read the specification." |
|
900 |
||
901 |
" |
|
902 |
self menuHistoryListIcon inspect |
|
903 |
ImageEditor openOnClass:self andSelector:#menuHistoryListIcon |
|
904 |
" |
|
905 |
||
906 |
<resource: #image> |
|
907 |
||
908 |
^Icon |
|
4414 | 909 |
constantNamed:#'AbstractFileBrowser class menuHistoryListIcon' |
910 |
ifAbsentPut:[(Depth1Image new) width: 12; height: 12; photometric:(#palette); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'??S?<O?0??C?<O?0??/?=_?0??C?<O?0') ; colorMapFromArray:#[255 255 255 0 0 0]; mask:((Depth1Image new) width: 12; height: 12; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@O@@<@C0A?8C?@G8@O@@X@@@A?8@@@') ; yourself); yourself] |
|
3892 | 911 |
! |
912 |
||
6087 | 913 |
newDirectoryIcon |
6074 | 914 |
<resource: #programImage> |
915 |
||
6087 | 916 |
^ ToolbarIconLibrary newDirectoryIcon |
3923 | 917 |
! |
918 |
||
6091 | 919 |
removeTabIcon |
920 |
<resource: #programImage> |
|
921 |
||
922 |
^ ToolbarIconLibrary removeTabIcon |
|
923 |
! |
|
924 |
||
3892 | 925 |
vt100Terminal |
926 |
<resource: #programImage> |
|
927 |
||
928 |
^ ToolbarIconLibrary shell20x20Icon |
|
929 |
! ! |
|
930 |
||
5528 | 931 |
!AbstractFileBrowser class methodsFor:'interface specs'! |
932 |
||
933 |
encodingDialogSpec |
|
934 |
"This resource specification was automatically generated |
|
935 |
by the UIPainter of ST/X." |
|
936 |
||
937 |
"Do not manually edit this!! If it is corrupted, |
|
938 |
the UIPainter may not be able to read the specification." |
|
939 |
||
940 |
" |
|
941 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#encodingDialogSpec |
|
942 |
AbstractFileBrowser new openInterface:#encodingDialogSpec |
|
943 |
" |
|
944 |
||
945 |
<resource: #canvas> |
|
946 |
||
947 |
^ |
|
948 |
#(FullSpec |
|
949 |
name: encodingDialogSpec |
|
950 |
window: |
|
951 |
(WindowSpec |
|
952 |
label: 'File Encoding' |
|
953 |
name: 'File Encoding' |
|
954 |
min: (Point 10 10) |
|
5626 | 955 |
bounds: (Rectangle 0 0 379 590) |
5528 | 956 |
) |
957 |
component: |
|
958 |
(SpecCollection |
|
959 |
collection: ( |
|
960 |
(LabelSpec |
|
11053 | 961 |
label: 'Select the External (File-) Encoding:' |
6236 | 962 |
name: 'Label1' |
5528 | 963 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
964 |
translateLabel: true |
|
965 |
adjust: left |
|
966 |
) |
|
967 |
(DataSetSpec |
|
968 |
name: 'Table1' |
|
5737 | 969 |
layout: (LayoutFrame 0 0 30 0 0 1 -60 1) |
5528 | 970 |
model: selectedEncoding |
971 |
hasHorizontalScrollBar: true |
|
972 |
hasVerticalScrollBar: true |
|
973 |
dataList: encodingList |
|
974 |
has3Dseparators: true |
|
975 |
columns: |
|
11053 | 976 |
(Array |
5528 | 977 |
|
978 |
(DataSetColumnSpec |
|
979 |
label: 'Encoding' |
|
980 |
labelButtonType: Button |
|
981 |
model: at: |
|
982 |
canSelect: false |
|
983 |
isResizeable: false |
|
984 |
showRowSeparator: false |
|
985 |
showColSeparator: false |
|
986 |
) |
|
987 |
(DataSetColumnSpec |
|
988 |
label: 'Description' |
|
989 |
labelButtonType: Button |
|
990 |
model: at: |
|
991 |
canSelect: false |
|
992 |
isResizeable: false |
|
993 |
showRowSeparator: false |
|
994 |
showColSeparator: false |
|
995 |
) |
|
996 |
) |
|
5626 | 997 |
doubleClickChannel: accept |
5528 | 998 |
) |
999 |
(HorizontalPanelViewSpec |
|
5737 | 1000 |
name: 'ButtonPanel' |
5528 | 1001 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
1002 |
horizontalLayout: fitSpace |
|
1003 |
verticalLayout: center |
|
1004 |
horizontalSpace: 3 |
|
1005 |
verticalSpace: 3 |
|
1006 |
reverseOrderIfOKAtLeft: true |
|
1007 |
component: |
|
1008 |
(SpecCollection |
|
1009 |
collection: ( |
|
1010 |
(ActionButtonSpec |
|
1011 |
label: 'Cancel' |
|
1012 |
name: 'Button2' |
|
1013 |
translateLabel: true |
|
1014 |
model: cancel |
|
5737 | 1015 |
extent: (Point 185 22) |
5528 | 1016 |
) |
1017 |
(ActionButtonSpec |
|
1018 |
label: 'OK' |
|
1019 |
name: 'Button1' |
|
1020 |
translateLabel: true |
|
1021 |
model: accept |
|
1022 |
isDefault: true |
|
5737 | 1023 |
extent: (Point 185 22) |
5528 | 1024 |
) |
1025 |
) |
|
1026 |
||
1027 |
) |
|
1028 |
) |
|
5737 | 1029 |
(CheckBoxSpec |
1030 |
label: 'Lock Encoding' |
|
1031 |
name: 'LockEncodingCheckBox' |
|
1032 |
layout: (LayoutFrame 3 0 -60 1 217 0 -30 1) |
|
1033 |
activeHelpKey: lockFileEncoding |
|
1034 |
model: lockFileEncoding |
|
1035 |
translateLabel: true |
|
1036 |
) |
|
5528 | 1037 |
) |
1038 |
||
1039 |
) |
|
1040 |
) |
|
11053 | 1041 |
|
1042 |
"Modified: / 06-01-2012 / 15:40:54 / cg" |
|
1043 |
! |
|
1044 |
||
1045 |
lineEndConventionDialogSpec |
|
1046 |
"This resource specification was automatically generated |
|
1047 |
by the UIPainter of ST/X." |
|
1048 |
||
1049 |
"Do not manually edit this!! If it is corrupted, |
|
1050 |
the UIPainter may not be able to read the specification." |
|
1051 |
||
1052 |
" |
|
1053 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#lineEndConventionDialogSpec |
|
1054 |
AbstractFileBrowser new openInterface:#lineEndConventionDialogSpec |
|
1055 |
" |
|
1056 |
||
1057 |
<resource: #canvas> |
|
1058 |
||
1059 |
^ |
|
1060 |
#(FullSpec |
|
1061 |
name: lineEndConventionDialogSpec |
|
1062 |
window: |
|
1063 |
(WindowSpec |
|
1064 |
label: 'Line-End Convention' |
|
1065 |
name: 'Line-End Convention' |
|
1066 |
min: (Point 10 10) |
|
1067 |
bounds: (Rectangle 0 0 379 239) |
|
1068 |
) |
|
1069 |
component: |
|
1070 |
(SpecCollection |
|
1071 |
collection: ( |
|
1072 |
(LabelSpec |
|
11286 | 1073 |
label: 'Select the Line-End Convention (used when saving files):' |
11053 | 1074 |
name: 'Label1' |
1075 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1076 |
translateLabel: true |
|
1077 |
adjust: left |
|
1078 |
) |
|
1079 |
(VerticalPanelViewSpec |
|
1080 |
name: 'VerticalPanel1' |
|
1081 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1082 |
horizontalLayout: center |
|
1083 |
verticalLayout: center |
|
1084 |
horizontalSpace: 3 |
|
1085 |
verticalSpace: 3 |
|
1086 |
component: |
|
1087 |
(SpecCollection |
|
1088 |
collection: ( |
|
1089 |
(RadioButtonSpec |
|
1090 |
label: 'NL (Unix)' |
|
1091 |
name: 'RadioButton1' |
|
1092 |
translateLabel: true |
|
1093 |
model: lineEndConvention |
|
1094 |
isTriggerOnDown: true |
|
1095 |
select: nl |
|
1096 |
extent: (Point 136 22) |
|
1097 |
) |
|
1098 |
(RadioButtonSpec |
|
1099 |
label: 'CR-NL (MSDOS)' |
|
1100 |
name: 'RadioButton4' |
|
1101 |
translateLabel: true |
|
1102 |
model: lineEndConvention |
|
1103 |
isTriggerOnDown: true |
|
1104 |
select: crnl |
|
1105 |
extent: (Point 136 22) |
|
1106 |
) |
|
1107 |
(RadioButtonSpec |
|
1108 |
label: 'CR (Mac)' |
|
1109 |
name: 'RadioButton5' |
|
1110 |
translateLabel: true |
|
1111 |
model: lineEndConvention |
|
1112 |
isTriggerOnDown: true |
|
1113 |
select: cr |
|
1114 |
extent: (Point 136 22) |
|
1115 |
) |
|
1116 |
(RadioButtonSpec |
|
1117 |
label: 'EOL' |
|
1118 |
name: 'RadioButton6' |
|
1119 |
translateLabel: true |
|
1120 |
model: lineEndConvention |
|
1121 |
isTriggerOnDown: true |
|
1122 |
select: eol |
|
1123 |
extent: (Point 136 22) |
|
1124 |
) |
|
1125 |
(RadioButtonSpec |
|
1126 |
label: 'EOT' |
|
1127 |
name: 'RadioButton7' |
|
1128 |
translateLabel: true |
|
1129 |
model: lineEndConvention |
|
1130 |
isTriggerOnDown: true |
|
1131 |
select: eot |
|
1132 |
extent: (Point 136 22) |
|
1133 |
) |
|
1134 |
) |
|
1135 |
||
1136 |
) |
|
1137 |
) |
|
1138 |
(HorizontalPanelViewSpec |
|
1139 |
name: 'ButtonPanel' |
|
1140 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1141 |
horizontalLayout: fitSpace |
|
1142 |
verticalLayout: center |
|
1143 |
horizontalSpace: 3 |
|
1144 |
verticalSpace: 3 |
|
1145 |
reverseOrderIfOKAtLeft: true |
|
1146 |
component: |
|
1147 |
(SpecCollection |
|
1148 |
collection: ( |
|
1149 |
(ActionButtonSpec |
|
1150 |
label: 'Cancel' |
|
1151 |
name: 'Button2' |
|
1152 |
translateLabel: true |
|
1153 |
model: cancel |
|
1154 |
extent: (Point 185 22) |
|
1155 |
) |
|
1156 |
(ActionButtonSpec |
|
1157 |
label: 'OK' |
|
1158 |
name: 'Button1' |
|
1159 |
translateLabel: true |
|
1160 |
model: accept |
|
1161 |
isDefault: true |
|
1162 |
extent: (Point 185 22) |
|
1163 |
) |
|
1164 |
) |
|
1165 |
||
1166 |
) |
|
1167 |
) |
|
1168 |
) |
|
1169 |
||
1170 |
) |
|
1171 |
) |
|
11286 | 1172 |
|
1173 |
"Modified: / 28-02-2012 / 11:12:03 / cg" |
|
11053 | 1174 |
! |
1175 |
||
1176 |
tabStopConversionDialogSpec |
|
1177 |
"This resource specification was automatically generated |
|
1178 |
by the UIPainter of ST/X." |
|
1179 |
||
1180 |
"Do not manually edit this!! If it is corrupted, |
|
1181 |
the UIPainter may not be able to read the specification." |
|
1182 |
||
1183 |
" |
|
1184 |
UIPainter new openOnClass:AbstractFileBrowser andSelector:#tabStopConversionDialogSpec |
|
1185 |
AbstractFileBrowser new openInterface:#tabStopConversionDialogSpec |
|
1186 |
" |
|
1187 |
||
1188 |
<resource: #canvas> |
|
1189 |
||
1190 |
^ |
|
1191 |
#(FullSpec |
|
1192 |
name: 'tabStopConversionDialogSpec' |
|
1193 |
window: |
|
1194 |
(WindowSpec |
|
1195 |
label: 'Tab-Stop Conversion' |
|
1196 |
name: 'Tab-Stop Conversion' |
|
1197 |
min: (Point 10 10) |
|
1198 |
bounds: (Rectangle 0 0 379 239) |
|
1199 |
) |
|
1200 |
component: |
|
1201 |
(SpecCollection |
|
1202 |
collection: ( |
|
1203 |
(LabelSpec |
|
11286 | 1204 |
label: 'Select the Tab-Stop Conversion (used when saving files):' |
11053 | 1205 |
name: 'Label1' |
1206 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
1207 |
translateLabel: true |
|
1208 |
adjust: left |
|
1209 |
) |
|
1210 |
(VerticalPanelViewSpec |
|
1211 |
name: 'VerticalPanel1' |
|
1212 |
layout: (LayoutFrame 0 0 30 0 0 1 -30 1) |
|
1213 |
horizontalLayout: center |
|
1214 |
verticalLayout: center |
|
1215 |
horizontalSpace: 3 |
|
1216 |
verticalSpace: 3 |
|
1217 |
component: |
|
1218 |
(SpecCollection |
|
1219 |
collection: ( |
|
1220 |
(RadioButtonSpec |
|
1221 |
label: '4' |
|
1222 |
name: 'RadioButton1' |
|
1223 |
translateLabel: true |
|
1224 |
model: tabStops |
|
1225 |
isTriggerOnDown: true |
|
1226 |
select: 4 |
|
1227 |
extent: (Point 136 22) |
|
1228 |
) |
|
1229 |
(RadioButtonSpec |
|
1230 |
label: '8' |
|
1231 |
name: 'RadioButton4' |
|
1232 |
translateLabel: true |
|
1233 |
model: tabStops |
|
1234 |
isTriggerOnDown: true |
|
1235 |
select: 8 |
|
1236 |
extent: (Point 136 22) |
|
1237 |
) |
|
1238 |
) |
|
1239 |
||
1240 |
) |
|
1241 |
) |
|
1242 |
(HorizontalPanelViewSpec |
|
1243 |
name: 'ButtonPanel' |
|
1244 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
1245 |
horizontalLayout: fitSpace |
|
1246 |
verticalLayout: center |
|
1247 |
horizontalSpace: 3 |
|
1248 |
verticalSpace: 3 |
|
1249 |
reverseOrderIfOKAtLeft: true |
|
1250 |
component: |
|
1251 |
(SpecCollection |
|
1252 |
collection: ( |
|
1253 |
(ActionButtonSpec |
|
1254 |
label: 'Cancel' |
|
1255 |
name: 'Button2' |
|
1256 |
translateLabel: true |
|
1257 |
model: cancel |
|
1258 |
extent: (Point 185 22) |
|
1259 |
) |
|
1260 |
(ActionButtonSpec |
|
1261 |
label: 'OK' |
|
1262 |
name: 'Button1' |
|
1263 |
translateLabel: true |
|
1264 |
model: accept |
|
1265 |
isDefault: true |
|
1266 |
extent: (Point 185 22) |
|
1267 |
) |
|
1268 |
) |
|
1269 |
||
1270 |
) |
|
1271 |
) |
|
1272 |
) |
|
1273 |
||
1274 |
) |
|
1275 |
) |
|
11286 | 1276 |
|
1277 |
"Modified: / 28-02-2012 / 11:12:38 / cg" |
|
5528 | 1278 |
! ! |
1279 |
||
3892 | 1280 |
!AbstractFileBrowser class methodsFor:'menu specs'! |
1281 |
||
1282 |
baseBookmarksMenuSpec |
|
1283 |
"This resource specification was automatically generated |
|
1284 |
by the MenuEditor of ST/X." |
|
1285 |
||
1286 |
"Do not manually edit this!! If it is corrupted, |
|
1287 |
the MenuEditor may not be able to read the specification." |
|
1288 |
||
1289 |
" |
|
1290 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec |
|
1291 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec)) startUp |
|
1292 |
" |
|
1293 |
||
1294 |
<resource: #menu> |
|
1295 |
||
1296 |
^ |
|
6551 | 1297 |
#(Menu |
1298 |
( |
|
1299 |
(MenuItem |
|
1300 |
enabled: currentFilesHasDirectories |
|
1301 |
label: 'Add Bookmark' |
|
1302 |
itemValue: addBookmark |
|
1303 |
translateLabel: true |
|
4414 | 1304 |
) |
6551 | 1305 |
(MenuItem |
1306 |
enabled: hasBookmarksToRemove |
|
1307 |
label: 'Remove Bookmark' |
|
1308 |
itemValue: removeBookmark |
|
1309 |
translateLabel: true |
|
4414 | 1310 |
) |
6551 | 1311 |
(MenuItem |
1312 |
label: 'Save Bookmarks In...' |
|
1313 |
itemValue: saveBookmarks |
|
1314 |
translateLabel: true |
|
4679 | 1315 |
) |
4414 | 1316 |
) |
1317 |
nil |
|
1318 |
nil |
|
3892 | 1319 |
) |
1320 |
! |
|
1321 |
||
6102 | 1322 |
baseBookmarksMenuSpec2 |
1323 |
"This resource specification was automatically generated |
|
1324 |
by the MenuEditor of ST/X." |
|
1325 |
||
1326 |
"Do not manually edit this!! If it is corrupted, |
|
1327 |
the MenuEditor may not be able to read the specification." |
|
1328 |
||
1329 |
" |
|
8013 | 1330 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#baseBookmarksMenuSpec2 |
1331 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser baseBookmarksMenuSpec2)) startUp |
|
6102 | 1332 |
" |
1333 |
||
1334 |
<resource: #menu> |
|
1335 |
||
1336 |
^ |
|
8013 | 1337 |
#(Menu |
1338 |
( |
|
1339 |
(MenuItem |
|
1340 |
label: 'Edit Bookmarks' |
|
1341 |
itemValue: editBookmarks |
|
1342 |
translateLabel: true |
|
1343 |
) |
|
1344 |
(MenuItem |
|
1345 |
label: '-' |
|
1346 |
) |
|
1347 |
(MenuItem |
|
1348 |
enabled: currentFilesHasDirectories |
|
1349 |
label: 'Add Bookmark' |
|
1350 |
itemValue: addBookmark |
|
1351 |
translateLabel: true |
|
6102 | 1352 |
) |
1353 |
) |
|
1354 |
nil |
|
1355 |
nil |
|
1356 |
) |
|
1357 |
! |
|
1358 |
||
4110 | 1359 |
browserMenu |
1360 |
"This resource specification was automatically generated |
|
1361 |
by the MenuEditor of ST/X." |
|
1362 |
||
1363 |
"Do not manually edit this!! If it is corrupted, |
|
1364 |
the MenuEditor may not be able to read the specification." |
|
1365 |
||
10923 | 1366 |
|
4110 | 1367 |
" |
1368 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#browserMenu |
|
1369 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser browserMenu)) startUp |
|
1370 |
" |
|
1371 |
||
1372 |
<resource: #menu> |
|
1373 |
||
1374 |
^ |
|
5273 | 1375 |
#(Menu |
1376 |
( |
|
1377 |
(MenuItem |
|
7315 | 1378 |
label: 'Spawn Filebrowser' |
5273 | 1379 |
itemValue: doSpawn |
1380 |
translateLabel: true |
|
5962
ed6a7de8cc91
Add accelerators: Ctrl-t for new tab and Ctrl-n for new window
Stefan Vogel <sv@exept.de>
parents:
5961
diff
changeset
|
1381 |
shortcutKey: Ctrln |
4201 | 1382 |
) |
5273 | 1383 |
(MenuItem |
7829 | 1384 |
label: 'Windows Explorer' |
1385 |
itemValue: doOpenExplorer |
|
1386 |
translateLabel: true |
|
8256 | 1387 |
isVisible: systemIsDOS |
1388 |
) |
|
1389 |
(MenuItem |
|
12473 | 1390 |
label: 'Open Finder' |
1391 |
itemValue: doOpenFinder |
|
1392 |
translateLabel: true |
|
1393 |
isVisible: systemIsOSX |
|
1394 |
) |
|
1395 |
(MenuItem |
|
8256 | 1396 |
label: 'C Browser' |
1397 |
itemValue: doOpenCBrowser |
|
1398 |
translateLabel: true |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
1399 |
isVisible: cBrowserMenuItemVisible |
7829 | 1400 |
) |
1401 |
(MenuItem |
|
5273 | 1402 |
label: '-' |
4201 | 1403 |
) |
5273 | 1404 |
(MenuItem |
6335 | 1405 |
label: 'Add Text Editor Page' |
5273 | 1406 |
itemValue: newTextEditor |
1407 |
translateLabel: true |
|
5963
57ae5e061db8
Accelerator Ctrl-t for new text editor
Stefan Vogel <sv@exept.de>
parents:
5962
diff
changeset
|
1408 |
shortcutKey: Ctrlt |
4392 | 1409 |
) |
5273 | 1410 |
(MenuItem |
6335 | 1411 |
label: 'Add Shell Terminal Page' |
5273 | 1412 |
itemValue: doAddTerminal |
1413 |
translateLabel: true |
|
4201 | 1414 |
) |
5273 | 1415 |
(MenuItem |
10923 | 1416 |
label: 'Add Archiver Page' |
1417 |
itemValue: doAddArchiver |
|
1418 |
translateLabel: true |
|
1419 |
) |
|
1420 |
(MenuItem |
|
6335 | 1421 |
label: 'Add Search Page' |
5273 | 1422 |
itemValue: doOpenSearchFile |
1423 |
translateLabel: true |
|
4201 | 1424 |
) |
5273 | 1425 |
(MenuItem |
1426 |
label: '-' |
|
11053 | 1427 |
isVisible: false |
4201 | 1428 |
) |
5273 | 1429 |
(MenuItem |
1430 |
label: 'Settings...' |
|
1431 |
itemValue: doOpenSettings |
|
1432 |
translateLabel: true |
|
11053 | 1433 |
isVisible: false |
5104 | 1434 |
) |
5273 | 1435 |
(MenuItem |
5528 | 1436 |
label: 'Encoding...' |
1437 |
itemValue: fileEncodingDialog |
|
1438 |
translateLabel: true |
|
11053 | 1439 |
isVisible: false |
1440 |
) |
|
1441 |
(MenuItem |
|
1442 |
label: 'Line End Convention...' |
|
1443 |
itemValue: lineEndConventionDialog |
|
1444 |
translateLabel: true |
|
1445 |
isVisible: false |
|
1446 |
) |
|
1447 |
(MenuItem |
|
1448 |
label: 'Tab Stop Conversion...' |
|
1449 |
itemValue: tabStopConversionDialog |
|
1450 |
translateLabel: true |
|
1451 |
isVisible: false |
|
5528 | 1452 |
) |
1453 |
(MenuItem |
|
5273 | 1454 |
label: '-' |
5104 | 1455 |
) |
5273 | 1456 |
(MenuItem |
1457 |
label: 'Exit' |
|
1458 |
itemValue: closeRequest |
|
1459 |
translateLabel: true |
|
4201 | 1460 |
) |
1461 |
) |
|
1462 |
nil |
|
1463 |
nil |
|
4110 | 1464 |
) |
11057 | 1465 |
|
1466 |
"Modified: / 07-01-2012 / 12:51:20 / cg" |
|
4110 | 1467 |
! |
1468 |
||
3892 | 1469 |
directoryMenu |
1470 |
"This resource specification was automatically generated |
|
1471 |
by the MenuEditor of ST/X." |
|
1472 |
||
1473 |
"Do not manually edit this!! If it is corrupted, |
|
1474 |
the MenuEditor may not be able to read the specification." |
|
1475 |
||
11767 | 1476 |
|
3892 | 1477 |
" |
1478 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#directoryMenu |
|
1479 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser directoryMenu)) startUp |
|
1480 |
" |
|
1481 |
||
1482 |
<resource: #menu> |
|
1483 |
||
1484 |
^ |
|
6220 | 1485 |
#(Menu |
1486 |
( |
|
1487 |
(MenuItem |
|
1488 |
label: 'Up' |
|
1489 |
itemValue: doGoDirectoryUp |
|
4414 | 1490 |
) |
6220 | 1491 |
(MenuItem |
1492 |
label: '-' |
|
4414 | 1493 |
) |
6220 | 1494 |
(MenuItem |
1495 |
activeHelpKey: directoryBack |
|
1496 |
enabled: enableBack |
|
1497 |
label: 'Back' |
|
1498 |
itemValue: doBack |
|
4414 | 1499 |
) |
6220 | 1500 |
(MenuItem |
1501 |
activeHelpKey: directoryBack |
|
1502 |
enabled: enableForward |
|
1503 |
label: 'Forward' |
|
1504 |
itemValue: doForward |
|
4414 | 1505 |
) |
6220 | 1506 |
(MenuItem |
1507 |
label: '-' |
|
4414 | 1508 |
) |
6220 | 1509 |
(MenuItem |
9596 | 1510 |
enabled: enableHome |
6434 | 1511 |
label: 'Home Directory' |
1512 |
itemValue: doGotoHomeDirectory |
|
1513 |
) |
|
1514 |
(MenuItem |
|
9596 | 1515 |
enabled: enableGotoDesktopDirectory |
9572 | 1516 |
label: 'Desktop' |
1517 |
itemValue: doGotoDesktopDirectory |
|
1518 |
) |
|
1519 |
(MenuItem |
|
9596 | 1520 |
enabled: enableGotoDefaultDirectory |
6434 | 1521 |
label: 'Default (Current) Directory' |
6220 | 1522 |
itemValue: doGotoDefaultDirectory |
9596 | 1523 |
) |
1524 |
(MenuItem |
|
1525 |
enabled: enableGotoSmalltalkDirectory |
|
1526 |
label: 'Smalltalk (Application) Directory' |
|
1527 |
itemValue: doGotoSmalltalkDirectory |
|
4414 | 1528 |
) |
6220 | 1529 |
(MenuItem |
9677 | 1530 |
enabled: enableGotoTempDirectory |
11995 | 1531 |
label: 'Smalltalk Temp Directory' |
9677 | 1532 |
itemValue: doGotoTempDirectory |
1533 |
) |
|
1534 |
(MenuItem |
|
9596 | 1535 |
label: '-' |
1536 |
) |
|
1537 |
(MenuItem |
|
1538 |
enabled: enableMakeCurrentDirectory |
|
1539 |
label: 'Make this the Default (Current) Directory' |
|
1540 |
itemValue: doMakeCurrentDirectory |
|
4414 | 1541 |
) |
6220 | 1542 |
(MenuItem |
9596 | 1543 |
label: '-' |
1544 |
) |
|
1545 |
(MenuItem |
|
6220 | 1546 |
label: 'Bookmarks' |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
1547 |
submenuChannel: bookmarksMenu |
4414 | 1548 |
) |
6220 | 1549 |
(MenuItem |
1550 |
label: 'Visited Directories' |
|
1551 |
submenuChannel: visitedDirectoriesMenu |
|
4414 | 1552 |
) |
1553 |
) |
|
1554 |
nil |
|
1555 |
nil |
|
3892 | 1556 |
) |
1557 |
! |
|
1558 |
||
1559 |
editMenu |
|
1560 |
"This resource specification was automatically generated |
|
1561 |
by the MenuEditor of ST/X." |
|
1562 |
||
1563 |
"Do not manually edit this!! If it is corrupted, |
|
1564 |
the MenuEditor may not be able to read the specification." |
|
1565 |
||
1566 |
" |
|
1567 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#editMenu |
|
1568 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser editMenu)) startUp |
|
1569 |
" |
|
1570 |
||
1571 |
<resource: #menu> |
|
1572 |
||
1573 |
^ |
|
5888 | 1574 |
#(Menu |
1575 |
( |
|
1576 |
(MenuItem |
|
1577 |
enabled: hasFileSelection |
|
1578 |
label: 'Copy Selected Filenames to Clipboard' |
|
1579 |
itemValue: copySelectedFilenames |
|
1580 |
translateLabel: true |
|
4414 | 1581 |
) |
5888 | 1582 |
(MenuItem |
1583 |
enabled: fileListIsNotEmpty |
|
1584 |
label: 'Copy All Filenames to Clipboard' |
|
1585 |
itemValue: copyFileList |
|
1586 |
translateLabel: true |
|
4940
4964068c4718
allow settings dialog to be opened from browser
Claus Gittinger <cg@exept.de>
parents:
4930
diff
changeset
|
1587 |
) |
4414 | 1588 |
) |
1589 |
nil |
|
1590 |
nil |
|
3892 | 1591 |
) |
1592 |
! |
|
1593 |
||
6099 | 1594 |
emptyMenuSpec |
1595 |
"This resource specification was automatically generated |
|
1596 |
by the MenuEditor of ST/X." |
|
1597 |
||
1598 |
"Do not manually edit this!! If it is corrupted, |
|
1599 |
the MenuEditor may not be able to read the specification." |
|
1600 |
||
1601 |
" |
|
1602 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#emptyMenuSpec |
|
1603 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser emptyMenuSpec)) startUp |
|
1604 |
" |
|
1605 |
||
1606 |
<resource: #menu> |
|
1607 |
||
1608 |
^ |
|
1609 |
#(#Menu |
|
1610 |
#( |
|
1611 |
) |
|
1612 |
nil |
|
1613 |
nil |
|
1614 |
) |
|
1615 |
! |
|
1616 |
||
11053 | 1617 |
extraMenu |
1618 |
"This resource specification was automatically generated |
|
1619 |
by the MenuEditor of ST/X." |
|
1620 |
||
1621 |
"Do not manually edit this!! If it is corrupted, |
|
1622 |
the MenuEditor may not be able to read the specification." |
|
1623 |
||
1624 |
||
1625 |
" |
|
1626 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#extraMenu |
|
1627 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser extraMenu)) startUp |
|
1628 |
" |
|
1629 |
||
1630 |
<resource: #menu> |
|
1631 |
||
1632 |
^ |
|
1633 |
#(Menu |
|
1634 |
( |
|
1635 |
(MenuItem |
|
1636 |
label: 'Encoding...' |
|
1637 |
itemValue: fileEncodingDialog |
|
1638 |
translateLabel: true |
|
1639 |
) |
|
1640 |
(MenuItem |
|
1641 |
label: 'Line End Convention...' |
|
1642 |
itemValue: lineEndConventionDialog |
|
1643 |
translateLabel: true |
|
1644 |
) |
|
1645 |
(MenuItem |
|
1646 |
label: 'Tab Stop Conversion...' |
|
1647 |
itemValue: tabStopConversionDialog |
|
1648 |
translateLabel: true |
|
1649 |
) |
|
1650 |
(MenuItem |
|
1651 |
label: '-' |
|
1652 |
) |
|
1653 |
(MenuItem |
|
1654 |
label: 'Settings...' |
|
1655 |
itemValue: doOpenSettings |
|
1656 |
translateLabel: true |
|
11286 | 1657 |
labelImage: (ResourceRetriever ToolbarIconLibrary settings16x16Icon 'Settings...') |
11053 | 1658 |
) |
1659 |
) |
|
1660 |
nil |
|
1661 |
nil |
|
1662 |
) |
|
1663 |
! |
|
1664 |
||
3892 | 1665 |
fileMenu |
1666 |
"This resource specification was automatically generated |
|
1667 |
by the MenuEditor of ST/X." |
|
1668 |
||
1669 |
"Do not manually edit this!! If it is corrupted, |
|
1670 |
the MenuEditor may not be able to read the specification." |
|
1671 |
||
12497 | 1672 |
|
3892 | 1673 |
" |
1674 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileMenu |
|
1675 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileMenu)) startUp |
|
1676 |
" |
|
1677 |
||
1678 |
<resource: #menu> |
|
1679 |
||
1680 |
^ |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1681 |
#(Menu |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1682 |
( |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1683 |
(MenuItem |
6593 | 1684 |
label: 'Open' |
1685 |
itemValue: doShowFileContents |
|
1686 |
) |
|
1687 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1688 |
label: '-' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1689 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
1690 |
(MenuItem |
6593 | 1691 |
enabled: hasFileSelection |
1692 |
label: 'FileIn' |
|
1693 |
itemValue: fileFileIn |
|
1694 |
) |
|
1695 |
(MenuItem |
|
1696 |
enabled: hasFileSelection |
|
1697 |
label: 'FileIn to Namespace...' |
|
1698 |
itemValue: fileFileInToNameSpace |
|
12497 | 1699 |
) |
1700 |
(MenuItem |
|
1701 |
enabled: hasPackageDirectorySelected |
|
1702 |
label: 'Load Package from Here' |
|
1703 |
itemValue: fileFileInPackage |
|
6593 | 1704 |
) |
1705 |
(MenuItem |
|
1706 |
label: '-' |
|
1707 |
) |
|
1708 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1709 |
label: 'New' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1710 |
submenuChannel: newMenu |
5425 | 1711 |
keepLinkedMenu: true |
4414 | 1712 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1713 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1714 |
label: '-' |
4534 | 1715 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1716 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1717 |
enabled: hasSelection |
5945 | 1718 |
label: 'Cut' |
1719 |
itemValue: cutFiles |
|
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1720 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1721 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1722 |
enabled: hasSelection |
5945 | 1723 |
label: 'Copy' |
1724 |
itemValue: copyFiles |
|
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1725 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1726 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1727 |
enabled: canPaste |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1728 |
label: 'Paste' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1729 |
itemValue: pasteFiles |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1730 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1731 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1732 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1733 |
label: 'Delete' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1734 |
itemValue: deleteFiles |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1735 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1736 |
(MenuItem |
6169 | 1737 |
enabled: hasSelection |
1738 |
label: 'Erase' |
|
1739 |
itemValue: eraseFiles |
|
1740 |
) |
|
1741 |
(MenuItem |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1742 |
label: '-' |
4789
238d5e783f5c
editMenu was really a file menu
Claus Gittinger <cg@exept.de>
parents:
4785
diff
changeset
|
1743 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1744 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1745 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1746 |
label: 'Rename...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1747 |
itemValue: renameSelection |
8716 | 1748 |
shortcutKey: Rename |
4414 | 1749 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1750 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1751 |
enabled: hasSelection |
5634 | 1752 |
label: 'Move To...' |
6107 | 1753 |
itemValue: moveSelectionTo |
1754 |
) |
|
1755 |
(MenuItem |
|
1756 |
enabled: hasSelection |
|
1757 |
label: 'Copy To...' |
|
1758 |
itemValue: copySelectionTo |
|
4414 | 1759 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1760 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1761 |
enabled: hasSelection |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1762 |
label: 'Properties...' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1763 |
itemValue: doShowProperties |
4554 | 1764 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1765 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1766 |
label: '-' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1767 |
isVisible: javaSupportLoaded |
4414 | 1768 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1769 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1770 |
enabled: canAddToClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1771 |
label: 'Add to Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1772 |
isVisible: javaSupportLoaded |
4414 | 1773 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1774 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1775 |
enabled: canRemoveFromClassPath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1776 |
label: 'Remove from Java Class Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1777 |
isVisible: javaSupportLoaded |
4414 | 1778 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1779 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1780 |
enabled: canAddToSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1781 |
label: 'Add to Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1782 |
isVisible: javaSupportLoaded |
4414 | 1783 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1784 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1785 |
enabled: canRemoveFromSourcePath |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1786 |
label: 'Remove from Java Source Path' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1787 |
isVisible: javaSupportLoaded |
4414 | 1788 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1789 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1790 |
label: '-' |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1791 |
) |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1792 |
(MenuItem |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1793 |
enabled: enableFileHistory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1794 |
label: 'File History' |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
1795 |
submenuChannel: menuFileHistory |
5242
04616d3a672c
history fixed (only kept the oldest items, instead of the newest ones)
Claus Gittinger <cg@exept.de>
parents:
5162
diff
changeset
|
1796 |
) |
4414 | 1797 |
) |
1798 |
nil |
|
1799 |
nil |
|
3892 | 1800 |
) |
1801 |
! |
|
1802 |
||
4930 | 1803 |
fileOpMenu |
1804 |
"This resource specification was automatically generated |
|
1805 |
by the MenuEditor of ST/X." |
|
1806 |
||
1807 |
"Do not manually edit this!! If it is corrupted, |
|
1808 |
the MenuEditor may not be able to read the specification." |
|
1809 |
||
1810 |
" |
|
1811 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#fileOpMenu |
|
1812 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser fileOpMenu)) startUp |
|
1813 |
" |
|
1814 |
||
1815 |
<resource: #menu> |
|
1816 |
||
1817 |
^ |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1818 |
#(Menu |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1819 |
( |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1820 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1821 |
label: 'Split...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1822 |
itemValue: splitSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1823 |
translateLabel: true |
12871 | 1824 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1825 |
) |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1826 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1827 |
label: 'Join...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1828 |
itemValue: joinSelectedFiles |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1829 |
translateLabel: true |
12871 | 1830 |
enabled: hasFileSelection |
4930 | 1831 |
) |
7635 | 1832 |
(MenuItem |
1833 |
label: 'Copy Corrupted File To...' |
|
1834 |
itemValue: copySelectionToRepairingCorruptedFiles |
|
1835 |
translateLabel: true |
|
12871 | 1836 |
enabled: hasFileSelection |
7635 | 1837 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1838 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1839 |
label: '-' |
4930 | 1840 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1841 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1842 |
label: 'Rot13...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1843 |
itemValue: filterSelectedFiles: |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1844 |
translateLabel: true |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1845 |
argument: rot13 |
12871 | 1846 |
enabled: hasFileSelection |
4930 | 1847 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1848 |
(MenuItem |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1849 |
label: '-' |
4930 | 1850 |
) |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1851 |
(MenuItem |
12871 | 1852 |
enabled: hasFileSelection |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1853 |
label: 'Truncate...' |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1854 |
itemValue: truncateSelectedFilesToZeroSize |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
1855 |
translateLabel: true |
4930 | 1856 |
) |
9490 | 1857 |
(MenuItem |
1858 |
label: '-' |
|
1859 |
) |
|
1860 |
(MenuItem |
|
1861 |
label: 'Generate Signed Files' |
|
1862 |
itemValue: generateSignaturesForSelectedFiles |
|
1863 |
translateLabel: true |
|
1864 |
enabled: canGenerateSignatureFiles |
|
1865 |
) |
|
1866 |
(MenuItem |
|
1867 |
label: 'Generate Detached Signature Files (use for dll)' |
|
1868 |
itemValue: generateDetachedSignaturesForSelectedFiles |
|
1869 |
translateLabel: true |
|
1870 |
enabled: canGenerateSignatureFiles |
|
1871 |
) |
|
9596 | 1872 |
(MenuItem |
1873 |
label: '-' |
|
1874 |
) |
|
1875 |
(MenuItem |
|
12871 | 1876 |
enabled: hasFileSelection |
9596 | 1877 |
label: 'File Differences' |
1878 |
itemValue: openDiffView |
|
1879 |
translateLabel: true |
|
1880 |
isVisible: hasTwoFilesSelectedHolder |
|
1881 |
) |
|
1882 |
(MenuItem |
|
12871 | 1883 |
enabled: hasFileSelection |
9596 | 1884 |
label: 'File Differences...' |
1885 |
itemValue: openDiffView |
|
1886 |
translateLabel: true |
|
1887 |
isVisible: hasNotTwoFilesSelectedHolder |
|
1888 |
) |
|
1889 |
(MenuItem |
|
1890 |
enabled: hasSelection |
|
1891 |
label: 'Directory Differences' |
|
1892 |
itemValue: openDirectoryDiffView |
|
1893 |
translateLabel: true |
|
1894 |
isVisible: hasTwoDirectoriesSelectedHolder |
|
1895 |
) |
|
1896 |
(MenuItem |
|
1897 |
enabled: hasSelection |
|
1898 |
label: 'Directory Differences...' |
|
1899 |
itemValue: openDirectoryDiffView |
|
1900 |
translateLabel: true |
|
1901 |
isVisible: hasNotTwoDirectoriesSelectedHolder |
|
1902 |
) |
|
4930 | 1903 |
) |
1904 |
nil |
|
1905 |
nil |
|
1906 |
) |
|
9490 | 1907 |
|
9596 | 1908 |
"Modified: / 26-10-2010 / 17:16:05 / cg" |
4930 | 1909 |
! |
1910 |
||
3892 | 1911 |
newMenu |
1912 |
"This resource specification was automatically generated |
|
1913 |
by the MenuEditor of ST/X." |
|
1914 |
||
1915 |
"Do not manually edit this!! If it is corrupted, |
|
1916 |
the MenuEditor may not be able to read the specification." |
|
1917 |
||
1918 |
" |
|
1919 |
MenuEditor new openOnClass:DirectoryTreeBrowser andSelector:#newMenu |
|
1920 |
(Menu new fromLiteralArrayEncoding:(DirectoryTreeBrowser newMenu)) startUp |
|
1921 |
" |
|
1922 |
||
1923 |
<resource: #menu> |
|
1924 |
||
1925 |
^ |
|
1926 |
#(#Menu |
|
4414 | 1927 |
#( |
1928 |
#(#MenuItem |
|
1929 |
#label: 'Directory...' |
|
1930 |
#translateLabel: true |
|
1931 |
#value: #newDirectory |
|
1932 |
) |
|
1933 |
#(#MenuItem |
|
1934 |
#label: 'File...' |
|
1935 |
#translateLabel: true |
|
1936 |
#value: #newFile |
|
1937 |
) |
|
1938 |
#(#MenuItem |
|
1939 |
#label: 'Hard Link...' |
|
1940 |
#translateLabel: true |
|
1941 |
#isVisible: #systemIsUnix |
|
1942 |
#value: #newHardLink |
|
1943 |
) |
|
1944 |
#(#MenuItem |
|
1945 |
#label: 'Symbolic Link...' |
|
1946 |
#translateLabel: true |
|
1947 |
#isVisible: #systemIsUnix |
|
1948 |
#value: #newSoftLink |
|
1949 |
) |
|
1950 |
) |
|
1951 |
nil |
|
1952 |
nil |
|
3892 | 1953 |
) |
3906 | 1954 |
! |
1955 |
||
12142 | 1956 |
scmMenuSlice |
1957 |
"This resource specification was automatically generated |
|
1958 |
by the MenuEditor of ST/X." |
|
1959 |
||
1960 |
"Do not manually edit this!! If it is corrupted, |
|
1961 |
the MenuEditor may not be able to read the specification." |
|
1962 |
||
1963 |
||
1964 |
" |
|
12217 | 1965 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#scmMenuSlice |
1966 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser scmMenuSlice)) startUp |
|
12142 | 1967 |
" |
1968 |
||
1969 |
<resource: #menu> |
|
1970 |
||
1971 |
^ |
|
1972 |
#(Menu |
|
1973 |
( |
|
1974 |
(MenuItem |
|
1975 |
label: 'CVS' |
|
1976 |
isVisible: cvsMenusAreShown |
|
1977 |
submenuChannel: cvsMenu |
|
1978 |
) |
|
1979 |
(MenuItem |
|
1980 |
label: 'SVN' |
|
1981 |
isVisible: svnMenusAreShown |
|
1982 |
submenuChannel: svnMenu |
|
1983 |
) |
|
1984 |
(MenuItem |
|
1985 |
label: 'Mercurial' |
|
1986 |
isVisible: mercurialMenusAreShown |
|
1987 |
submenuChannel: mercurialMenu |
|
1988 |
) |
|
1989 |
(MenuItem |
|
12315 | 1990 |
label: 'HG' |
1991 |
isVisible: hgMenusAreShown |
|
1992 |
submenuChannel: hgMenu |
|
1993 |
) |
|
1994 |
(MenuItem |
|
12142 | 1995 |
label: 'Perforce' |
1996 |
isVisible: perforceMenusAreShown |
|
1997 |
submenuChannel: perforceMenu |
|
1998 |
) |
|
1999 |
) |
|
2000 |
nil |
|
2001 |
nil |
|
2002 |
) |
|
2003 |
! |
|
2004 |
||
4201 | 2005 |
showMenuSpec |
2006 |
"This resource specification was automatically generated |
|
2007 |
by the MenuEditor of ST/X." |
|
2008 |
||
2009 |
"Do not manually edit this!! If it is corrupted, |
|
2010 |
the MenuEditor may not be able to read the specification." |
|
2011 |
||
2012 |
" |
|
2013 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpec |
|
2014 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpec)) startUp |
|
2015 |
" |
|
2016 |
||
2017 |
<resource: #menu> |
|
2018 |
||
2019 |
^ |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2020 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2021 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2022 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2023 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2024 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2025 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2026 |
indication: showHiddenFiles |
4201 | 2027 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2028 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2029 |
label: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2030 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2031 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2032 |
label: 'Directory Tree' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2033 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2034 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2035 |
indication: showDirectoryTree |
4201 | 2036 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2037 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2038 |
label: 'Regular Files in TreeView (Left)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2039 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2040 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2041 |
indication: viewFilesInDirectoryTree |
4201 | 2042 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2043 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2044 |
label: 'Directories in ContentsView (Right)' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2045 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2046 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2047 |
indication: viewDirsInContentsBrowser |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2048 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2049 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2050 |
enabled: enableViewNoteBookApplication |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2051 |
label: 'File Applications' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2052 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2053 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2054 |
indication: viewNoteBookApplicationHolder |
4201 | 2055 |
) |
9111
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: '-' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2058 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2059 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2060 |
label: 'DiskUsage' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2061 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2062 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2063 |
indication: showDiskUsageHolder |
4201 | 2064 |
) |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2065 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2066 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2067 |
nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2068 |
) |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2069 |
! |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2070 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2071 |
showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2072 |
"This resource specification was automatically generated |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2073 |
by the MenuEditor of ST/X." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2074 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2075 |
"Do not manually edit this!! If it is corrupted, |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2076 |
the MenuEditor may not be able to read the specification." |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2077 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2078 |
" |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2079 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#showMenuSpecForDialog |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2080 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser showMenuSpecForDialog)) startUp |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2081 |
" |
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 |
<resource: #menu> |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2084 |
|
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2085 |
^ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2086 |
#(Menu |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2087 |
( |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2088 |
(MenuItem |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2089 |
label: 'Hidden Files' |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2090 |
translateLabel: true |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2091 |
hideMenuOnActivated: false |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
2092 |
indication: showHiddenFiles |
4554 | 2093 |
) |
4201 | 2094 |
) |
2095 |
nil |
|
2096 |
nil |
|
2097 |
) |
|
2098 |
! |
|
2099 |
||
3906 | 2100 |
sortMenu |
2101 |
"This resource specification was automatically generated |
|
2102 |
by the MenuEditor of ST/X." |
|
2103 |
||
2104 |
"Do not manually edit this!! If it is corrupted, |
|
2105 |
the MenuEditor may not be able to read the specification." |
|
2106 |
||
2107 |
" |
|
3907 | 2108 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#sortMenu |
2109 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser sortMenu)) startUp |
|
3906 | 2110 |
" |
2111 |
||
2112 |
<resource: #menu> |
|
2113 |
||
2114 |
^ |
|
2115 |
#(#Menu |
|
4414 | 2116 |
#( |
2117 |
#(#MenuItem |
|
2118 |
#label: 'By Filename' |
|
2119 |
#translateLabel: true |
|
2120 |
#hideMenuOnActivated: false |
|
2121 |
#choice: #sortBlockProperty |
|
2122 |
#choiceValue: #baseName |
|
2123 |
) |
|
2124 |
#(#MenuItem |
|
5122 | 2125 |
#label: 'By Extension' |
4414 | 2126 |
#translateLabel: true |
2127 |
#hideMenuOnActivated: false |
|
2128 |
#choice: #sortBlockProperty |
|
2129 |
#choiceValue: #suffix |
|
2130 |
) |
|
2131 |
#(#MenuItem |
|
2132 |
#label: 'By Permissions' |
|
2133 |
#translateLabel: true |
|
2134 |
#hideMenuOnActivated: false |
|
2135 |
#choice: #sortBlockProperty |
|
2136 |
#choiceValue: #permissions |
|
2137 |
) |
|
2138 |
#(#MenuItem |
|
2139 |
#label: 'By Owner' |
|
2140 |
#translateLabel: true |
|
2141 |
#isVisible: #viewOwner |
|
2142 |
#hideMenuOnActivated: false |
|
2143 |
#choice: #sortBlockProperty |
|
2144 |
#choiceValue: #owner |
|
2145 |
) |
|
2146 |
#(#MenuItem |
|
2147 |
#label: 'By Group' |
|
2148 |
#translateLabel: true |
|
2149 |
#isVisible: #viewOwner |
|
2150 |
#hideMenuOnActivated: false |
|
2151 |
#choice: #sortBlockProperty |
|
2152 |
#choiceValue: #group |
|
2153 |
) |
|
2154 |
#(#MenuItem |
|
2155 |
#label: 'By Size' |
|
2156 |
#translateLabel: true |
|
2157 |
#hideMenuOnActivated: false |
|
2158 |
#choice: #sortBlockProperty |
|
2159 |
#choiceValue: #fileSize |
|
2160 |
) |
|
2161 |
#(#MenuItem |
|
2162 |
#label: 'By Date && Time' |
|
2163 |
#translateLabel: true |
|
2164 |
#hideMenuOnActivated: false |
|
2165 |
#choice: #sortBlockProperty |
|
2166 |
#choiceValue: #modificationTime |
|
2167 |
) |
|
2168 |
#(#MenuItem |
|
2169 |
#label: '-' |
|
2170 |
) |
|
2171 |
#(#MenuItem |
|
2172 |
#label: 'Ignore Case in Sort' |
|
2173 |
#translateLabel: true |
|
2174 |
#hideMenuOnActivated: false |
|
2175 |
#indication: #sortCaseless |
|
2176 |
) |
|
2177 |
#(#MenuItem |
|
2178 |
#label: 'Directories before Files' |
|
2179 |
#translateLabel: true |
|
2180 |
#hideMenuOnActivated: false |
|
2181 |
#indication: #sortDirectoriesBeforeFiles |
|
2182 |
) |
|
2183 |
) |
|
2184 |
nil |
|
2185 |
nil |
|
3906 | 2186 |
) |
4018 | 2187 |
! |
2188 |
||
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2189 |
toolsMenuSpec |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2190 |
"This resource specification was automatically generated |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2191 |
by the MenuEditor of ST/X." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2192 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2193 |
"Do not manually edit this!! If it is corrupted, |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2194 |
the MenuEditor may not be able to read the specification." |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2195 |
|
11286 | 2196 |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2197 |
" |
4367 | 2198 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#toolsMenuSpec |
2199 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser toolsMenuSpec)) startUp |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2200 |
" |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2201 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2202 |
<resource: #menu> |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2203 |
|
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2204 |
^ |
5830 | 2205 |
#(Menu |
2206 |
( |
|
2207 |
(MenuItem |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2208 |
label: 'Open (Win32-Shell)' |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2209 |
itemValue: doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2210 |
isVisible: systemIsDOS |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2211 |
) |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
2212 |
(MenuItem |
6528 | 2213 |
label: 'Execute UNIX Command...' |
5830 | 2214 |
itemValue: doExecuteCommand |
6528 | 2215 |
isVisible: systemIsUnix |
2216 |
) |
|
2217 |
(MenuItem |
|
2218 |
label: 'Execute DOS Command...' |
|
2219 |
itemValue: doExecuteCommand |
|
2220 |
isVisible: systemIsDOS |
|
4230 | 2221 |
) |
5830 | 2222 |
(MenuItem |
5880 | 2223 |
label: 'Execute Script...' |
2224 |
itemValue: doExecuteScript |
|
2225 |
) |
|
2226 |
(MenuItem |
|
5830 | 2227 |
enabled: canDoTerminal |
2228 |
label: 'Shell Terminal' |
|
2229 |
itemValue: openTerminal |
|
2230 |
isVisible: canDoTerminalAndSystemIsUnix |
|
11286 | 2231 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'Shell Terminal') |
4230 | 2232 |
) |
5830 | 2233 |
(MenuItem |
2234 |
enabled: canDoTerminal |
|
2235 |
label: 'DOS Terminal' |
|
2236 |
itemValue: openTerminal |
|
2237 |
isVisible: canDoTerminalAndSystemIsDOS |
|
11286 | 2238 |
labelImage: (ResourceRetriever ToolbarIconLibrary terminal16x16Icon 'DOS Terminal') |
4230 | 2239 |
) |
5830 | 2240 |
(MenuItem |
2241 |
label: '-' |
|
4230 | 2242 |
) |
5830 | 2243 |
(MenuItem |
2244 |
enabled: hasFileSelection |
|
2245 |
label: 'Changes Browser' |
|
2246 |
itemValue: openChangesBrowser |
|
4230 | 2247 |
) |
5830 | 2248 |
(MenuItem |
2249 |
enabled: hasFileSelection |
|
2250 |
label: 'ChangeSet Browser' |
|
2251 |
itemValue: openChangeSetBrowser |
|
6602 | 2252 |
isVisible: changeSetBrowserItemVisible |
4230 | 2253 |
) |
5830 | 2254 |
(MenuItem |
6022 | 2255 |
enabled: hasFileSelection |
2256 |
label: 'Workspace' |
|
2257 |
itemValue: openWorkspace |
|
2258 |
) |
|
2259 |
(MenuItem |
|
2260 |
label: '-' |
|
2261 |
) |
|
2262 |
(MenuItem |
|
5830 | 2263 |
enabled: canReadAbbrevFile |
2264 |
label: 'Install Autoloaded' |
|
2265 |
itemValue: readAbbrevFile |
|
4230 | 2266 |
) |
5830 | 2267 |
(MenuItem |
2268 |
enabled: anySTFilesPresent |
|
6521 | 2269 |
label: 'Install All ST-Files as Autoloaded' |
5830 | 2270 |
itemValue: installAllAsAutoloaded |
4230 | 2271 |
) |
5830 | 2272 |
(MenuItem |
6586 | 2273 |
enabled: recursiveAnySTFilesPresent |
6521 | 2274 |
label: 'Recursive Install All ST-Files as Autoloaded' |
2275 |
itemValue: installAllAsAutoloadedRecursive |
|
2276 |
) |
|
2277 |
(MenuItem |
|
5830 | 2278 |
label: '-' |
4230 | 2279 |
) |
5830 | 2280 |
(MenuItem |
6593 | 2281 |
label: 'File Operations' |
2282 |
submenuChannel: fileOpMenu |
|
2283 |
) |
|
2284 |
(MenuItem |
|
5830 | 2285 |
label: 'File Utilities' |
2286 |
submenu: |
|
2287 |
(Menu |
|
2288 |
( |
|
2289 |
(MenuItem |
|
2290 |
enabled: hasFileSelection |
|
2291 |
label: 'Editor' |
|
2292 |
itemValue: openEditor |
|
4820 | 2293 |
) |
5830 | 2294 |
(MenuItem |
2295 |
enabled: hasFileSelection |
|
2296 |
label: 'HTML Reader' |
|
2297 |
itemValue: openHTMLReader |
|
4820 | 2298 |
) |
5830 | 2299 |
(MenuItem |
8832 | 2300 |
enabled: hasFileSelection |
2301 |
label: 'Web Browser' |
|
2302 |
itemValue: openWebBrowser |
|
2303 |
) |
|
2304 |
(MenuItem |
|
7869 | 2305 |
label: 'XML Inspector' |
9784 | 2306 |
itemValue: inspectXmlFile |
7869 | 2307 |
isVisible: hasXml |
7897
598301fad7b4
Missing aspect #hasXmlFileSelection
Stefan Vogel <sv@exept.de>
parents:
7879
diff
changeset
|
2308 |
showBusyCursorWhilePerforming: true |
7869 | 2309 |
) |
2310 |
(MenuItem |
|
5830 | 2311 |
enabled: hasFileSelection |
2312 |
label: 'Acroread (PDF Viewer)' |
|
2313 |
itemValue: openPDFViewer |
|
4820 | 2314 |
) |
5830 | 2315 |
(MenuItem |
2316 |
enabled: hasASN1AndSelection |
|
2317 |
label: 'ASN1 Browser' |
|
2318 |
itemValue: openASN1Browser |
|
2319 |
isVisible: hasASN1 |
|
4820 | 2320 |
) |
5830 | 2321 |
(MenuItem |
2322 |
enabled: hasCBrowser |
|
2323 |
label: 'C Browser' |
|
2324 |
itemValue: openCBrowser |
|
2325 |
isVisible: hasCBrowser |
|
4820 | 2326 |
) |
12871 | 2327 |
(MenuItem |
2328 |
enabled: canOpenMonticelloBrowser |
|
12811 | 2329 |
label: 'Monticello Browser' |
2330 |
itemValue: doOpenMonticelloBrowser |
|
2331 |
) |
|
2332 |
(MenuItem |
|
5830 | 2333 |
enabled: hasJavaAndSelection |
2334 |
label: 'Applet Viewer' |
|
2335 |
itemValue: openAppletViewer |
|
2336 |
isVisible: hasJava |
|
4820 | 2337 |
) |
5830 | 2338 |
(MenuItem |
2339 |
enabled: hasMP3PlayerAndSelection |
|
2340 |
label: 'MP3 Player' |
|
2341 |
itemValue: openMP3Player |
|
2342 |
isVisible: hasMP3Player |
|
4820 | 2343 |
) |
5830 | 2344 |
(MenuItem |
2345 |
enabled: hasFileSelection |
|
2346 |
label: 'xv (Image Viewer)' |
|
2347 |
itemValue: openXV |
|
6460 | 2348 |
isVisible: systemIsUnix |
4950 | 2349 |
) |
5830 | 2350 |
(MenuItem |
2351 |
enabled: currentFilesAreInSameDirectory |
|
2352 |
label: 'Slide Show' |
|
2353 |
itemValue: openSlideShow |
|
2354 |
isVisible: hasSlideShow |
|
4820 | 2355 |
) |
5830 | 2356 |
(MenuItem |
2357 |
enabled: hasFileSelection |
|
2358 |
label: 'gv (Postscript Viewer)' |
|
2359 |
itemValue: openGV |
|
6460 | 2360 |
isVisible: systemIsUnix |
2361 |
) |
|
2362 |
(MenuItem |
|
2363 |
enabled: hasMP3PlayerAndSelection |
|
2364 |
label: 'MP3 Player' |
|
2365 |
itemValue: openMP3Player |
|
2366 |
isVisible: hasMP3Player |
|
4957 | 2367 |
) |
5830 | 2368 |
(MenuItem |
2369 |
enabled: hasFileSelection |
|
9509 | 2370 |
label: 'Realplay (avi viewer)' |
5830 | 2371 |
itemValue: openRP |
6460 | 2372 |
isVisible: systemIsUnix |
2373 |
) |
|
2374 |
(MenuItem |
|
2375 |
label: '-' |
|
2376 |
) |
|
2377 |
(MenuItem |
|
2378 |
label: 'Smalltalk' |
|
2379 |
submenu: |
|
2380 |
(Menu |
|
2381 |
( |
|
2382 |
(MenuItem |
|
2383 |
enabled: hasSnapshotSelection |
|
2384 |
label: 'Snapshot Image Browser' |
|
2385 |
itemValue: openSnapshotImageBrowser |
|
2386 |
) |
|
2387 |
(MenuItem |
|
2388 |
enabled: canCreateNewProject |
|
2389 |
label: 'Create Smalltalk Project' |
|
2390 |
itemValue: createProjectAndOpenProjectBrowser |
|
2391 |
) |
|
2392 |
(MenuItem |
|
2393 |
label: '-' |
|
2394 |
) |
|
2395 |
(MenuItem |
|
8426 | 2396 |
enabled: hasResourceFileSelected |
6460 | 2397 |
label: 'Show Contents of Resourcefile' |
2398 |
itemValue: readAndShowResources |
|
2399 |
) |
|
8426 | 2400 |
(MenuItem |
2401 |
enabled: hasResourceFileSelected |
|
2402 |
label: 'Resource File Editor' |
|
2403 |
itemValue: openResourceFileEditor |
|
2404 |
showBusyCursorWhilePerforming: true |
|
2405 |
) |
|
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2406 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2407 |
label: '-' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2408 |
) |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2409 |
(MenuItem |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2410 |
enabled: hasFileSelection |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2411 |
label: 'Contents as ByteArray' |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2412 |
itemValue: fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
2413 |
) |
6460 | 2414 |
) |
2415 |
nil |
|
2416 |
nil |
|
2417 |
) |
|
2418 |
) |
|
2419 |
(MenuItem |
|
2420 |
label: 'Image' |
|
2421 |
submenu: |
|
2422 |
(Menu |
|
2423 |
( |
|
2424 |
(MenuItem |
|
2425 |
enabled: hasFileSelection |
|
2426 |
label: 'Image Editor' |
|
2427 |
itemValue: openImageEditor |
|
2428 |
) |
|
2429 |
(MenuItem |
|
2430 |
enabled: hasFileSelection |
|
2431 |
label: 'Image Preview' |
|
2432 |
itemValue: openImagePreview |
|
2433 |
) |
|
2434 |
(MenuItem |
|
2435 |
enabled: hasFileSelection |
|
2436 |
label: 'Image Inspector' |
|
2437 |
itemValue: openImageInspector |
|
2438 |
) |
|
2439 |
(MenuItem |
|
2440 |
label: '-' |
|
2441 |
) |
|
2442 |
(MenuItem |
|
2443 |
enabled: hasFileSelection |
|
2444 |
label: 'Convert to GIF' |
|
2445 |
itemValue: convertImageToGIF |
|
2446 |
) |
|
2447 |
(MenuItem |
|
2448 |
enabled: hasFileSelection |
|
2449 |
label: 'Convert to PNG' |
|
2450 |
itemValue: convertImageToPNG |
|
2451 |
) |
|
2452 |
(MenuItem |
|
2453 |
enabled: hasFileSelection |
|
2454 |
label: 'Convert to XPM' |
|
2455 |
itemValue: convertImageToXPM |
|
2456 |
) |
|
2457 |
(MenuItem |
|
2458 |
enabled: hasFileSelection |
|
2459 |
label: 'Convert to JPG' |
|
2460 |
itemValue: convertImageToJPG |
|
2461 |
) |
|
2462 |
) |
|
2463 |
nil |
|
2464 |
nil |
|
2465 |
) |
|
2466 |
) |
|
2467 |
(MenuItem |
|
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
2468 |
enabled: hasZipFileSelectedHolder |
6460 | 2469 |
label: 'ZipFile Tool' |
2470 |
itemValue: openZipTool |
|
2471 |
) |
|
2472 |
(MenuItem |
|
2473 |
enabled: hasFileSelection |
|
2474 |
label: 'Hex Dump' |
|
2475 |
itemValue: fileHexDump |
|
4958 | 2476 |
) |
4820 | 2477 |
) |
2478 |
nil |
|
2479 |
nil |
|
2480 |
) |
|
4230 | 2481 |
) |
5830 | 2482 |
(MenuItem |
2483 |
label: 'Find' |
|
2484 |
submenu: |
|
2485 |
(Menu |
|
2486 |
( |
|
2487 |
(MenuItem |
|
2488 |
label: 'File...' |
|
2489 |
itemValue: fileFindFile |
|
4367 | 2490 |
) |
5830 | 2491 |
(MenuItem |
10306 | 2492 |
label: 'Same Contents as Selected...' |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2493 |
itemValue: fileFindDuplicateFile |
12871 | 2494 |
enabled: hasFileSelection |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2495 |
) |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
2496 |
(MenuItem |
5830 | 2497 |
label: 'Duplicate Files' |
2498 |
itemValue: fileFindDuplicates |
|
5082 | 2499 |
) |
5830 | 2500 |
(MenuItem |
2501 |
enabled: hasSelection |
|
2502 |
label: 'All Duplicate Files (Recursive)' |
|
2503 |
itemValue: fileFindAllDuplicates |
|
4367 | 2504 |
) |
8510 | 2505 |
(MenuItem |
2506 |
label: 'Similar Image Files' |
|
2507 |
itemValue: fileFindSimilarImages |
|
2508 |
isVisible: hasImageColorHistogram |
|
2509 |
) |
|
4367 | 2510 |
) |
2511 |
nil |
|
2512 |
nil |
|
2513 |
) |
|
4230 | 2514 |
) |
2515 |
) |
|
2516 |
nil |
|
2517 |
nil |
|
4164
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2518 |
) |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2519 |
! |
81154143d447
move toolsMenuSpec from FileBrowserV2 to AbstractFileBrowser
penk
parents:
4163
diff
changeset
|
2520 |
|
4018 | 2521 |
viewDetailsMenuSpec |
2522 |
"This resource specification was automatically generated |
|
2523 |
by the MenuEditor of ST/X." |
|
2524 |
||
2525 |
"Do not manually edit this!! If it is corrupted, |
|
2526 |
the MenuEditor may not be able to read the specification." |
|
2527 |
||
2528 |
" |
|
4648 | 2529 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#viewDetailsMenuSpec |
2530 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser viewDetailsMenuSpec)) startUp |
|
4018 | 2531 |
" |
2532 |
||
2533 |
<resource: #menu> |
|
2534 |
||
2535 |
^ |
|
2536 |
#(#Menu |
|
4414 | 2537 |
#( |
2538 |
#(#MenuItem |
|
2539 |
#label: '-' |
|
2540 |
) |
|
2541 |
#(#MenuItem |
|
2542 |
#label: 'Hidden Files' |
|
2543 |
#translateLabel: true |
|
2544 |
#indication: #showHiddenFiles |
|
2545 |
) |
|
2546 |
) |
|
2547 |
nil |
|
2548 |
nil |
|
4018 | 2549 |
) |
3892 | 2550 |
! ! |
2551 |
||
11144 | 2552 |
!AbstractFileBrowser class methodsFor:'menu specs-scm'! |
2553 |
||
2554 |
cvsMenu |
|
2555 |
"This resource specification was automatically generated |
|
2556 |
by the MenuEditor of ST/X." |
|
2557 |
||
2558 |
"Do not manually edit this!! If it is corrupted, |
|
2559 |
the MenuEditor may not be able to read the specification." |
|
2560 |
||
11149 | 2561 |
|
11144 | 2562 |
" |
2563 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#cvsMenu |
|
2564 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser cvsMenu)) startUp |
|
2565 |
" |
|
2566 |
||
2567 |
<resource: #menu> |
|
2568 |
||
2569 |
^ |
|
11149 | 2570 |
#(Menu |
2571 |
( |
|
2572 |
(MenuItem |
|
2573 |
label: 'Commit (CVS)...' |
|
2574 |
itemValue: cvsCommit |
|
2575 |
translateLabel: true |
|
2576 |
) |
|
2577 |
(MenuItem |
|
2578 |
enabled: canCvsAddAndCommit |
|
2579 |
label: 'Add && Commit...' |
|
2580 |
itemValue: cvsAddAndCommit |
|
2581 |
translateLabel: true |
|
2582 |
) |
|
2583 |
(MenuItem |
|
2584 |
enabled: canCvsAddAndCommit |
|
2585 |
label: 'Add as Binary && Commit...' |
|
2586 |
itemValue: cvsAddBinaryAndCommit |
|
2587 |
translateLabel: true |
|
2588 |
) |
|
2589 |
(MenuItem |
|
2590 |
label: '-' |
|
2591 |
) |
|
2592 |
(MenuItem |
|
2593 |
enabled: hasSelection |
|
2594 |
label: 'Update selected Files/Directories' |
|
2595 |
itemValue: cvsUpdateSelection |
|
2596 |
translateLabel: true |
|
2597 |
) |
|
2598 |
(MenuItem |
|
2599 |
label: 'Update Directory Local' |
|
2600 |
itemValue: cvsUpdateAll |
|
2601 |
translateLabel: true |
|
2602 |
) |
|
2603 |
(MenuItem |
|
2604 |
label: 'Update Directory Recursive' |
|
2605 |
itemValue: cvsUpdateAllRecursive |
|
2606 |
translateLabel: true |
|
2607 |
) |
|
2608 |
(MenuItem |
|
2609 |
label: '-' |
|
2610 |
) |
|
2611 |
(MenuItem |
|
2612 |
enabled: hasSelection |
|
2613 |
label: 'Tag...' |
|
2614 |
itemValue: cvsTagSelection |
|
2615 |
translateLabel: true |
|
2616 |
) |
|
2617 |
(MenuItem |
|
2618 |
enabled: hasSelection |
|
2619 |
label: 'Revision Log' |
|
2620 |
itemValue: cvsRevisionLog |
|
2621 |
translateLabel: true |
|
2622 |
) |
|
2623 |
(MenuItem |
|
2624 |
enabled: hasSelection |
|
2625 |
label: 'Compare with newest in Repository' |
|
2626 |
itemValue: cvsCompareWithNewest |
|
2627 |
translateLabel: true |
|
2628 |
) |
|
2629 |
(MenuItem |
|
2630 |
label: '-' |
|
2631 |
) |
|
2632 |
(MenuItem |
|
2633 |
enabled: canRemoveCVSContainer |
|
2634 |
label: 'Remove File && CVS Container...' |
|
2635 |
itemValue: cvsRemoveFileAndCVSContainer |
|
2636 |
translateLabel: true |
|
11144 | 2637 |
) |
2638 |
) |
|
2639 |
nil |
|
2640 |
nil |
|
2641 |
) |
|
2642 |
! |
|
2643 |
||
2644 |
mercurialMenu |
|
2645 |
"This resource specification was automatically generated |
|
2646 |
by the MenuEditor of ST/X." |
|
2647 |
||
2648 |
"Do not manually edit this!! If it is corrupted, |
|
2649 |
the MenuEditor may not be able to read the specification." |
|
2650 |
||
2651 |
||
2652 |
" |
|
2653 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#mercurialMenu |
|
2654 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser mercurialMenu)) startUp |
|
2655 |
" |
|
2656 |
||
2657 |
<resource: #menu> |
|
2658 |
||
2659 |
^ |
|
2660 |
#(Menu |
|
2661 |
( |
|
2662 |
(MenuItem |
|
2663 |
label: 'Add' |
|
2664 |
itemValue: mercurialAdd |
|
2665 |
translateLabel: true |
|
2666 |
) |
|
2667 |
(MenuItem |
|
2668 |
label: 'Commit Changes' |
|
2669 |
itemValue: mercurialCommit |
|
2670 |
translateLabel: true |
|
2671 |
) |
|
2672 |
(MenuItem |
|
2673 |
label: 'Push...' |
|
2674 |
itemValue: mercurialPush |
|
2675 |
translateLabel: true |
|
2676 |
) |
|
2677 |
(MenuItem |
|
2678 |
label: 'Status' |
|
2679 |
itemValue: mercurialStatus |
|
2680 |
translateLabel: true |
|
2681 |
) |
|
2682 |
(MenuItem |
|
2683 |
label: '-' |
|
2684 |
) |
|
2685 |
(MenuItem |
|
2686 |
label: 'Init' |
|
2687 |
itemValue: mercurialInit |
|
2688 |
translateLabel: true |
|
2689 |
) |
|
2690 |
) |
|
2691 |
nil |
|
2692 |
nil |
|
2693 |
) |
|
2694 |
||
2695 |
"Modified: / 17-01-2012 / 15:57:40 / cg" |
|
2696 |
! |
|
2697 |
||
2698 |
perforceMenu |
|
2699 |
"This resource specification was automatically generated |
|
2700 |
by the MenuEditor of ST/X." |
|
2701 |
||
2702 |
"Do not manually edit this!! If it is corrupted, |
|
2703 |
the MenuEditor may not be able to read the specification." |
|
2704 |
||
2705 |
||
2706 |
" |
|
2707 |
MenuEditor new openOnClass:AbstractFileBrowser andSelector:#perforceMenu |
|
2708 |
(Menu new fromLiteralArrayEncoding:(AbstractFileBrowser perforceMenu)) startUp |
|
2709 |
" |
|
2710 |
||
2711 |
<resource: #menu> |
|
2712 |
||
2713 |
^ |
|
2714 |
#(Menu |
|
2715 |
( |
|
2716 |
(MenuItem |
|
2717 |
label: 'Commit' |
|
2718 |
itemValue: perforceCommit |
|
2719 |
translateLabel: true |
|
2720 |
) |
|
2721 |
) |
|
2722 |
nil |
|
2723 |
nil |
|
2724 |
) |
|
2725 |
||
2726 |
"Created: / 15-01-2012 / 13:12:30 / cg" |
|
2727 |
! ! |
|
2728 |
||
3892 | 2729 |
!AbstractFileBrowser class methodsFor:'misc'! |
2730 |
||
2731 |
newLock |
|
2732 |
^ CodeExecutionLock new |
|
2733 |
! ! |
|
2734 |
||
5644
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2735 |
!AbstractFileBrowser class methodsFor:'resources'! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2736 |
|
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2737 |
classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2738 |
^ FileBrowser classResources |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2739 |
! ! |
e24749db1f5f
share resources with FileBrowser
Claus Gittinger <cg@exept.de>
parents:
5634
diff
changeset
|
2740 |
|
4610 | 2741 |
!AbstractFileBrowser class methodsFor:'utilities'! |
2742 |
||
11262 | 2743 |
contentsOfBytesAsHexDump:data numberOfAddressDigits:addrDigits addressStart:virtualStart |
2744 |
"utility helper: generate a hexDump with addresses" |
|
2745 |
||
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2746 |
|lines nHexLines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2747 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2748 |
"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
|
2749 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2750 |
nHexLines := (data size + 15) // 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2751 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2752 |
lines := VirtualArray new. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2753 |
lines setSize:nHexLines + (nHexLines // 16). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2754 |
lines |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2755 |
generator:[:lineNr | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2756 |
|blockNr lineNrInBlock startOffset lineStream asciiLineStream byte line| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2757 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2758 |
blockNr := (lineNr - 1) // 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2759 |
lineNrInBlock := (lineNr - 1) \\ 17. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2760 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2761 |
lineNrInBlock == 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2762 |
line := '' |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2763 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2764 |
startOffset := ((blockNr * 16) + lineNrInBlock) * 16. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2765 |
lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2766 |
asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2767 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2768 |
lineStream nextPutAll:((startOffset+virtualStart) hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2769 |
lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2770 |
1 to:16 do:[:i | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2771 |
i ~~ 1 ifTrue:[ lineStream space ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2772 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2773 |
(startOffset + i) > data size ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2774 |
asciiLineStream nextPut:(Character space). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2775 |
lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2776 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2777 |
byte := data at:startOffset + i. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2778 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2779 |
lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2780 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2781 |
(byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2782 |
asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2783 |
] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2784 |
asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2785 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2786 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2787 |
]. |
12421 | 2788 |
line := (lineStream contents paddedTo:(addrDigits + 1 + (3*16)+ 8)) |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2789 |
, asciiLineStream contents. |
11262 | 2790 |
]. |
11281
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2791 |
line |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2792 |
]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2793 |
^ lines. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2794 |
|
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2795 |
"/ |offs |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2796 |
"/ col line lineStream asciiLineStream lines| |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2797 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2798 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2799 |
"/ offs := virtualStart. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2800 |
"/ lines := StringCollection new. |
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 |
"/ lineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2803 |
"/ asciiLineStream := String writeStream. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2804 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2805 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2806 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2807 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2808 |
"/ data do:[:byte | |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2809 |
"/ lineStream nextPutAll:(byte hexPrintString:2). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2810 |
"/ (byte between:32 and:127) ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2811 |
"/ asciiLineStream nextPut:(Character value:byte) |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2812 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2813 |
"/ asciiLineStream nextPut:$. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2814 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2815 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2816 |
"/ offs := offs + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2817 |
"/ col := col + 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2818 |
"/ col > 16 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2819 |
"/ lineStream nextPutAll:' '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2820 |
"/ lineStream nextPutAll:asciiLineStream contents. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2821 |
"/ lines add:(lineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2822 |
"/ (offs bitAnd:16rFF) == 0 ifTrue:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2823 |
"/ lines add:nil |
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 |
"/ lineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2826 |
"/ asciiLineStream reset. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2827 |
"/ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2828 |
"/ lineStream nextPutAll:(offs hexPrintString:addrDigits). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2829 |
"/ lineStream nextPutAll:': '. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2830 |
"/ col := 1. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2831 |
"/ ] ifFalse:[ |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2832 |
"/ lineStream space |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2833 |
"/ ] |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2834 |
"/ ]. |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2835 |
"/ line := lineStream contents paddedTo:(3*16 + addrDigits + 1). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2836 |
"/ lines add:(line , ' ' , asciiLineStream contents). |
1064ace6fbfa
changed: #contentsOfBytesAsHexDump:numberOfAddressDigits:addressStart:
Claus Gittinger <cg@exept.de>
parents:
11262
diff
changeset
|
2837 |
"/ ^ lines |
11262 | 2838 |
|
2839 |
"Created: / 13-02-2012 / 15:01:46 / cg" |
|
2840 |
! |
|
2841 |
||
4610 | 2842 |
contentsOfFileAsHexDump:f |
8472 | 2843 |
^ self contentsOfFileAsHexDump:f withLimit:nil lastPart:nil |
2844 |
! |
|
2845 |
||
2846 |
contentsOfFileAsHexDump:f withLimit:limitOrNil lastPart:showLastPartOrNil |
|
4610 | 2847 |
|resources fileName stream data offs |
11262 | 2848 |
addrDigits col lines answer sizeLimit showLastPart| |
4610 | 2849 |
|
2850 |
resources := self classResources. |
|
2851 |
||
2852 |
fileName := f baseName. |
|
2853 |
f isDirectory ifTrue:[ |
|
2854 |
Dialog warn:(resources string:'%1 is a directory.' with:fileName). |
|
2855 |
^ nil |
|
2856 |
]. |
|
2857 |
f exists ifFalse:[ |
|
2858 |
Dialog warn:(resources string:'oops, ''%1'' is gone or unreadable.' with:fileName). |
|
2859 |
^ nil |
|
2860 |
]. |
|
2861 |
f isReadable ifFalse:[ |
|
2862 |
Dialog warn:(resources string:'''%1'' is unreadable.' with:fileName). |
|
2863 |
^ nil |
|
2864 |
]. |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
2865 |
f fileSize > (1024*1024) ifTrue:[ |
8472 | 2866 |
limitOrNil notNil ifTrue:[ |
2867 |
sizeLimit := limitOrNil. |
|
2868 |
showLastPart := showLastPartOrNil |
|
2869 |
] ifFalse:[ |
|
2870 |
answer := Dialog |
|
2871 |
confirmWithCancel:(resources |
|
2872 |
stringWithCRs:'"%1" is very large (%2).\\Show all or only the first 4 Mb ?' |
|
2873 |
with:(fileName contractTo:40) allBold |
|
2874 |
with:(UnitConverter fileSizeStringFor:f fileSize)) |
|
2875 |
labels:#('Cancel' 'Show All' 'Show First Part' ). |
|
2876 |
||
2877 |
answer isNil ifTrue:[^ nil]. |
|
2878 |
answer ifTrue:[ |
|
2879 |
sizeLimit := 4 * 1024 * 1024 |
|
2880 |
]. |
|
8436 | 2881 |
]. |
4610 | 2882 |
]. |
2883 |
||
2884 |
stream := f readStream binary. |
|
8436 | 2885 |
sizeLimit notNil ifTrue:[ |
8472 | 2886 |
showLastPart == true ifTrue:[ |
2887 |
stream position:(f fileSize - sizeLimit). |
|
2888 |
]. |
|
8436 | 2889 |
data := stream nextBytes:sizeLimit. |
2890 |
] ifFalse:[ |
|
2891 |
data := stream contents. |
|
2892 |
]. |
|
4610 | 2893 |
stream close. |
2894 |
||
2895 |
col := 1. |
|
2896 |
offs := 0. |
|
2897 |
lines := StringCollection new. |
|
2898 |
||
2899 |
addrDigits := ((f fileSize + 1) log:16) truncated + 1. |
|
2900 |
||
11262 | 2901 |
^ self |
2902 |
contentsOfBytesAsHexDump:data |
|
2903 |
numberOfAddressDigits:addrDigits |
|
2904 |
addressStart:0 |
|
2905 |
||
2906 |
"Modified: / 13-02-2012 / 15:01:19 / cg" |
|
4610 | 2907 |
! ! |
2908 |
||
3892 | 2909 |
!AbstractFileBrowser methodsFor:'actions'! |
2910 |
||
2911 |
askForCommandFor:fileName thenDo:aBlock |
|
6284 | 2912 |
"setup and launch a querybox to ask for a unix command. |
3892 | 2913 |
Then evaluate aBlock passing the command-string as argument." |
2914 |
||
4523 | 2915 |
|box osName commandString| |
3892 | 2916 |
|
2917 |
osName := OperatingSystem platformName. |
|
2918 |
||
2919 |
box := FilenameEnterBox |
|
4414 | 2920 |
title:(resources string:'Execute %1 command:' with:osName) |
2921 |
okText:(resources string:'Execute') |
|
4523 | 2922 |
action:[:cmd | commandString := cmd]. |
3892 | 2923 |
|
2924 |
fileName notNil ifTrue:[ |
|
4414 | 2925 |
self initialCommandFor:fileName into:box. |
3892 | 2926 |
]. |
2927 |
box directory:(self getDirWithoutFileName:fileName). |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
2928 |
box show. |
3892 | 2929 |
box destroy. |
2930 |
||
4523 | 2931 |
commandString notNil ifTrue:[ |
2932 |
aBlock value:commandString |
|
2933 |
]. |
|
2934 |
||
3892 | 2935 |
"Modified: / 7.9.1995 / 10:31:54 / claus" |
2936 |
"Modified: / 16.9.1997 / 15:35:10 / stefan" |
|
2937 |
"Modified: / 14.8.1998 / 14:12:52 / cg" |
|
2938 |
! |
|
2939 |
||
2940 |
changeFileBrowserTitleTo:aString |
|
4774 | 2941 |
self |
2942 |
applicationNamed:#FileBrowserV2 |
|
5009 | 2943 |
ifPresentDo:[:app | app changeFileBrowserTitleTo:aString] |
3892 | 2944 |
! |
2945 |
||
2946 |
copyFileList |
|
4774 | 2947 |
"copy the fileList to the clipBoard" |
2948 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2949 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2950 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2951 |
fileList := self |
4774 | 2952 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2953 |
ifPresentDo:[:app | app browserFileList]. |
2954 |
||
2955 |
fileList notNil ifTrue:[ |
|
2956 |
self copyFileListToClipBoard:fileList. |
|
2957 |
] |
|
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2958 |
! |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2959 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2960 |
copyFileListToClipBoard:fileList |
4774 | 2961 |
"copy the itemList to the clipBoard" |
2962 |
||
2963 |
|stream| |
|
2964 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2965 |
fileList isEmpty ifTrue:[^ self]. |
4774 | 2966 |
|
5772
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2967 |
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
|
2968 |
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
|
2969 |
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
|
2970 |
] ifFalse:[ |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2971 |
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
|
2972 |
(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
|
2973 |
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
|
2974 |
] |
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
2975 |
]. |
3892 | 2976 |
]. |
6034 | 2977 |
self window setClipboardText:stream contents. |
3892 | 2978 |
! |
2979 |
||
2980 |
copySelectedFilenames |
|
4774 | 2981 |
"copy the selected fileNames to the clipBoard" |
2982 |
||
4973
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2983 |
|fileList| |
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2984 |
|
e4b72eec43d3
refactoring the browserItemList access in directoryContentsBrowser
penk
parents:
4963
diff
changeset
|
2985 |
fileList := self |
4774 | 2986 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 2987 |
ifPresentDo:[:appl | appl selectedFileNames]. |
2988 |
fileList notNil ifTrue:[ |
|
2989 |
self copyFileListToClipBoard:fileList. |
|
2990 |
]. |
|
3892 | 2991 |
! |
2992 |
||
10923 | 2993 |
doAddArchiver |
2994 |
|files| |
|
2995 |
||
2996 |
files := self currentSelectedFiles. |
|
2997 |
files size == 1 ifFalse:[ |
|
2998 |
Dialog information:'Select exactly one archive.'. |
|
2999 |
^ self |
|
3000 |
]. |
|
3001 |
||
3002 |
self |
|
3003 |
applicationNamed:#FileApplicationNoteBook |
|
3004 |
ifPresentDo:[:appl | appl doAddArchiverOn:files first]. |
|
3005 |
||
3006 |
"Created: / 29-11-2011 / 19:01:31 / cg" |
|
3007 |
! |
|
3008 |
||
3892 | 3009 |
doAddTerminal |
5960 | 3010 |
|dir| |
3011 |
||
3012 |
dir := self currentDirectory. |
|
3892 | 3013 |
|
5960 | 3014 |
dir isNil ifTrue:[ |
4414 | 3015 |
dir := Filename homeDirectory |
3892 | 3016 |
]. |
4774 | 3017 |
|
5009 | 3018 |
self |
3019 |
applicationNamed:#FileApplicationNoteBook |
|
3020 |
ifPresentDo:[:appl | appl addTerminalIn:dir]. |
|
3892 | 3021 |
! |
3022 |
||
3023 |
doOpenSearchFile |
|
5961 | 3024 |
|item file| |
3025 |
||
3026 |
file := self firstSelectedFileName. |
|
3027 |
file isNil ifTrue:[ |
|
3028 |
file := Filename homeDirectory asAbsoluteFilename. |
|
3029 |
]. |
|
3030 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
3892 | 3031 |
self openSearchFileOn:item. |
3032 |
! |
|
3033 |
||
3034 |
doShowFileContents |
|
5009 | 3035 |
self |
3036 |
applicationNamed:#DirectoryContentsBrowser |
|
3037 |
ifPresentDo:[:appl | ^ appl doShowFileContents]. |
|
3038 |
||
3039 |
^ nil |
|
3892 | 3040 |
! |
3041 |
||
3042 |
doShowProperties |
|
3043 |
"show long stat (file)-info" |
|
3044 |
||
3045 |
self fileGetInfo:true |
|
3046 |
! |
|
3047 |
||
5528 | 3048 |
fileEncodingDialog |
3049 |
"open a dialog to allow change of the files character encoding. |
|
3050 |
Files are converted to internal encoding when read, and converted back |
|
3051 |
to this encoding when saved. |
|
3052 |
Notice: currently, not too many encodings are supported by the system." |
|
3053 |
||
3054 |
|bindings encodings encodingDescr idx selectedEncoding| |
|
3055 |
||
3056 |
encodingDescr := CharacterEncoder supportedExternalEncodings. |
|
3057 |
encodings := encodingDescr collect:[:d | d isNil ifTrue:[nil] ifFalse:[d first]]. |
|
3058 |
||
3059 |
bindings := IdentityDictionary new. |
|
3060 |
bindings at:#encodingList put:encodingDescr. |
|
3061 |
bindings at:#selectedEncoding put:(encodings indexOf:self fileEncoding ifAbsent:1) asValue. |
|
5737 | 3062 |
bindings at:#lockFileEncoding put:(self lockFileEncodingHolder value asValue). |
3063 |
||
5528 | 3064 |
(self openDialogInterface:#encodingDialogSpec withBindings:bindings) |
3065 |
ifTrue:[ |
|
3066 |
idx := (bindings at:#selectedEncoding) value. |
|
3067 |
selectedEncoding := encodings at:idx. |
|
3068 |
selectedEncoding notNil ifTrue:[ |
|
5704 | 3069 |
self fileEncoding:selectedEncoding asSymbol. |
5528 | 3070 |
]. |
5737 | 3071 |
self lockFileEncoding:(bindings at:#lockFileEncoding) value. |
5528 | 3072 |
]. |
3073 |
||
3074 |
"Modified: 30.6.1997 / 14:41:12 / cg" |
|
3075 |
! |
|
3076 |
||
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3077 |
gotoFile:aFilename |
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3078 |
"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
|
3079 |
|
5959 | 3080 |
|currentFileNameHolder currentSel| |
3081 |
||
3082 |
currentFileNameHolder := self currentFileNameHolder. |
|
3083 |
||
3084 |
currentSel := currentFileNameHolder value. |
|
5380
2f738f3a34b1
fixed bug introduced by stefans beautification ;-)
Claus Gittinger <cg@exept.de>
parents:
5374
diff
changeset
|
3085 |
(currentSel includes:aFilename) ifFalse:[ |
9677 | 3086 |
self withWaitCursorDo:[ |
3087 |
currentFileNameHolder value:(OrderedCollection with:(aFilename asAbsoluteFilename)). |
|
3088 |
] |
|
3089 |
]. |
|
3090 |
||
3091 |
"Modified: / 29-12-2010 / 11:04:29 / cg" |
|
3892 | 3092 |
! |
3093 |
||
11053 | 3094 |
lineEndConventionDialog |
3095 |
"open a dialog to allow change of the line end conventions |
|
3096 |
(when writing files)" |
|
3097 |
||
3098 |
|bindings| |
|
3099 |
||
3100 |
bindings := IdentityDictionary new. |
|
3101 |
bindings at:#lineEndConvention put:(self lineEndConvention asValue). |
|
3102 |
||
3103 |
(self openDialogInterface:#lineEndConventionDialogSpec withBindings:bindings) |
|
3104 |
ifTrue:[ |
|
3105 |
self lineEndConventionHolder value:(bindings at:#lineEndConvention) value |
|
3106 |
]. |
|
3107 |
||
3108 |
"Created: / 06-01-2012 / 15:34:51 / cg" |
|
3109 |
! |
|
3110 |
||
4392 | 3111 |
newTextEditor |
5009 | 3112 |
self |
3113 |
applicationNamed:#FileApplicationNoteBook |
|
3114 |
ifPresentDo:[:appl | ^ appl newTextEditor]. |
|
3115 |
||
3116 |
^ nil. |
|
3117 |
! |
|
3118 |
||
3119 |
openApplByFileItem:anItem |
|
8490 | 3120 |
"/ q: is the following always wanted ? |
9267 | 3121 |
self window sensor shiftDown ifFalse:[ |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3122 |
"/ cg: no - batch and shell scripts are to be |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3123 |
"/ anItem fileName isExecutableProgram ifTrue:[ |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3124 |
"/ self executeCommand:anItem fileName pathName. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3125 |
"/ ^ self. |
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3126 |
"/ ]. |
9267 | 3127 |
|
8490 | 3128 |
"/ OperatingSystem isMSWINDOWSlike ifTrue:[ |
3129 |
"/ Error handle:[:ex | |
|
3130 |
"/ ] do:[ |
|
3131 |
"/ OperatingSystem |
|
3132 |
"/ shellExecute:nil |
|
3133 |
"/ lpOperation:'open' |
|
3134 |
"/ lpFile:(anItem fileName pathName) |
|
3135 |
"/ lpParameters:nil |
|
3136 |
"/ lpDirectory:(self directory pathName) |
|
3137 |
"/ nShowCmd:#SW_SHOWNORMAL. |
|
3138 |
"/ ^ self. |
|
3139 |
"/ ] |
|
3140 |
"/ ] |
|
9267 | 3141 |
]. |
5306 | 3142 |
^ self |
5009 | 3143 |
applicationNamed:#FileApplicationNoteBook |
5306 | 3144 |
ifPresentDo:[:appl | appl openApplByFileItem:anItem]. |
10669
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3145 |
|
079d85556631
changed: #openApplByFileItem:
Claus Gittinger <cg@exept.de>
parents:
10556
diff
changeset
|
3146 |
"Modified: / 06-09-2011 / 11:11:15 / cg" |
3892 | 3147 |
! |
3148 |
||
4392 | 3149 |
openApplForFile:aFilename |
5306 | 3150 |
^ self openApplByFileItem:(DirectoryContentsBrowser itemClass fileName:aFilename). |
4392 | 3151 |
! |
3152 |
||
3892 | 3153 |
openCommandResultApplication |
3154 |
||
5009 | 3155 |
self |
3156 |
applicationNamed:#FileApplicationNoteBook |
|
3157 |
ifPresentDo:[:appl | ^ appl openCommandResultApplication]. |
|
3158 |
||
3159 |
^ nil |
|
3892 | 3160 |
! |
3161 |
||
5010 | 3162 |
openNewTextEditorOn:anItem |
5009 | 3163 |
self |
3164 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3165 |
ifPresentDo:[:appl | ^ appl openNewTextEditorOn:anItem ]. |
5009 | 3166 |
|
3167 |
^ nil |
|
4880
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3168 |
! |
87f511659680
edit file in context menu of DirectoryContentsBroser opens a new tab
penk
parents:
4878
diff
changeset
|
3169 |
|
5010 | 3170 |
openSearchFileOn:anItem |
5009 | 3171 |
self |
3172 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3173 |
ifPresentDo:[:appl | ^ appl openSearchFileOn:anItem]. |
5009 | 3174 |
|
3175 |
^ nil. |
|
3892 | 3176 |
! |
3177 |
||
5162 | 3178 |
openTextEditorForFile:aFilename |
3179 |
^ self openTextEditorOn:(DirectoryContentsBrowser itemClass fileName:aFilename). |
|
3180 |
! |
|
3181 |
||
5010 | 3182 |
openTextEditorOn:anItem |
5009 | 3183 |
self |
3184 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3185 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem ]. |
5009 | 3186 |
|
3187 |
^ nil. |
|
3892 | 3188 |
! |
3189 |
||
5010 | 3190 |
openTextEditorOn:anItem type:aDirDescrOrFile |
5009 | 3191 |
self |
3192 |
applicationNamed:#FileApplicationNoteBook |
|
5010 | 3193 |
ifPresentDo:[:appl | ^ appl openTextEditorOn:anItem type:aDirDescrOrFile]. |
5009 | 3194 |
|
3195 |
^ nil. |
|
4618 | 3196 |
! |
3197 |
||
5959 | 3198 |
setCurrentFileName:aFilename |
3199 |
self setCurrentFileNames:(OrderedCollection with:aFilename). |
|
3200 |
! |
|
3201 |
||
3202 |
setCurrentFileNames:aCollectionOfFilenames |
|
3203 |
self currentFileNameHolder value:aCollectionOfFilenames. |
|
3204 |
! |
|
3205 |
||
11053 | 3206 |
tabStopConversionDialog |
3207 |
"open a dialog to allow change of the tab stop conversion (when reading/writing files)" |
|
3208 |
||
3209 |
|bindings| |
|
3210 |
||
3211 |
bindings := IdentityDictionary new. |
|
3212 |
bindings at:#tabStops put:(self inputTabColumnConversion asValue). |
|
3213 |
||
3214 |
(self openDialogInterface:#tabStopConversionDialogSpec withBindings:bindings) |
|
3215 |
ifTrue:[ |
|
3216 |
self inputTabColumnConversionHolder value:(bindings at:#tabStops) value |
|
3217 |
]. |
|
3218 |
||
3219 |
"Created: / 06-01-2012 / 15:36:06 / cg" |
|
3220 |
! |
|
3221 |
||
3892 | 3222 |
updateAndSelect:aColOfFiles |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3223 |
self updateCurrentDirectory. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3224 |
aColOfFiles notNil ifTrue:[ |
5959 | 3225 |
self setCurrentFileNames:aColOfFiles |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
3226 |
]. |
3892 | 3227 |
! |
3228 |
||
3229 |
updateCurrentDirectory |
|
5739 | 3230 |
self updateCurrentDirectory:false |
3231 |
! |
|
3232 |
||
3233 |
updateCurrentDirectory:withReread |
|
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3234 |
DirectoryContents flushCachedDirectoryFor:(self getBestDirectory). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
3235 |
|
5009 | 3236 |
self |
3237 |
applicationNamed:#DirectoryContentsBrowser |
|
5739 | 3238 |
ifPresentDo:[:appl | withReread ifTrue:[appl doUpdate] ifFalse:[appl doUpdateDirectoryContents]]. |
5009 | 3239 |
self |
3240 |
applicationNamed:#DirectoryTreeBrowser |
|
3241 |
ifPresentDo:[:appl | appl doUpdate]. |
|
4345 | 3242 |
! |
3243 |
||
5739 | 3244 |
updateCurrentDirectoryWithReread |
3245 |
self updateCurrentDirectory:true |
|
3246 |
! |
|
3247 |
||
4345 | 3248 |
withActivityIndicationDo:aBlock |
3249 |
||
3250 |
self activityVisibilityChannel value:true. |
|
3251 |
[ |
|
9361 | 3252 |
self withWaitCursorDo:[ |
3253 |
aBlock value. |
|
3254 |
] |
|
4345 | 3255 |
] ensure:[ |
3256 |
self activityVisibilityChannel value:false. |
|
3257 |
] |
|
3892 | 3258 |
! ! |
3259 |
||
3260 |
!AbstractFileBrowser methodsFor:'actions bookmarks'! |
|
3261 |
||
3262 |
addBookmark |
|
3263 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
6725 | 3264 |
self addBookmarks:(self currentSelectedDirectories). |
5960 | 3265 |
self class saveBookmarksInDefaultBookmarksFile |
4679 | 3266 |
! |
3267 |
||
3268 |
addBookmarks:aColOfDirectories |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3269 |
aColOfDirectories do:[ :path | |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3270 |
self class addBookmark:path |
3892 | 3271 |
]. |
3272 |
! |
|
3273 |
||
8013 | 3274 |
editBookmarks |
3275 |
||
3276 |
| default selectedDirectories | |
|
3277 |
||
3278 |
selectedDirectories := self currentSelectedDirectories. |
|
3279 |
selectedDirectories notEmpty ifTrue:[default := selectedDirectories first]. |
|
3280 |
self class editBookmarksWithDefault: default. |
|
3281 |
! |
|
3282 |
||
3892 | 3283 |
hasBookmarks |
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3284 |
^ self class hasBookmarks |
3892 | 3285 |
! |
3286 |
||
3287 |
hasBookmarksToRemove |
|
3288 |
|bookmarks directories| |
|
3289 |
||
3982 | 3290 |
directories := self currentSelectedDirectories. |
3892 | 3291 |
bookmarks := self class directoryBookmarks. |
3292 |
^ (bookmarks size > 0 and:[directories notEmpty]) |
|
3293 |
! |
|
3294 |
||
3295 |
removeBookmark |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3296 |
self currentSelectedDirectories do:[:dir| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
3297 |
self class removeBookmark:dir |
3892 | 3298 |
]. |
4679 | 3299 |
! |
3300 |
||
3301 |
saveBookmarks |
|
3302 |
self class saveBookmarks |
|
3892 | 3303 |
! ! |
3304 |
||
3305 |
!AbstractFileBrowser methodsFor:'actions history'! |
|
3306 |
||
3307 |
addToCommandHistory:aCommandString for:aFilename |
|
6369 | 3308 |
|cmd suffix cmdHist historySize| |
3892 | 3309 |
|
3310 |
cmdHist := self class commandHistory. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
3311 |
(aCommandString notEmptyOrNil) ifTrue:[ |
4414 | 3312 |
cmdHist notNil ifTrue:[ |
3313 |
cmdHist addFirst:aCommandString. |
|
6369 | 3314 |
historySize := self class commandHistorySize. |
3315 |
(historySize notNil and:[cmdHist size > historySize]) ifTrue:[ |
|
4414 | 3316 |
cmdHist removeLast |
3317 |
] |
|
3318 |
]. |
|
3319 |
aFilename notNil ifTrue:[ |
|
3320 |
cmd := aCommandString copyTo:(aCommandString indexOf:Character space ifAbsent:[aCommandString size + 1])-1. |
|
3321 |
DefaultCommandPerSuffix isNil ifTrue:[ |
|
3322 |
DefaultCommandPerSuffix := Dictionary new. |
|
3323 |
]. |
|
3324 |
suffix := aFilename asFilename suffix. |
|
3325 |
suffix notNil ifTrue:[ |
|
3326 |
DefaultCommandPerSuffix at:suffix put:cmd. |
|
3327 |
] |
|
3328 |
] |
|
3892 | 3329 |
] |
3330 |
! |
|
3331 |
||
3332 |
doBack |
|
6286 | 3333 |
"go backward in the history" |
3892 | 3334 |
|
4022 | 3335 |
| fileName| |
3336 |
||
6369 | 3337 |
fileName := self directoryHistory goBackward. |
3892 | 3338 |
fileName notNil ifTrue:[ |
4347 | 3339 |
self gotoFile:(fileName asFilename). |
3892 | 3340 |
] |
3341 |
! |
|
3342 |
||
3343 |
doForward |
|
6286 | 3344 |
"go forward in the history" |
3892 | 3345 |
|
3964 | 3346 |
| fileName| |
3347 |
||
6369 | 3348 |
fileName := self directoryHistory goForward. |
3892 | 3349 |
fileName notNil ifTrue:[ |
4414 | 3350 |
self gotoFile:(fileName asFilename). |
4022 | 3351 |
] ifFalse:[ |
4414 | 3352 |
self enableForward value:false. |
4022 | 3353 |
|
3354 |
]. |
|
3892 | 3355 |
! ! |
3356 |
||
3357 |
!AbstractFileBrowser methodsFor:'applications'! |
|
3358 |
||
5009 | 3359 |
applicationNamed:anApplicationName ifPresentDo:aBlock |
3360 |
|appl| |
|
3361 |
||
3362 |
appl := self applications at:anApplicationName ifAbsent:nil. |
|
3363 |
appl notNil ifTrue:[ |
|
3364 |
^ aBlock value:appl |
|
3365 |
]. |
|
3366 |
^ nil. |
|
3367 |
! |
|
3368 |
||
4004 | 3369 |
directoryContentsBrowser |
3370 |
^ self applications at:#DirectoryContentsBrowser ifAbsent:nil. |
|
3892 | 3371 |
! ! |
3372 |
||
3373 |
!AbstractFileBrowser methodsFor:'aspects'! |
|
3374 |
||
3375 |
applications |
|
3376 |
^ aspects at:#applications |
|
3377 |
! |
|
3378 |
||
3379 |
backgroundProcesses |
|
3380 |
||
3381 |
^ self aspectFor:#backgroundProcesses ifAbsent:[List new] |
|
3382 |
! |
|
3383 |
||
4230 | 3384 |
canMake |
6095 | 3385 |
^ self aspectFor:#canMake ifAbsent:[ false asValue ]. |
4230 | 3386 |
! |
3387 |
||
3892 | 3388 |
currentDirectories |
6725 | 3389 |
" returns a holder on a Collection of all currently selected directories |
3390 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3892 | 3391 |
" |
3392 |
||
3393 |
^ self aspectFor:#currentDirectories ifAbsent:[ (OrderedCollection new) asValue ]. |
|
3394 |
! |
|
3395 |
||
6725 | 3396 |
currentDirectoriesValue |
3397 |
" returns a Collection of all currently selected directories |
|
3398 |
if only a file is selected, currentDirectories holds the directory of the file |
|
3399 |
" |
|
3400 |
||
3401 |
^ self currentDirectories value |
|
3402 |
! |
|
3403 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3404 |
currentDirectory |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3405 |
"return the single current directory or nil" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3406 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3407 |
|directories| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3408 |
|
6725 | 3409 |
directories := self currentSelectedDirectories. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3410 |
(directories size ~= 1) ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3411 |
^ nil |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3412 |
]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3413 |
^ directories first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3414 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
3415 |
|
12315 | 3416 |
currentDirectoryDisplayed |
3417 |
"Return a directory as Filename that is currently displayed in the browser" |
|
3418 |
||
3419 |
^self subclassResponsibility |
|
3420 |
||
3421 |
"Created: / 14-01-2013 / 11:57:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
3422 |
! |
|
3423 |
||
3892 | 3424 |
currentFileNameHolder |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3425 |
"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
|
3426 |
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
|
3427 |
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
|
3428 |
|
6589 | 3429 |
^ self aspectFor:#currentFileNameHolder |
3430 |
ifAbsent:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3431 |
|currentSel| |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3432 |
|
4692 | 3433 |
currentSel := self class currentSelection. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3434 |
currentSel isEmpty ifTrue:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3435 |
currentSel := OrderedCollection with:(Filename currentDirectory asAbsoluteFilename) |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3436 |
]. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3437 |
currentSel asValue |
6589 | 3438 |
] |
3439 |
notPresentDo:[:holder| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3440 |
|filenames newFilenames| |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3441 |
filenames := holder value. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3442 |
newFilenames := Set new. |
6589 | 3443 |
filenames do:[:eachFilename| |
3444 |
|existingFilename| |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3445 |
existingFilename := eachFilename. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3446 |
existingFilename notNil ifTrue:[ |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3447 |
[existingFilename isRootDirectory or:[existingFilename exists]] whileFalse:[ |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3448 |
existingFilename := existingFilename directory. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3449 |
]. |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3450 |
existingFilename exists ifTrue:[ |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3451 |
newFilenames add:existingFilename. |
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3452 |
]. |
4955
378481247391
if no item is selected directory up action do nothing now
penk
parents:
4950
diff
changeset
|
3453 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3454 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3455 |
newFilenames asOrderedCollection. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3456 |
] |
9649
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3457 |
|
ad956ada348e
changed: #currentFileNameHolder
Claus Gittinger <cg@exept.de>
parents:
9607
diff
changeset
|
3458 |
"Modified: / 27-11-2010 / 15:42:45 / cg" |
3892 | 3459 |
! |
3460 |
||
5528 | 3461 |
defaultFileEncoding |
3462 |
^ #'iso8859-1' "/ #'utf-8' |
|
3463 |
! |
|
3464 |
||
3892 | 3465 |
enableDirectoryUp |
3466 |
||
3467 |
^ self aspectFor:#enableDirectoryUp ifAbsent:[false asValue] |
|
3468 |
! |
|
3469 |
||
6456 | 3470 |
enableGotoDefaultDirectory |
3471 |
^ self aspectFor:#enableGotoDefaultDirectory ifAbsent:[ true asValue ]. |
|
4593 | 3472 |
! |
3473 |
||
8168 | 3474 |
enableGotoDesktop |
3475 |
^ self aspectFor:#enableGotoDesktop ifAbsent:[ true asValue ]. |
|
3476 |
! |
|
3477 |
||
9572 | 3478 |
enableGotoDesktopDirectory |
3479 |
^ self aspectFor:#enableGotoDesktopDirectory ifAbsent:[ true asValue ]. |
|
3480 |
||
3481 |
"Created: / 01-10-2010 / 16:19:17 / cg" |
|
3482 |
! |
|
3483 |
||
6434 | 3484 |
enableGotoSmalltalkDirectory |
6456 | 3485 |
^ self aspectFor:#enableGotoSmalltalkDirectory ifAbsent:[ true asValue ]. |
6434 | 3486 |
! |
3487 |
||
9677 | 3488 |
enableGotoTempDirectory |
3489 |
^ self aspectFor:#enableGotoTempDirectory ifAbsent:[ true asValue ]. |
|
3490 |
||
3491 |
"Created: / 29-12-2010 / 11:01:17 / cg" |
|
3492 |
! |
|
3493 |
||
3892 | 3494 |
enableHome |
3495 |
||
3496 |
^ self aspectFor:#enableHome ifAbsent:[ true asValue ]. |
|
3497 |
! |
|
3498 |
||
9596 | 3499 |
enableMakeCurrentDirectory |
3500 |
^ self aspectFor:#enableMakeCurrentDirectory ifAbsent:[ true asValue ]. |
|
3501 |
||
3502 |
"Created: / 26-10-2010 / 17:17:58 / cg" |
|
3503 |
! |
|
3504 |
||
3892 | 3505 |
enableViewNoteBookApplication |
3506 |
||
3507 |
^ self aspectFor:#enableViewNoteBookApplication ifAbsent:[false asValue] |
|
3508 |
! |
|
3509 |
||
5528 | 3510 |
fileEncoding |
3511 |
^ self fileEncodingHolder value |
|
3512 |
! |
|
3513 |
||
3514 |
fileEncoding:newEncoding |
|
5533 | 3515 |
self fileEncodingHolder value:newEncoding. |
3516 |
||
3517 |
self |
|
3518 |
applicationNamed:#FileApplicationNoteBook |
|
3519 |
ifPresentDo:[:nb | |
|
3520 |
|appl| |
|
3521 |
||
3522 |
appl := nb selectedApplication. |
|
5535 | 3523 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
5533 | 3524 |
appl fileEncoding:newEncoding |
3525 |
] |
|
3526 |
]. |
|
5528 | 3527 |
! |
3528 |
||
5737 | 3529 |
fileEncodingHolder |
3530 |
^ self |
|
3531 |
aspectFor:#fileEncodingHolder |
|
3532 |
ifAbsent:[ |
|
3533 |
self |
|
3534 |
applicationNamed:#FileApplicationNoteBook |
|
3535 |
ifPresentDo:[:appl | appl fileEncodingHolder]. |
|
3536 |
] |
|
3537 |
! |
|
3538 |
||
5961 | 3539 |
firstSelectedFileName |
3540 |
|files| |
|
3541 |
||
7560 | 3542 |
files := self currentSelectedObjects. |
5961 | 3543 |
files notEmpty ifTrue:[ |
3544 |
^ files first |
|
3545 |
]. |
|
3546 |
^ nil |
|
7560 | 3547 |
|
3548 |
"Modified: / 04-12-2006 / 13:14:53 / cg" |
|
5961 | 3549 |
! |
3550 |
||
6456 | 3551 |
gotoDefaultDirectoryIsVisible |
9596 | 3552 |
^ true. |
3553 |
"/ ^ (Filename defaultDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3554 |
||
3555 |
"Modified: / 26-10-2010 / 17:23:51 / cg" |
|
6456 | 3556 |
! |
3557 |
||
9572 | 3558 |
gotoDesktopDirectoryIsVisible |
3559 |
Filename desktopDirectory = Filename homeDirectory ifTrue:[^ false]. |
|
3560 |
||
3561 |
^ (Filename desktopDirectory asAbsoluteFilename) ~= (self smalltalkDirectory asAbsoluteFilename). |
|
3562 |
||
3563 |
"Created: / 01-10-2010 / 16:26:27 / cg" |
|
3564 |
! |
|
3565 |
||
4618 | 3566 |
hasFileSelection |
3567 |
^ self aspectFor:#hasFileSelection ifAbsent:[ false asValue ]. |
|
3568 |
! |
|
3569 |
||
9490 | 3570 |
hasNotTwoDirectoriesSelectedHolder |
3571 |
^ self |
|
3572 |
aspectFor:#hasNotTwoDirectoriesSelectedHolder |
|
3573 |
ifAbsent:[ |
|
3574 |
BlockValue |
|
3575 |
with:[:m | self hasTwoDirectoriesSelected not] |
|
3576 |
argument:self currentFileNameHolder |
|
3577 |
]. |
|
3578 |
||
3579 |
"Created: / 20-05-2010 / 10:45:50 / cg" |
|
3580 |
! |
|
3581 |
||
5830 | 3582 |
hasNotTwoFilesSelectedHolder |
9490 | 3583 |
^ self |
3584 |
aspectFor:#hasNotTwoFilesSelectedHolder |
|
5830 | 3585 |
ifAbsent:[ |
3586 |
BlockValue |
|
3587 |
with:[:m | self hasTwoFilesSelected not] |
|
3588 |
argument:self currentFileNameHolder |
|
3589 |
]. |
|
9490 | 3590 |
|
3591 |
"Modified: / 20-05-2010 / 10:46:01 / cg" |
|
5830 | 3592 |
! |
3593 |
||
3892 | 3594 |
hasSelection |
3595 |
||
3596 |
^ self aspectFor:#hasSelection ifAbsent:[ false asValue ]. |
|
3597 |
! |
|
3598 |
||
9490 | 3599 |
hasTwoDirectoriesSelectedHolder |
3600 |
^ self |
|
3601 |
aspectFor:#hasTwoDirectoriesSelectedHolder |
|
3602 |
ifAbsent:[ |
|
3603 |
BlockValue |
|
3604 |
with:[:m | self hasTwoDirectoriesSelected] |
|
3605 |
argument:self currentFileNameHolder |
|
3606 |
]. |
|
3607 |
||
3608 |
"Created: / 20-05-2010 / 10:45:41 / cg" |
|
3609 |
! |
|
3610 |
||
4414 | 3611 |
hasTwoFilesSelectedHolder |
9490 | 3612 |
^ self |
3613 |
aspectFor:#hasTwoFilesSelectedHolder |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3614 |
ifAbsent:[ |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3615 |
BlockValue |
5830 | 3616 |
with:[:m | self hasTwoFilesSelected] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3617 |
argument:self currentFileNameHolder |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
3618 |
]. |
9490 | 3619 |
|
3620 |
"Modified: / 20-05-2010 / 10:46:08 / cg" |
|
4414 | 3621 |
! |
3622 |
||
11053 | 3623 |
inputTabColumnConversion |
3624 |
^ self inputTabColumnConversionHolder value |
|
3625 |
||
3626 |
"Created: / 06-01-2012 / 15:25:56 / cg" |
|
3627 |
! |
|
3628 |
||
3629 |
inputTabColumnConversionHolder |
|
3630 |
^ self |
|
3631 |
aspectFor:#inputTabColumnConversionHolder |
|
3632 |
ifAbsent:[ |
|
3633 |
self |
|
3634 |
applicationNamed:#FileApplicationNoteBook |
|
3635 |
ifPresentDo:[:appl | appl inputTabColumnConversionHolder]. |
|
3636 |
] |
|
3637 |
||
3638 |
"Created: / 06-01-2012 / 15:26:16 / cg" |
|
3639 |
! |
|
3640 |
||
3641 |
lineEndConvention |
|
3642 |
^ self lineEndConventionHolder value |
|
3643 |
||
3644 |
"Created: / 06-01-2012 / 13:05:14 / cg" |
|
3645 |
! |
|
3646 |
||
11591 | 3647 |
lineEndConvention: aSymbol |
3648 |
self lineEndConventionHolder value: aSymbol |
|
3649 |
||
3650 |
"Created: / 11-07-2012 / 19:51:58 / cg" |
|
3651 |
! |
|
3652 |
||
11053 | 3653 |
lineEndConventionHolder |
3654 |
^ self |
|
3655 |
aspectFor:#lineEndConventionHolder |
|
3656 |
ifAbsent:[ |
|
3657 |
self |
|
3658 |
applicationNamed:#FileApplicationNoteBook |
|
3659 |
ifPresentDo:[:appl | appl lineEndConventionHolder]. |
|
3660 |
] |
|
3661 |
||
3662 |
"Created: / 06-01-2012 / 13:02:51 / cg" |
|
3663 |
! |
|
3664 |
||
5737 | 3665 |
lockFileEncoding:aBoolean |
3666 |
self lockFileEncodingHolder value:aBoolean. |
|
3667 |
||
3668 |
self |
|
3669 |
applicationNamed:#FileApplicationNoteBook |
|
3670 |
ifPresentDo:[:nb | |
|
3671 |
|appl| |
|
3672 |
||
3673 |
appl := nb selectedApplication. |
|
3674 |
(appl notNil and:[appl isTextEditor]) ifTrue:[ |
|
3675 |
appl lockFileEncoding:aBoolean |
|
3676 |
] |
|
3677 |
]. |
|
3678 |
! |
|
3679 |
||
3680 |
lockFileEncodingHolder |
|
3681 |
^ self |
|
3682 |
aspectFor:#lockFileEncodingHolder |
|
3683 |
ifAbsent:[ |
|
3684 |
self |
|
3685 |
applicationNamed:#FileApplicationNoteBook |
|
3686 |
ifPresentDo:[:appl | appl lockFileEncodingHolder]. |
|
3687 |
] |
|
3688 |
! |
|
3689 |
||
12230
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
3690 |
makeCommandHolder |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
3691 |
^ self aspectFor:#makeCommandHolder ifAbsent:[ nil asValue ]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
3692 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
3693 |
"Created: / 13-04-2012 / 17:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
3694 |
! |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
3695 |
|
4523 | 3696 |
notify:aString |
11108 | 3697 |
"aString is shown in the lower pane" |
3698 |
||
4523 | 3699 |
self notifyChannel value:aString |
11108 | 3700 |
|
3701 |
"Modified (comment): / 11-01-2012 / 21:46:55 / cg" |
|
4523 | 3702 |
! |
3703 |
||
3892 | 3704 |
notifyChannel |
3705 |
||
3706 |
^ self aspectFor:#notifyChannel ifAbsent:['' asValue] |
|
4071 | 3707 |
! |
3708 |
||
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3709 |
progressPercentageHolder |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3710 |
^ self aspectFor:#progressPercentageHolder ifAbsent:[ nil asValue ]. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3711 |
|
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3712 |
"Created: / 11-10-2010 / 12:54:46 / cg" |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3713 |
! |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
3714 |
|
4071 | 3715 |
rootHolder |
3716 |
"holder, which keeps the rootHolder of the treeView |
|
3717 |
" |
|
3718 |
||
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3719 |
^ self aspectFor:#rootHolder ifAbsent:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3720 |
self class rootHolder asValue. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
3721 |
]. |
8192
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3722 |
! |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3723 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3724 |
rootHolder:aHolder |
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3725 |
|
26660fb61e7a
Make FileDialog usable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8185
diff
changeset
|
3726 |
self aspectFor:#rootHolder put:aHolder |
3892 | 3727 |
! ! |
3728 |
||
3729 |
!AbstractFileBrowser methodsFor:'aspects handling'! |
|
3730 |
||
3731 |
aspectFor:something ifAbsent:aBlock |
|
6284 | 3732 |
"returns the model for an aspect; these are stored in a common dictionary" |
3733 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3734 |
^ self aspectFor:something ifAbsent:aBlock notPresentDo:nil |
3892 | 3735 |
! |
3736 |
||
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3737 |
aspectFor:aKey ifAbsent:aBlock notPresentDo:notPresentBlock |
6284 | 3738 |
"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
|
3739 |
|
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3740 |
|holder saveAspectItem aspect| |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3741 |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3742 |
holder := aspects at:aKey ifAbsent:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3743 |
masterApplication notNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3744 |
holder := masterApplication aspectOrNil:aKey forSubApplication:self. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3745 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3746 |
holder isNil ifTrue:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3747 |
saveAspectItem := self runtimeAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3748 |
saveAspectItem notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3749 |
saveAspectItem isHolder ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3750 |
holder := ValueHolder with:saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3751 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3752 |
holder := saveAspectItem value |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3753 |
]. |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3754 |
] ifFalse:[ |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3755 |
aspect := self userPreferencesAspectValueFor:aKey. |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3756 |
aspect notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3757 |
holder := aspect asValue |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3758 |
] ifFalse:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3759 |
holder := aBlock value. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3760 |
] |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3761 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3762 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3763 |
holder notNil ifTrue:[ |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3764 |
notPresentBlock notNil ifTrue:[ |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3765 |
holder value:(notPresentBlock value:holder). |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3766 |
]. |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
3767 |
aspects at:aKey put:holder |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3768 |
]. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3769 |
holder |
4213
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3770 |
]. |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3771 |
^ holder |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3772 |
! |
b8e7d4276a33
startup if old filename not present - go up to first directory in path
penk
parents:
4203
diff
changeset
|
3773 |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3774 |
aspectFor:something put:aValueHolder |
6284 | 3775 |
"stores the model for an aspect; these are stored in a common dictionary" |
3776 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3777 |
aspects at:something put:aValueHolder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3778 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
3779 |
|
3892 | 3780 |
aspects |
6284 | 3781 |
"returns the common aspect dictionary" |
3782 |
||
3892 | 3783 |
^ aspects |
3784 |
! |
|
3785 |
||
3786 |
runtimeAspectValueFor:something |
|
3787 |
"returns the default aspect item from the class variable RuntimeAspects |
|
3788 |
" |
|
3789 |
^ self class runtimeAspects at:something ifAbsent:nil. |
|
3790 |
! |
|
3791 |
||
4201 | 3792 |
saveAspectValues |
3793 |
|saveAspects aspectValue| |
|
3794 |
||
3795 |
||
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3796 |
saveAspects := self class userPreferencesAspectList keys. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3797 |
saveAspects do:[ :aspectKey | |
4201 | 3798 |
aspectValue := (self perform:aspectKey) value. |
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3799 |
UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3800 |
at: ('fileBrowser_',aspectKey asString) asSymbol |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3801 |
put: aspectValue. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3802 |
]. |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3803 |
|
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3804 |
"Modified: / 04-09-2006 / 10:02:41 / cg" |
4201 | 3805 |
! |
3806 |
||
3892 | 3807 |
saveRuntimeAspectValues |
3808 |
|savedAspects dictionary value isHolder aspect| |
|
3809 |
||
5941 | 3810 |
savedAspects := self class listOfRuntimeValuesToRemember. |
3892 | 3811 |
dictionary := Dictionary new. |
5941 | 3812 |
savedAspects do:[:aspectKey | |
4414 | 3813 |
aspect := self perform:aspectKey. |
3814 |
isHolder := aspect isValueModel. |
|
5941 | 3815 |
isHolder ifTrue:[ |
3816 |
value := aspect value |
|
3817 |
] ifFalse:[ |
|
3818 |
value := aspect |
|
3819 |
]. |
|
3820 |
dictionary at:aspectKey |
|
3821 |
put:(SaveAspectItem withValue:value isHolder:isHolder) |
|
3822 |
]. |
|
3823 |
RuntimeAspects := dictionary. |
|
3892 | 3824 |
! |
3825 |
||
4201 | 3826 |
userPreferencesAspectValueFor:something |
3827 |
"returns the default aspect from the Userpreferences |
|
3892 | 3828 |
" |
4201 | 3829 |
|
7078
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3830 |
(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
|
3831 |
^ UserPreferences current |
47db06f88879
preference-keys are private (no dependencies in UserPrefs)
Claus Gittinger <cg@exept.de>
parents:
7050
diff
changeset
|
3832 |
at:('fileBrowser_',something) asSymbol |
9579
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3833 |
ifAbsent:nil "(self class userPreferencesAspectList at:something)". |
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3834 |
|
7107f49e4583
changed: #userPreferencesAspectValueFor:
Claus Gittinger <cg@exept.de>
parents:
9575
diff
changeset
|
3835 |
"Modified: / 14-10-2010 / 19:16:38 / cg" |
3892 | 3836 |
! ! |
3837 |
||
4011 | 3838 |
!AbstractFileBrowser methodsFor:'aspects-filter'! |
3839 |
||
9015 | 3840 |
filter:aString |
3841 |
self filterModel value:aString |
|
3842 |
! |
|
3843 |
||
4018 | 3844 |
filterBackgroundColor |
3845 |
||
3846 |
^ self aspectFor:#filterBackgroundColor ifAbsent:[Color white asValue] |
|
3847 |
! |
|
3848 |
||
4011 | 3849 |
filterBlockHolder |
3850 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3851 |
^ self aspectFor:#filterBlockHolder ifAbsent:[self makeFilterBlock asValue] |
4011 | 3852 |
! |
3853 |
||
3854 |
filterListModel |
|
3855 |
||
3856 |
^ self aspectFor:#filterListModel ifAbsent:[self class defaultFilterList] |
|
3857 |
! |
|
3858 |
||
3859 |
filterModel |
|
5941 | 3860 |
|m| |
3861 |
||
3862 |
m := self aspectFor:#filterModel ifAbsent:[(self filterListModel at:1) asValue]. |
|
3863 |
^ m |
|
4011 | 3864 |
! |
3865 |
||
8185
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3866 |
filterModel:aHolder |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3867 |
self aspectFor:#filterModel put:aHolder. |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3868 |
! |
8b6f11fd7fbf
Make #filterModel reusable as SubCanvas
Stefan Vogel <sv@exept.de>
parents:
8172
diff
changeset
|
3869 |
|
4018 | 3870 |
filterValueBox |
3871 |
||
3872 |
^ self aspectFor:#filterValueBox ifAbsent:[ValueHolder new] |
|
3873 |
! |
|
3874 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3875 |
makeFilterBlock |
9102 | 3876 |
"return a two-arg filterblock on the files path- and base-name. This block should return true for files |
3877 |
to be shown" |
|
3878 |
||
12760 | 3879 |
| filterString filterStrings filters notFilters showHidden filterBlock ignoreCase| |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3880 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3881 |
filterString := self filterModel value. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3882 |
filterString = '' ifTrue:[filterString := '*']. |
7565
521264d23941
ignoreCase if Filename is not case sensitive in #makeFilterBlock
fm
parents:
7560
diff
changeset
|
3883 |
ignoreCase := "ignoreCaseInPattern ? "(Filename isCaseSensitive not). |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3884 |
|
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3885 |
filterStrings := filterString asCollectionOfSubstringsSeparatedBy:$;. |
12760 | 3886 |
filterStrings := filterStrings |
3887 |
select:[:eachFilter | eachFilter withoutSeparators notEmpty]. |
|
3888 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3889 |
filters := filterStrings |
12760 | 3890 |
reject:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
3891 |
thenCollect: |
|
3892 |
[:eachPattern | |
|
3893 |
|pattern| |
|
3894 |
||
3895 |
pattern := eachPattern withoutSeparators. |
|
12144 | 3896 |
"JV@2012-03-05: Add implict star at the beggining and at the end of pattern, |
3897 |
that's how most of the other applications behave - do what most users expect" |
|
3898 |
pattern first == $* ifFalse:[pattern := '*' , pattern]. |
|
3899 |
pattern last == $* ifFalse:[pattern := pattern , '*']. |
|
3900 |
||
12760 | 3901 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
3902 |
]. |
|
3903 |
||
3904 |
notFilters := filterStrings |
|
3905 |
select:[:eachFilter | eachFilter withoutSeparators startsWith:'~'] |
|
3906 |
thenCollect: |
|
3907 |
[:eachPattern | |
|
9296 | 3908 |
|pattern| |
3909 |
||
3910 |
pattern := eachPattern withoutSeparators. |
|
12760 | 3911 |
pattern := (pattern copyFrom:2) withoutSeparators. |
3912 |
[:name :baseName | pattern match:baseName ignoreCase:ignoreCase] |
|
9296 | 3913 |
]. |
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3914 |
|
12760 | 3915 |
|
3916 |
(filters size == 1 and:[notFilters isEmpty]) ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3917 |
filterBlock := filters first |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3918 |
] ifFalse:[ |
12760 | 3919 |
filters isEmpty ifTrue:[ |
3920 |
filterBlock := [:name :baseName | |
|
3921 |
(notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not |
|
3922 |
]. |
|
3923 |
] ifFalse:[ |
|
3924 |
notFilters isEmpty ifTrue:[ |
|
3925 |
filterBlock := [:name :baseName | |
|
3926 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3927 |
]. |
|
3928 |
] ifFalse:[ |
|
3929 |
filterBlock := [:name :baseName | |
|
3930 |
(filters contains:[:aFilter | aFilter value:name value:baseName ]) |
|
3931 |
and:[ (notFilters contains:[:aFilter | aFilter value:name value:baseName ]) not ] |
|
3932 |
]. |
|
3933 |
] |
|
3934 |
] |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3935 |
]. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3936 |
|
4011 | 3937 |
showHidden := self showHiddenFiles value. |
3938 |
showHidden ifTrue:[ |
|
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3939 |
^ filterBlock. |
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
3940 |
]. |
9296 | 3941 |
^ [:name :baseName | |
3942 |
name isHidden not and:[filterBlock value:name value:baseName]]. |
|
12144 | 3943 |
|
3944 |
"Modified: / 05-02-2012 / 01:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4018 | 3945 |
! |
3946 |
||
3947 |
shownFiles |
|
3948 |
||
3949 |
^ self aspectFor:#shownFiles ifAbsent:['-/-' asValue] |
|
4011 | 3950 |
! ! |
3951 |
||
3892 | 3952 |
!AbstractFileBrowser methodsFor:'aspects-history'! |
3953 |
||
3954 |
dirHistory |
|
6369 | 3955 |
"obsolete" |
3956 |
^ self directoryHistory |
|
3957 |
! |
|
3958 |
||
3959 |
directoryHistory |
|
3952 | 3960 |
^ self class directoryHistory |
3892 | 3961 |
! |
3962 |
||
3963 |
enableBack |
|
3964 |
||
3965 |
^ self aspectFor:#enableBack ifAbsent:[false asValue] |
|
3966 |
! |
|
3967 |
||
3968 |
enableFileHistory |
|
3969 |
||
3970 |
^ self aspectFor:#enableFileHistory ifAbsent:[false asValue] |
|
3971 |
! |
|
3972 |
||
3973 |
enableForward |
|
3974 |
||
3975 |
^ self aspectFor:#enableForward ifAbsent:[false asValue] |
|
3976 |
! |
|
3977 |
||
3978 |
fileHistory |
|
9820
07b7d7929e3e
variable renamed in: #fileHistory
Stefan Vogel <sv@exept.de>
parents:
9793
diff
changeset
|
3979 |
^ self aspectFor:#fileHistory ifAbsent:[OrderedSet new] |
3892 | 3980 |
! ! |
3981 |
||
3982 |
!AbstractFileBrowser methodsFor:'aspects-visibility'! |
|
3983 |
||
4345 | 3984 |
activityVisibilityChannel |
6284 | 3985 |
" activityVisibilityChannel switches the activity indicator on/off" |
4345 | 3986 |
|
3987 |
^ self aspectFor:#activityVisibilityChannel ifAbsent:[ false asValue ]. |
|
3988 |
! |
|
3989 |
||
6602 | 3990 |
changeSetBrowserItemVisible |
3991 |
^ Screen current ctrlDown. |
|
3992 |
! |
|
3993 |
||
11135 | 3994 |
cvsMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
3995 |
^ ConfigurableFeatures includesFeature: #CVSSupportEnabled |
11135 | 3996 |
|
3997 |
"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
|
3998 |
"Modified: / 19-01-2012 / 10:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 3999 |
! |
4000 |
||
12315 | 4001 |
hgMenusAreShown |
4002 |
^ (ConfigurableFeatures includesFeature: #HGSupportEnabled) |
|
4003 |
||
4004 |
"Created: / 14-01-2013 / 11:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4005 |
! |
|
4006 |
||
11135 | 4007 |
mercurialMenusAreShown |
11147 | 4008 |
^ ConfigurableFeatures hasMercurialSupportEnabled |
11135 | 4009 |
|
4010 |
"Created: / 15-01-2012 / 13:00:00 / cg" |
|
4011 |
! |
|
4012 |
||
4110 | 4013 |
openAlwaysInTextEditor |
4201 | 4014 |
" aspect for open every file in TextEditor dont use e.g. HtmlEditor for *.html'" |
4110 | 4015 |
|
4016 |
^ self aspectFor:#openAlwaysInTextEditor ifAbsent:[ false asValue ]. |
|
4017 |
! |
|
4018 |
||
3892 | 4019 |
openMultipleApplicationsForType |
4020 |
||
4201 | 4021 |
" aspect for open more applications for e.g. TextEditor and not change the contents of already |
4022 |
open TextEditor " |
|
4023 |
||
3892 | 4024 |
^ self aspectFor:#openMultipleApplicationsForType ifAbsent:[ false asValue ]. |
4025 |
! |
|
4026 |
||
11137 | 4027 |
perforceMenusAreShown |
11996
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4028 |
^ (ConfigurableFeatures includesFeature: #PerforceSupportEnabled) |
e3b824f2d454
changed: #perforceMenusAreShown
Claus Gittinger <cg@exept.de>
parents:
11995
diff
changeset
|
4029 |
and:[ ConfigurableFeatures hasPerforceSupportEnabled ] |
11137 | 4030 |
|
4031 |
"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
|
4032 |
"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
|
4033 |
"Modified: / 02-11-2012 / 11:19:59 / cg" |
11137 | 4034 |
! |
4035 |
||
4201 | 4036 |
showDirectoryTree |
4037 |
||
4038 |
^ self aspectFor:#showDirectoryTree ifAbsent:[ true asValue ] |
|
3892 | 4039 |
! |
4040 |
||
4554 | 4041 |
showDiskUsageHolder |
4042 |
|holder| |
|
4043 |
||
4560
0d3db5e27bc0
default for disk usage is false
Claus Gittinger <cg@exept.de>
parents:
4558
diff
changeset
|
4044 |
holder := self aspectFor:#showDiskUsageHolder ifAbsent:[ false asValue]. |
4781 | 4045 |
holder addDependent:self. |
4554 | 4046 |
^ holder |
4047 |
! |
|
4048 |
||
3892 | 4049 |
showHiddenFiles |
4050 |
||
9582 | 4051 |
^ self aspectFor:#showHiddenFiles ifAbsent:[ true asValue ]. |
4052 |
||
4053 |
"Modified: / 15-10-2010 / 10:28:17 / cg" |
|
3892 | 4054 |
! |
4055 |
||
9108 | 4056 |
showHiddenFiles:aHolder |
4057 |
self aspectFor:#showHiddenFiles put:aHolder. |
|
4058 |
! |
|
4059 |
||
4060 |
shownFiles:aHolder |
|
4061 |
self aspectFor:#shownFiles put:aHolder. |
|
4062 |
! |
|
4063 |
||
11135 | 4064 |
svnMenusAreShown |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
4065 |
^ ConfigurableFeatures includesFeature: #SubversionSupportEnabled |
11135 | 4066 |
|
4067 |
"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
|
4068 |
"Modified: / 19-01-2012 / 10:43:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11135 | 4069 |
! |
4070 |
||
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4071 |
tagsBrowserVisibleHolder |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4072 |
masterApplication notNil ifTrue:[ |
11162
faf8af233ac0
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
11156
diff
changeset
|
4073 |
^ masterApplication perform:#tagsBrowserVisibleHolder ifNotUnderstood:false |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4074 |
]. |
10762
311190be6490
changed: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
10757
diff
changeset
|
4075 |
^ self aspectFor:#tagsBrowserVisibleHolder ifAbsent:[ FileApplicationNoteBook::TextEditor defaultTagsBrowserVisible asValue ]. |
9945
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4076 |
|
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4077 |
"Created: / 27-06-2011 / 16:02:59 / cg" |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4078 |
! |
b32126680c13
added: #tagsBrowserVisibleHolder
Claus Gittinger <cg@exept.de>
parents:
9820
diff
changeset
|
4079 |
|
10757
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4080 |
useCodeView2InTools |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4081 |
^ self aspectFor:#useCodeView2InTools ifAbsent:[ UserPreferences current useCodeView2InTools asValue ]. |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4082 |
|
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4083 |
"Created: / 06-10-2011 / 11:45:58 / cg" |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4084 |
! |
5bbe8b995a5f
added: #useCodeView2InTools
Claus Gittinger <cg@exept.de>
parents:
10747
diff
changeset
|
4085 |
|
4648 | 4086 |
userContextAvailable |
4087 |
||
4088 |
" aspect for show group and user columns in contents view |
|
4089 |
windows provides no user context" |
|
4090 |
||
4091 |
^ OperatingSystem isMSWINDOWSlike not |
|
4092 |
! |
|
4093 |
||
3892 | 4094 |
viewDescription |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4095 |
"aspect for show file description in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4096 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4097 |
^ self directoryContentsBrowser viewDescription |
3892 | 4098 |
! |
4099 |
||
4100 |
viewDetails |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4101 |
"aspect for show more file properties in DirectoryContentsBrowser |
4201 | 4102 |
" |
3892 | 4103 |
|
6121 | 4104 |
|directoryContentsBrowser| |
4105 |
||
4106 |
directoryContentsBrowser := self directoryContentsBrowser. |
|
4107 |
directoryContentsBrowser isNil ifTrue:[^ nil]. |
|
4108 |
^ directoryContentsBrowser viewDetails |
|
3892 | 4109 |
! |
4110 |
||
4111 |
viewDirectoryDescription |
|
4112 |
||
4201 | 4113 |
" aspect for auto open a TextView for Readme and other see getInfoItem Method files |
4114 |
on change directory " |
|
4115 |
||
3892 | 4116 |
^ self aspectFor:#viewDirectoryDescription ifAbsent:[ true asValue ]. |
4117 |
! |
|
4118 |
||
4201 | 4119 |
viewDirsInContentsBrowser |
4120 |
||
4121 |
^ self aspectFor:#viewDirsInContentsBrowser ifAbsent:[ false asValue ]. |
|
9319
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4122 |
|
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4123 |
" |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4124 |
UserPreferences current viewDirsInContentsBrowser |
23ae966d9dbf
comment/format in: #viewDirsInContentsBrowser
Claus Gittinger <cg@exept.de>
parents:
9299
diff
changeset
|
4125 |
" |
4201 | 4126 |
! |
4127 |
||
5870 | 4128 |
viewFilesInContentsBrowser |
4129 |
||
4130 |
^ self aspectFor:#viewFilesInContentsBrowser ifAbsent:[ true asValue ]. |
|
4131 |
! |
|
4132 |
||
3892 | 4133 |
viewFilesInDirectoryTree |
4134 |
||
4201 | 4135 |
" aspect for view files in tree view (not only directories) " |
4136 |
||
3892 | 4137 |
^ self aspectFor:#viewFilesInDirectoryTree ifAbsent:[ false asValue ]. |
4138 |
! |
|
4139 |
||
4140 |
viewGroup |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4141 |
" aspect for show group information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4142 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4143 |
^ self directoryContentsBrowser viewGroup |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4144 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4145 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4146 |
viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4147 |
" aspect for show file-type icon in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4148 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4149 |
^ self directoryContentsBrowser viewIcon |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4150 |
! |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4151 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4152 |
viewInodeNumber |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4153 |
" aspect for show inode numbers in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4154 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4155 |
^ self directoryContentsBrowser viewInodeNumber |
3892 | 4156 |
! |
4157 |
||
4158 |
viewNoteBookApplicationHolder |
|
4159 |
||
4160 |
^ self aspectFor:#viewNoteBookApplicationHolder ifAbsent:[ false asValue]. |
|
4161 |
! |
|
4162 |
||
4163 |
viewOwner |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4164 |
" aspect for show owner information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4165 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4166 |
^ self directoryContentsBrowser viewOwner |
3892 | 4167 |
! |
4168 |
||
4169 |
viewPermissions |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4170 |
" aspect for show permission information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4171 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4172 |
^ self directoryContentsBrowser viewPermissions |
3892 | 4173 |
! |
4174 |
||
4175 |
viewPreview |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4176 |
" aspect for show image previev in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4177 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4178 |
^ self directoryContentsBrowser viewPreview |
3892 | 4179 |
! |
4180 |
||
4181 |
viewSize |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4182 |
" aspect for show size information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4183 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4184 |
^ self directoryContentsBrowser viewSize |
3892 | 4185 |
! |
4186 |
||
4974 | 4187 |
viewSizeInBytes |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4188 |
" aspect for show size-in-bytes information in DirectoryContentsBrowser " |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4189 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4190 |
^ self directoryContentsBrowser viewSizeInBytes |
4974 | 4191 |
! |
4192 |
||
5312 | 4193 |
viewSizeInKiloBytes |
4194 |
" aspect for show size-in-kilobytes information in DirectoryContentsBrowser " |
|
4195 |
||
4196 |
^ self directoryContentsBrowser viewSizeInKiloBytes |
|
4197 |
! |
|
4198 |
||
3892 | 4199 |
viewTime |
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4200 |
" aspect for show time information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4201 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4202 |
^ self directoryContentsBrowser viewTime |
3892 | 4203 |
! |
4204 |
||
4205 |
viewType |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4206 |
" aspect for show suffix (type) information in DirectoryContentsBrowser" |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4207 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
4208 |
^ self directoryContentsBrowser viewType |
3892 | 4209 |
! ! |
4210 |
||
4211 |
!AbstractFileBrowser methodsFor:'background processing'! |
|
4212 |
||
4213 |
executeCommand:cmd |
|
4214 |
||
4215 |
self executeCommand:cmd inDirectory:nil |
|
4216 |
! |
|
4217 |
||
5880 | 4218 |
executeCommand:cmd inDirectory:aDirectoryOrNil |
3892 | 4219 |
| nameString executionBlock| |
4220 |
||
5880 | 4221 |
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
|
4222 |
nameString := 'Execute: ', cmd. |
3892 | 4223 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
4224 |
! |
|
4225 |
||
4226 |
getExecutionBlockForCommand:cmd |
|
4227 |
||
4228 |
^ self getExecutionBlockForCommand:cmd inDirectory:nil |
|
4229 |
! |
|
4230 |
||
5880 | 4231 |
getExecutionBlockForCommand:cmd inDirectory:directoryOrNil |
4232 |
| dir| |
|
4233 |
||
4234 |
dir := directoryOrNil. |
|
4235 |
directoryOrNil isNil ifTrue:[ |
|
4236 |
dir := self theSingleSelectedDirectoryOrNil. |
|
6671 | 4237 |
dir isNil ifTrue:[ |
12493 | 4238 |
Dialog warn:(resources string:'Please select a single directory.'). |
6671 | 4239 |
AbortSignal raise. |
4240 |
^ nil |
|
4241 |
]. |
|
3892 | 4242 |
]. |
4523 | 4243 |
|
4244 |
^ [:stream| |
|
4245 |
stream notNil ifTrue:[ |
|
4414 | 4246 |
OperatingSystem |
4247 |
executeCommand:cmd |
|
4248 |
inputFrom:nil |
|
4249 |
outputTo:stream |
|
4250 |
errorTo:stream |
|
4251 |
inDirectory:dir |
|
4252 |
onError:[:status| false]. |
|
4253 |
] |
|
4523 | 4254 |
]. |
3892 | 4255 |
! |
4256 |
||
4257 |
killAllRunningBackgroundProcesses |
|
4258 |
||
4259 |
self backgroundProcesses do:[ : process | |
|
4523 | 4260 |
self notify:'kill ', process name. |
4414 | 4261 |
process terminate. |
3892 | 4262 |
]. |
4263 |
! |
|
4264 |
||
4265 |
makeExecutionResultProcessFor:aBlock withName:aString |
|
4266 |
| stream process appl nameString| |
|
4267 |
||
4268 |
appl := self openCommandResultApplication. |
|
4269 |
stream := appl resultStream. |
|
4270 |
nameString := aString ? 'Execution Result'. |
|
4271 |
appl changeTabTo:nameString. |
|
4523 | 4272 |
|
8355 | 4273 |
process := [ |
4274 |
[aBlock value:stream] |
|
4891
5422df926e2d
Stream streamErrorSignal -> StreamError
Stefan Vogel <sv@exept.de>
parents:
4881
diff
changeset
|
4275 |
ensure:[ |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4276 |
self backgroundProcesses remove:process ifAbsent:[]. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4277 |
appl process value:nil. |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4278 |
|
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4279 |
"/ close automatically, if there was no output. |
4571 | 4280 |
"/ appl resultStream contents isEmpty ifTrue:[ |
4281 |
"/ appl doClose. |
|
4282 |
"/ ] |
|
8355 | 4283 |
stream nextPutLine:'Done.' |
4516
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4284 |
] |
dc3b7a89598a
close command view if no output was generated
Claus Gittinger <cg@exept.de>
parents:
4496
diff
changeset
|
4285 |
] newProcess. |
3892 | 4286 |
process priority:(Processor userBackgroundPriority). |
4287 |
process name:nameString. |
|
4288 |
self backgroundProcesses add:process. |
|
4289 |
appl process value:process. |
|
4290 |
process resume. |
|
4291 |
! ! |
|
4292 |
||
4293 |
!AbstractFileBrowser methodsFor:'change & update'! |
|
4294 |
||
4915 | 4295 |
currentFileNameHolderChanged |
4296 |
"/ self currentFileNameHolderChangedForCommon |
|
4297 |
! |
|
4298 |
||
4577 | 4299 |
currentFileNameHolderChangedForCommon |
5476 | 4300 |
|newDirectories oldDirectories size rootInTreeView selection selectionNotEmpty| |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4301 |
|
7560 | 4302 |
selection := self currentSelectedObjects. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4303 |
self class currentSelection:selection. |
4734 | 4304 |
|
5476 | 4305 |
selectionNotEmpty := selection notEmpty. |
4306 |
self hasSelection value:selectionNotEmpty. |
|
4307 |
self hasFileSelection value:(selectionNotEmpty and:[self firstSelectedFile notNil]). |
|
4734 | 4308 |
|
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4309 |
newDirectories := self directoriesForFiles:selection. |
6725 | 4310 |
oldDirectories := self currentSelectedDirectories. |
4011 | 4311 |
oldDirectories ~= newDirectories ifTrue:[ |
4347 | 4312 |
self currentDirectories value:newDirectories. |
4313 |
size := newDirectories size. |
|
4774 | 4314 |
rootInTreeView := self |
4315 |
applicationNamed:#DirectoryTreeBrowser |
|
5009 | 4316 |
ifPresentDo:[:appl | appl rootHolder]. |
4317 |
rootInTreeView := rootInTreeView value. |
|
5437
3556b0348494
directory up not allowed for drive root under windows
penk
parents:
5432
diff
changeset
|
4318 |
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
|
4319 |
|
4347 | 4320 |
newDirectories notEmpty ifTrue:[ |
6369 | 4321 |
self directoryHistory addToHistory:(newDirectories first asString). |
4347 | 4322 |
]. |
5074 | 4323 |
self enableHome value:((newDirectories includes:(Filename homeDirectory asAbsoluteFilename))not). |
8168 | 4324 |
self enableGotoDesktop value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
6456 | 4325 |
self enableGotoDefaultDirectory value:((newDirectories includes:(Filename defaultDirectory asAbsoluteFilename))not). |
4326 |
self enableGotoSmalltalkDirectory value:((newDirectories includes:(self smalltalkDirectory asAbsoluteFilename))not). |
|
9572 | 4327 |
self enableGotoDesktopDirectory value:((newDirectories includes:(Filename desktopDirectory asAbsoluteFilename))not). |
9677 | 4328 |
self enableGotoTempDirectory value:((newDirectories includes:(self tempDirectory asAbsoluteFilename))not). |
4011 | 4329 |
]. |
9599
6ffff091db22
changed: #currentFileNameHolderChangedForCommon
Claus Gittinger <cg@exept.de>
parents:
9596
diff
changeset
|
4330 |
self enableGotoDefaultDirectory value:(self currentDirectory isNil or:[self currentDirectory pathName ~= OperatingSystem getCurrentDirectory]). |
9596 | 4331 |
self enableMakeCurrentDirectory value:(newDirectories size == 1 |
4332 |
and:[ newDirectories first asFilename pathName ~= OperatingSystem getCurrentDirectory ]). |
|
4022 | 4333 |
self enableForward value:self canForward. |
4734 | 4334 |
self enableBack value:self canBackward. |
6095 | 4335 |
|
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
4336 |
"/ self updateCanMake. |
7560 | 4337 |
|
9677 | 4338 |
"Modified: / 29-12-2010 / 11:01:52 / cg" |
4011 | 4339 |
! |
4340 |
||
4341 |
filterModelChanged |
|
4342 |
||
5658
eef91fc147fa
filter: allow multiple patterns
Claus Gittinger <cg@exept.de>
parents:
5644
diff
changeset
|
4343 |
self filterBlockHolder value:(self makeFilterBlock). |
4011 | 4344 |
! |
4345 |
||
3892 | 4346 |
update:something with:aParameter from:changedObject |
4347 |
||
4348 |
" do here all the things that have to be done for every part of the FileBrowserV2 |
|
4349 |
and the things that have to be done if it runs standalone " |
|
4350 |
||
4351 |
changedObject == self currentFileNameHolder ifTrue:[ |
|
4577 | 4352 |
self currentFileNameHolderChangedForCommon. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4353 |
^ self |
3892 | 4354 |
]. |
3989 | 4355 |
changedObject == self sortCaseless ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4356 |
self sortFileListsBy:#baseName withReverse:false. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4357 |
^ self |
3989 | 4358 |
]. |
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4359 |
changedObject == self sortBlockProperty ifTrue:[ |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4360 |
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
|
4361 |
^ self |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
4362 |
]. |
4011 | 4363 |
(changedObject == self filterModel or:[changedObject == self showHiddenFiles]) ifTrue:[ |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4364 |
self filterModelChanged. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4365 |
^ self |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4366 |
]. |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4367 |
changedObject == self rootHolder ifTrue:[ |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4368 |
self class rootHolder:(self rootHolder value). |
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
4369 |
^ self |
4004 | 4370 |
]. |
4781 | 4371 |
changedObject == self showDiskUsageHolder ifTrue:[ |
6190 | 4372 |
self notify:nil. |
4781 | 4373 |
^ self |
4374 |
]. |
|
3989 | 4375 |
|
3892 | 4376 |
super update:something with:aParameter from:changedObject |
5543 | 4377 |
! |
4378 |
||
6095 | 4379 |
updateCanMake |
4380 |
|dir can| |
|
4381 |
||
4382 |
can := false. |
|
4383 |
dir := self currentDirectory. |
|
4384 |
dir notNil ifTrue:[ |
|
12230
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4385 |
"/ Check for make |
6095 | 4386 |
can := (dir asFilename construct:'Makefile') exists. |
4387 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
4388 |
can ifFalse:[ |
|
4389 |
can := (self currentDirectory asFilename construct:'nt.mak') exists. |
|
4390 |
] |
|
4391 |
]. |
|
12230
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4392 |
can ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4393 |
self makeCommandHolder value: 'make'. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4394 |
self canMake value: true. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4395 |
^ self |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4396 |
]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4397 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4398 |
"/Check for Apache ant |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4399 |
(OperatingSystem canExecuteCommand: 'ant') ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4400 |
can := (dir asFilename construct:'build.xml') exists. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4401 |
can ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4402 |
self makeCommandHolder value: 'ant'. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4403 |
self canMake value: true. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4404 |
^ self |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4405 |
]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4406 |
]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4407 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4408 |
"/Add more here... |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4409 |
|
6095 | 4410 |
]. |
4411 |
self canMake value:can. |
|
12230
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4412 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
4413 |
"Modified: / 13-04-2012 / 17:05:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
6095 | 4414 |
! |
4415 |
||
5543 | 4416 |
updateListAfterDelete:colOfFiles |
4417 |
self updateCurrentDirectory |
|
3892 | 4418 |
! ! |
4419 |
||
4420 |
!AbstractFileBrowser methodsFor:'clipboard'! |
|
4421 |
||
4422 |
canPaste |
|
4423 |
||
4424 |
^ self aspectFor:#canPaste ifAbsent:[ false asValue ]. |
|
4425 |
! |
|
4426 |
||
4427 |
clipboard |
|
4428 |
||
4429 |
^ self aspectFor:#clipboard ifAbsent:[Clipboard new] |
|
4430 |
! |
|
4431 |
||
4432 |
copyFilesToClipBoard:colOfFiles |
|
4433 |
self putInClipBoard:colOfFiles as:#copy. |
|
4434 |
! |
|
4435 |
||
4436 |
cutFilesToClipBoard:colOfFiles |
|
4437 |
"defete current selected files/directories |
|
4438 |
" |
|
4439 |
self putInClipBoard:colOfFiles as:#cut. |
|
4440 |
! |
|
4441 |
||
4442 |
emptyClipBoard |
|
4443 |
||
4444 |
self clipboard files:nil. |
|
4445 |
self canPaste value:false. |
|
4446 |
! |
|
4447 |
||
4448 |
putInClipBoard:colOfFiles as:aSymbol |
|
4449 |
| stream clp| |
|
4450 |
||
4451 |
colOfFiles isEmpty ifTrue:[ ^ self]. |
|
4452 |
clp := self clipboard. |
|
4453 |
clp files:nil. |
|
4454 |
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
|
4455 |
|
603abfa8cf99
copy name(s) to clipboard - on lineFeed if only one file is selected
Claus Gittinger <cg@exept.de>
parents:
5756
diff
changeset
|
4456 |
stream := String writeStream. |
3892 | 4457 |
stream nextPutAll:aSymbol asString. |
4458 |
stream nextPutAll:' <'. |
|
4459 |
stream nextPutAll:colOfFiles first asString. |
|
4460 |
colOfFiles size > 1 ifTrue:[ |
|
4414 | 4461 |
stream nextPutAll:' ...'. |
3892 | 4462 |
]. |
4463 |
stream nextPutAll:'> to clipboard'. |
|
4464 |
||
4523 | 4465 |
self notify:stream contents. |
3892 | 4466 |
stream close. |
4467 |
clp files:colOfFiles. |
|
4468 |
self canPaste value:true. |
|
4469 |
! ! |
|
4470 |
||
4471 |
!AbstractFileBrowser methodsFor:'drag & drop'! |
|
4472 |
||
4473 |
canDropFiles:dropedObjects for:filename |
|
6284 | 4474 |
|filenameDirString filenameDir| |
3892 | 4475 |
|
4476 |
dropedObjects isEmpty ifTrue:[^ false]. |
|
6284 | 4477 |
|
3892 | 4478 |
filenameDir := self getDirWithoutFileName:filename. |
7491 | 4479 |
filenameDir isNil ifTrue:[^ false ]. |
6250
5b0673ccff1c
refactored intention revealing code:
Claus Gittinger <cg@exept.de>
parents:
6236
diff
changeset
|
4480 |
filenameDir isWritable ifFalse:[^ false]. |
6284 | 4481 |
|
3892 | 4482 |
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
|
4483 |
|
7ce6eae41e33
do not check if dropFile exists, if its an archive file
Claus Gittinger <cg@exept.de>
parents:
4959
diff
changeset
|
4484 |
dropedObjects do:[:aDropObject | |
6284 | 4485 |
(self canDropObject:aDropObject into:filenameDir) ifFalse:[^ false]. |
4486 |
"/ |dropFileName dropFileNameString physicalPathName| |
|
4487 |
"/ |
|
4488 |
"/ dropFileName := aDropObject theObject. |
|
4489 |
"/ dropFileNameString := dropFileName asString. |
|
4490 |
"/ dropFileName isDirectory ifTrue:[ |
|
4491 |
"/ (self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4492 |
"/ self notify:'Cannot drop a directory into one of its parent directories'. |
|
4493 |
"/ ^ false |
|
4494 |
"/ ] |
|
4495 |
"/ ] ifFalse:[ |
|
4496 |
"/ physicalPathName := dropFileName physicalPathName. |
|
4497 |
"/ (filenameDirString = dropFileName directory asString |
|
4498 |
"/ or:[ aDropObject isFileInArchive not and:[physicalPathName notNil |
|
4499 |
"/ and:[ filenameDirString = physicalPathName asFilename directory asString]]]) ifTrue:[ |
|
4500 |
"/ self notify:'Cannot drop a file into same directory'. |
|
4501 |
"/ ^ false |
|
4502 |
"/ ] |
|
4503 |
"/ ] |
|
4504 |
]. |
|
4505 |
self notify:nil. |
|
4506 |
^ true |
|
4507 |
! |
|
4508 |
||
4509 |
canDropObject:aDropObject into:aDirectory |
|
4510 |
|filenameDirString dropFileName dropFileNameString physicalPathName| |
|
4511 |
||
4512 |
dropFileName := aDropObject theObject. |
|
4513 |
dropFileNameString := dropFileName asString. |
|
4514 |
dropFileName isDirectory ifTrue:[ |
|
4515 |
filenameDirString := aDirectory asString. |
|
4516 |
(self fileName:filenameDirString startsWith:dropFileNameString) ifTrue:[ |
|
4517 |
self notify:'Cannot drop a directory into one of its parent directories'. |
|
4518 |
^ false |
|
4414 | 4519 |
] |
6284 | 4520 |
] ifFalse:[ |
4521 |
physicalPathName := dropFileName physicalPathName. |
|
4522 |
(aDirectory = dropFileName directory |
|
4523 |
or:[ aDropObject isFileInArchive not |
|
4524 |
and:[physicalPathName notNil |
|
4525 |
and:[ aDirectory = physicalPathName asFilename directory]]]) ifTrue:[ |
|
4526 |
self notify:'Cannot drop a file into same directory'. |
|
4527 |
^ false |
|
4528 |
] |
|
4529 |
]. |
|
4530 |
^ true. |
|
3892 | 4531 |
! |
4532 |
||
7406 | 4533 |
canDropObjects:aCollectionOfDropObjects in:aWidget |
4534 |
^ aCollectionOfDropObjects contains:[:dropObject | dropObject isFileObject] |
|
4535 |
||
4536 |
"Created: / 13-10-2006 / 15:52:49 / cg" |
|
4537 |
! |
|
4538 |
||
3892 | 4539 |
doStartDrag:aDropSource in:aView |
7829 | 4540 |
"set the cursors before starting the drag & drop operation" |
4541 |
||
3892 | 4542 |
|hdl| |
4543 |
||
4544 |
hdl := DragAndDropManager new. |
|
4545 |
||
4337
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4546 |
hdl disabledCursor:self class disabledCursorImage. |
f2eed806e854
change first letter uppercase methods on class side to lowercase ones
penk
parents:
4317
diff
changeset
|
4547 |
hdl enabledCursor:self class enabledCursorImage. |
3892 | 4548 |
hdl alienCursor:nil. |
4549 |
||
4745 | 4550 |
hdl startDragFrom:aView dropSource:aDropSource offset:#topLeft. |
4551 |
||
7829 | 4552 |
"Modified: / 23-07-2007 / 23:00:38 / cg" |
6479 | 4553 |
! |
4554 |
||
7408 | 4555 |
dropObjects:aCollectionOfDropObjects in:aWidget at:position |
7990 | 4556 |
|fileEntryFieldHolder destDir dropObject fn d| |
4557 |
||
4558 |
fileEntryFieldHolder := self masterApplication notNil |
|
4559 |
ifTrue:[ self masterApplication fileEntryFieldHolder ] |
|
4560 |
ifFalse:[ self fileEntryFieldHolder ]. |
|
4561 |
||
4562 |
aWidget model == fileEntryFieldHolder ifTrue:[ |
|
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4563 |
dropObject := aCollectionOfDropObjects first. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4564 |
dropObject isFileObject ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4565 |
fn := dropObject theObject asFilename. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4566 |
dropObject isDirectory ifTrue:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4567 |
d := fn. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4568 |
] ifFalse:[ |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4569 |
d := fn directory. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4570 |
]. |
7990 | 4571 |
fileEntryFieldHolder value:d pathName. |
7900
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4572 |
]. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4573 |
^ self. |
52ad708471ad
drop into fileName-path-field: goto that directory
Claus Gittinger <cg@exept.de>
parents:
7897
diff
changeset
|
4574 |
]. |
6479 | 4575 |
|
4576 |
destDir := self currentDirectory. |
|
4577 |
destDir isNil ifTrue:[^ self]. |
|
4578 |
||
8601 | 4579 |
self withWaitCursorDo:[ |
4580 |
aCollectionOfDropObjects do:[:dropObject | |
|
4581 |
|fn| |
|
4582 |
||
4583 |
dropObject isFileObject ifTrue:[ |
|
4584 |
fn := dropObject theObject asFilename. |
|
4585 |
dropObject isDirectory ifTrue:[ |
|
8808
cb6476c0cd3a
oops - drop of directories was broken
Claus Gittinger <cg@exept.de>
parents:
8716
diff
changeset
|
4586 |
fn recursiveCopyTo:destDir |
8601 | 4587 |
] ifFalse:[ |
8950
48c69259d82d
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
8887
diff
changeset
|
4588 |
fn copyTo:(destDir / fn baseName ) |
8601 | 4589 |
] |
6479 | 4590 |
] |
8601 | 4591 |
]. |
4592 |
]. |
|
9268
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4593 |
self directoryContentsBrowser notNil ifTrue:[ |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4594 |
self directoryContentsBrowser |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4595 |
directoryContentsChangeFlag:true; |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4596 |
wakeUp |
fbeb680106c9
changed: #dropObjects:in:at:
Claus Gittinger <cg@exept.de>
parents:
9267
diff
changeset
|
4597 |
]. |
7408 | 4598 |
|
4599 |
"Created: / 13-10-2006 / 18:26:41 / cg" |
|
3892 | 4600 |
! ! |
4601 |
||
4602 |
!AbstractFileBrowser methodsFor:'file operations'! |
|
4603 |
||
4604 |
copyFile:aSourceFile to:aDestFile |
|
6190 | 4605 |
"copy to" |
4606 |
||
7635 | 4607 |
^ self copyFile:aSourceFile to:aDestFile repairCorruptedFiles:false |
4608 |
||
4609 |
"Modified: / 07-02-2007 / 18:46:44 / cg" |
|
4610 |
! |
|
4611 |
||
4612 |
copyFile:aSourceFile to:aDestFile repairCorruptedFiles:repairCorruptedFiles |
|
4613 |
"copy to" |
|
4614 |
||
4615 |
|copyOperation msg| |
|
4616 |
||
4617 |
repairCorruptedFiles ifTrue:[ |
|
4618 |
copyOperation := FileOperation copyCorruptedFile:aSourceFile to:aDestFile |
|
4619 |
] ifFalse:[ |
|
4620 |
copyOperation := FileOperation copyFile:aSourceFile to:aDestFile withOverWriteWarning:true copyFileIfSame:true. |
|
4621 |
]. |
|
4622 |
copyOperation result ifTrue:[ |
|
6190 | 4623 |
msg := ('copy ', aSourceFile baseName, ' to:,', aDestFile baseName). |
3892 | 4624 |
] ifFalse:[ |
7635 | 4625 |
msg := copyOperation errorString. |
6190 | 4626 |
]. |
4627 |
self notify:msg. |
|
7635 | 4628 |
^ copyOperation result |
4629 |
||
4630 |
"Created: / 07-02-2007 / 18:46:34 / cg" |
|
3892 | 4631 |
! |
4632 |
||
4633 |
copyFiles:aColOfSourceFiles to:aDirectory |
|
6374 | 4634 |
|copy result| |
3892 | 4635 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4636 |
self withActivityIndicationDo:[ |
5961 | 4637 |
copy := FileOperation copyFiles:aColOfSourceFiles to:aDirectory. |
6374 | 4638 |
copy result ifTrue:[ |
4639 |
result := Dictionary withKeys:(copy collectionOfCopiedFiles) andValues:(copy collectionOfNewFiles). |
|
4640 |
] ifFalse:[ |
|
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4641 |
self notify:copy errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4642 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4643 |
self updateCurrentDirectory. |
3892 | 4644 |
]. |
6374 | 4645 |
^ result |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4646 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4647 |
"Modified: / 25-07-2006 / 09:07:04 / cg" |
3892 | 4648 |
! |
4649 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4650 |
copyOrMoveDialog:aCollectionOfFiles for:aDestinationDirectory |
12850 | 4651 |
|size msg answer file| |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4652 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4653 |
size := aCollectionOfFiles size. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4654 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4655 |
"/ stream := WriteStream on:'' asText. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4656 |
"/ 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
|
4657 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4658 |
"/ stream nextPutAll:'s'. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4659 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4660 |
"/ stream nextPutAll:': '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4661 |
"/ 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
|
4662 |
"/ size == 1 ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4663 |
"/ stream nextPutAll:' ... '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4664 |
"/ 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
|
4665 |
"/ ]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4666 |
"/ stream cr; nextPutAll:'to: '. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4667 |
"/ 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
|
4668 |
"/ msg := stream contents |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4669 |
size == 1 ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4670 |
file := aCollectionOfFiles first. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4671 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4672 |
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
|
4673 |
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
|
4674 |
with:(file baseName allBold) |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4675 |
with:(aDestinationDirectory asFilename pathName allBold). |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4676 |
] ifFalse:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4677 |
msg := resources |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4678 |
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
|
4679 |
with:size |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4680 |
with:(aDestinationDirectory asFilename pathName allBold). |
3892 | 4681 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4682 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4683 |
answer := OptionBox |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4684 |
request:msg |
8127 | 4685 |
label:(resources string:'Copy or Move') |
5898
f6214812e1d2
dont send obsolete message to OptionBox
Claus Gittinger <cg@exept.de>
parents:
5888
diff
changeset
|
4686 |
image:(WarningBox iconBitmap) |
8127 | 4687 |
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
|
4688 |
values:#(#cancel #move #copy #copyAs) |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4689 |
default:#copy. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4690 |
answer isNil ifTrue:[answer := #cancel]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4691 |
^ answer. |
3892 | 4692 |
! |
4693 |
||
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4694 |
copyOrMoveFiles:aColOfSourceFiles to:aDestinationDirectory |
4745 | 4695 |
"copy or move aColOfSourceFiles to aDirectory. |
4696 |
Asks the used if a move or a copy is wanted. |
|
4697 |
Returns true if the copyOrMove happened, false if user aborted the operation." |
|
4698 |
||
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4699 |
|answer lastOld lastNew| |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4700 |
|
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4701 |
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
|
4702 |
answer == #copyAs ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4703 |
aColOfSourceFiles do:[:eachSourceFile | |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4704 |
|initial destFile srcBase dstBase| |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4705 |
|
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4706 |
srcBase := eachSourceFile asFilename baseName. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4707 |
lastOld isNil ifTrue:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4708 |
initial := srcBase |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4709 |
] ifFalse:[ |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4710 |
initial := DoWhatIMeanSupport |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4711 |
goodRenameDefaultForFile:srcBase lastOld:lastOld lastNew:lastNew. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4712 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4713 |
dstBase := Dialog request:('Copy %1 as:' bindWith:srcBase) initialAnswer:initial. |
4745 | 4714 |
dstBase isNil ifTrue:[^ false]. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4715 |
self copyFile:eachSourceFile to:(aDestinationDirectory construct:dstBase). |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4716 |
lastOld := srcBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4717 |
lastNew := dstBase. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4718 |
]. |
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4719 |
|
4745 | 4720 |
^ true. |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4721 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4722 |
answer == #copy ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4723 |
self copyFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4724 |
^ true. |
3892 | 4725 |
]. |
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
4726 |
answer == #move ifTrue:[ |
4354
0a1239cd339d
added copyAs in drag and drop
Claus Gittinger <cg@exept.de>
parents:
4347
diff
changeset
|
4727 |
self moveFiles:aColOfSourceFiles to:aDestinationDirectory. |
4745 | 4728 |
^ true. |
3892 | 4729 |
]. |
4745 | 4730 |
^ false. |
3892 | 4731 |
! |
4732 |
||
6107 | 4733 |
copySelectionTo |
4734 |
"copy the selected file(s) to another directory" |
|
4735 |
||
7635 | 4736 |
self copySelectionToRepairingCorruptedFiles:false |
4737 |
||
4738 |
"Modified: / 07-02-2007 / 18:42:48 / cg" |
|
4739 |
! |
|
4740 |
||
4741 |
copySelectionToRepairingCorruptedFiles |
|
4742 |
"copy the selected file(s) to another directory" |
|
4743 |
||
4744 |
self copySelectionToRepairingCorruptedFiles:true |
|
4745 |
||
4746 |
"Created: / 07-02-2007 / 18:42:59 / cg" |
|
4747 |
! |
|
4748 |
||
4749 |
copySelectionToRepairingCorruptedFiles:repairingCorruptedFiles |
|
4750 |
"copy the selected file(s) to another directory" |
|
4751 |
||
6299 | 4752 |
|selectedFiles msg destination directory| |
4753 |
||
7560 | 4754 |
selectedFiles := self currentSelectedObjects copy. |
6299 | 4755 |
selectedFiles isEmptyOrNil ifTrue:[^ self]. |
4756 |
||
4757 |
msg := (selectedFiles size > 1) |
|
4758 |
ifTrue:[ 'Copy Selected Items To Directory:' ] |
|
4759 |
ifFalse:[ 'Copy "%1" To Directory:' ]. |
|
4760 |
||
4761 |
destination := Dialog |
|
7635 | 4762 |
requestDirectoryName:(resources stringWithCRs:msg with:selectedFiles first pathName) |
4763 |
default:(LastMoveDestination ? self currentDirectory) |
|
4764 |
ok:(resources string:'Copy') |
|
4765 |
abort:nil. |
|
4766 |
||
6299 | 4767 |
destination isEmptyOrNil ifTrue:[^ self]. |
4768 |
destination := destination asFilename. |
|
4769 |
||
4770 |
destination isDirectory ifFalse:[ |
|
4771 |
selectedFiles size == 1 ifTrue:[ |
|
4772 |
directory := destination directory. |
|
4773 |
directory isDirectory ifTrue:[ |
|
4774 |
LastMoveDestination := directory. |
|
7635 | 4775 |
self copyFile:selectedFiles first to:destination repairCorruptedFiles:repairingCorruptedFiles. |
6299 | 4776 |
^ self. |
4777 |
] |
|
4778 |
] |
|
4779 |
]. |
|
4780 |
||
4781 |
LastMoveDestination := destination. |
|
7635 | 4782 |
repairingCorruptedFiles ifTrue:[ |
4783 |
selectedFiles do:[:eachFile | |
|
4784 |
self copyFile:eachFile to:destination repairCorruptedFiles:repairingCorruptedFiles. |
|
4785 |
]. |
|
4786 |
^ self. |
|
4787 |
] ifFalse:[ |
|
4788 |
self copyFiles:selectedFiles to:destination |
|
4789 |
] |
|
4790 |
||
4791 |
"Created: / 07-02-2007 / 18:42:35 / cg" |
|
6107 | 4792 |
! |
4793 |
||
3892 | 4794 |
deleteFile:aFile |
6373 | 4795 |
"delete the selected files/directories" |
3892 | 4796 |
|
4797 |
^ self deleteFiles:(OrderedCollection with:aFile). |
|
4798 |
! |
|
4799 |
||
4800 |
deleteFiles:colOfFiles |
|
6373 | 4801 |
"delete some files/directories" |
4802 |
||
5081 | 4803 |
^ self deleteFiles:colOfFiles confirm:true. |
4804 |
! |
|
4805 |
||
4806 |
deleteFiles:colOfFiles confirm:confirm |
|
6373 | 4807 |
"delete some files/directories" |
4808 |
||
5673 | 4809 |
|delete result| |
3892 | 4810 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4811 |
self withActivityIndicationDo:[ |
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4812 |
ProgressNotification handle:[:info | |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4813 |
self progressPercentageHolder value:info progressValue. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4814 |
info proceed |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4815 |
] do:[ |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4816 |
delete := FileOperation deleteFiles:colOfFiles confirm:confirm. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4817 |
result := delete result. |
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4818 |
]. |
5673 | 4819 |
result notNil ifTrue:[ |
4820 |
result ifFalse:[ |
|
4821 |
self notify:delete errorString. |
|
5753 | 4822 |
] ifTrue:[ |
4823 |
self updateListAfterDelete:colOfFiles. |
|
4824 |
] |
|
4394 | 4825 |
]. |
5673 | 4826 |
]. |
4827 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4828 |
|
9575
548adf8e9d98
added: #progressPercentageHolder
Claus Gittinger <cg@exept.de>
parents:
9572
diff
changeset
|
4829 |
"Modified: / 11-10-2010 / 13:08:24 / cg" |
3892 | 4830 |
! |
4831 |
||
6169 | 4832 |
eraseFiles:colOfFiles |
6373 | 4833 |
"erase (clear and delete) some files/directories" |
4834 |
||
6169 | 4835 |
^ self eraseFiles:colOfFiles confirm:true. |
4836 |
! |
|
4837 |
||
4838 |
eraseFiles:colOfFiles confirm:confirm |
|
6373 | 4839 |
"erase (clear and delete) some files/directories" |
4840 |
||
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4841 |
|deleteOperation result fileSize| |
6169 | 4842 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4843 |
self withActivityIndicationDo:[ |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4844 |
fileSize := colOfFiles first asFilename fileSize. |
8294 | 4845 |
deleteOperation := FileOperation eraseFiles:colOfFiles confirm:confirm. |
8462
a5d12742a900
changed #eraseFiles:confirm:
Claus Gittinger <cg@exept.de>
parents:
8454
diff
changeset
|
4846 |
(colOfFiles size == 1 and:[ fileSize < (10*1024*1024) ]) |
8294 | 4847 |
ifTrue:[ |
4848 |
result := deleteOperation result. |
|
4849 |
] ifFalse:[ |
|
4850 |
ProgressIndicator |
|
4851 |
displayProgressNotifications:'Erasing' |
|
4852 |
abortable:true |
|
4853 |
at:nil |
|
4854 |
during:[ |
|
4855 |
result := deleteOperation result. |
|
4856 |
]. |
|
4857 |
]. |
|
4858 |
||
6169 | 4859 |
result notNil ifTrue:[ |
4860 |
result ifFalse:[ |
|
8294 | 4861 |
self notify:deleteOperation errorString. |
6169 | 4862 |
] ifTrue:[ |
4863 |
self updateListAfterDelete:colOfFiles. |
|
4864 |
] |
|
4865 |
]. |
|
4866 |
]. |
|
4867 |
^ result. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4868 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4869 |
"Modified: / 25-07-2006 / 09:07:16 / cg" |
6169 | 4870 |
! |
4871 |
||
3892 | 4872 |
moveFile:aSourceFile to:aDestFile |
6373 | 4873 |
"move a file/directory" |
3892 | 4874 |
|
4875 |
|move| |
|
4876 |
||
5961 | 4877 |
move := FileOperation moveFile:aSourceFile to:aDestFile. |
3892 | 4878 |
move result ifTrue:[ |
4523 | 4879 |
self notify:('move ', aSourceFile asString, ' to ', aDestFile asString). |
3892 | 4880 |
] ifFalse:[ |
4523 | 4881 |
self notify:move errorString. |
3892 | 4882 |
]. |
4883 |
self updateCurrentDirectory. |
|
4884 |
^ move result |
|
4885 |
! |
|
4886 |
||
4887 |
moveFiles:aColOfSourceFiles to:aDirectory |
|
6373 | 4888 |
"move some files to aDirectory" |
4889 |
||
3892 | 4890 |
|move| |
4891 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4892 |
self withActivityIndicationDo:[ |
5961 | 4893 |
move := FileOperation moveFiles:aColOfSourceFiles to:aDirectory. |
4629
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4894 |
move result ifFalse:[ |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4895 |
self notify:move errorString. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4896 |
]. |
e8739857466c
show busyCursor while moving/copying files.
Claus Gittinger <cg@exept.de>
parents:
4624
diff
changeset
|
4897 |
self updateCurrentDirectory. |
3892 | 4898 |
]. |
6373 | 4899 |
^ move collectionOfMovedFiles |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4900 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
4901 |
"Modified: / 25-07-2006 / 09:07:32 / cg" |
3892 | 4902 |
! |
4903 |
||
6107 | 4904 |
moveSelectionTo |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4905 |
"move the selected file(s) to another directory" |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4906 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4907 |
|destinationDirectory| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4908 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4909 |
destinationDirectory := Dialog |
6352 | 4910 |
requestDirectoryName:(resources stringWithCRs:'Move Selected Items To:') |
5789 | 4911 |
default:(LastMoveDestination ? self currentDirectory) |
6952 | 4912 |
ok:(resources string:'Move') |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4913 |
abort:nil. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4914 |
destinationDirectory isEmptyOrNil ifTrue:[^ self]. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4915 |
|
5789 | 4916 |
LastMoveDestination := destinationDirectory. |
7560 | 4917 |
self moveFiles:(self currentSelectedObjects copy) to:destinationDirectory asFilename |
4918 |
||
4919 |
"Modified: / 04-12-2006 / 13:15:12 / cg" |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4920 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4921 |
|
3892 | 4922 |
newDirectory |
4923 |
"ask for and create a new directory" |
|
4924 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4925 |
|selectedFiles singleSelectedFile defaultAnswer directory createOp newFile mime| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4926 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4927 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4928 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4929 |
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
|
4930 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4931 |
]. |
4521 | 4932 |
|
4933 |
"/ 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
|
4934 |
selectedFiles := self currentSelectedFiles. |
4521 | 4935 |
selectedFiles size == 1 ifTrue:[ |
4936 |
singleSelectedFile := selectedFiles first. |
|
4937 |
||
4938 |
mime := MIMETypes mimeTypeForFilename:singleSelectedFile. |
|
4939 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
|
4940 |
defaultAnswer := singleSelectedFile asFilename withoutSuffix baseName. |
|
4941 |
||
4942 |
mime := MIMETypes mimeTypeForFilename:defaultAnswer. |
|
4982
c38742d99bfd
care for nil mime in newDirectory
Claus Gittinger <cg@exept.de>
parents:
4979
diff
changeset
|
4943 |
(mime notNil and:[mime isArchive]) ifTrue:[ |
4521 | 4944 |
defaultAnswer := defaultAnswer asFilename withoutSuffix baseName |
4945 |
]. |
|
4946 |
]. |
|
4947 |
]. |
|
4948 |
||
5961 | 4949 |
|
4521 | 4950 |
defaultAnswer notNil ifTrue:[ |
5961 | 4951 |
createOp := FileOperation createDirectoryIn:directory initialAnswer:defaultAnswer. |
4521 | 4952 |
] ifFalse:[ |
5961 | 4953 |
createOp := FileOperation createDirectoryIn:directory. |
4521 | 4954 |
]. |
4955 |
createOp result ifFalse:[ ^ self]. |
|
4956 |
newFile := createOp createdFile. |
|
3892 | 4957 |
newFile notNil ifTrue:[ |
4414 | 4958 |
self updateCurrentDirectory. |
3892 | 4959 |
] |
4960 |
! |
|
4961 |
||
4962 |
newFile |
|
4963 |
"ask for and create a new file" |
|
4964 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4965 |
| curFile directory create file| |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4966 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4967 |
directory := self currentDirectory. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4968 |
directory isNil ifTrue:[ |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4969 |
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
|
4970 |
^ self. |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4971 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4972 |
|
3982 | 4973 |
curFile := self firstSelectedFile. |
3892 | 4974 |
curFile notNil ifTrue:[ |
4414 | 4975 |
file := curFile. |
3892 | 4976 |
] ifFalse:[ |
4414 | 4977 |
file := directory. |
3892 | 4978 |
]. |
5961 | 4979 |
create := FileOperation createFileIn:file. |
3892 | 4980 |
create result ifFalse:[ ^ self]. |
4981 |
self updateAndSelect:(OrderedCollection with:(create createdFile)). |
|
4982 |
! |
|
4983 |
||
4984 |
newHardLink |
|
4985 |
"ask for and create a hard link (unix only)" |
|
4986 |
||
6151 | 4987 |
self newLink:#hard. |
4988 |
! |
|
4989 |
||
4990 |
newLink:typeOfLink |
|
3892 | 4991 |
"ask for and create a symbolic if symbolic is true otherwise a hard link (unix only)" |
4992 |
||
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
4993 |
| sel dir create createdFile| |
3892 | 4994 |
|
7560 | 4995 |
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
|
4996 |
(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
|
4997 |
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
|
4998 |
^ self |
366465d1a8a5
warn on create new file or directory if nothing selected or more than one directory
penk
parents:
4976
diff
changeset
|
4999 |
]. |
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5000 |
dir := sel first. |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
5001 |
|
6151 | 5002 |
create := FileOperation createLinkIn:dir soft:(typeOfLink == #soft). |
3892 | 5003 |
create result ifFalse:[ ^ self]. |
5004 |
createdFile := create createdFile. |
|
5005 |
createdFile notNil ifTrue:[ |
|
6151 | 5006 |
typeOfLink == #soft ifTrue:[ |
4785
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5007 |
self updateCurrentDirectory. |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5008 |
] ifFalse:[ |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5009 |
self updateAndSelect:(OrderedCollection with:createdFile). |
5a3f7a0c3ff1
symbolic link creation code fixed
Claus Gittinger <cg@exept.de>
parents:
4782
diff
changeset
|
5010 |
] |
3892 | 5011 |
]. |
7560 | 5012 |
|
5013 |
"Modified: / 04-12-2006 / 13:15:15 / cg" |
|
3892 | 5014 |
! |
5015 |
||
5016 |
newSoftLink |
|
5017 |
"ask for and create a soft link (unix only)" |
|
5018 |
||
6151 | 5019 |
self newLink:#soft. |
3892 | 5020 |
! |
5021 |
||
5022 |
pasteFiles |
|
6373 | 5023 |
"paste from clipBoard" |
5024 |
||
5025 |
|buffer destination files directories copiedFiles thisIsAFileMoveOperation| |
|
3892 | 5026 |
|
5027 |
files := self clipboard files. |
|
6482
00207f456339
isEmptyOrNil / notEmptyOrNil refactoring
Claus Gittinger <cg@exept.de>
parents:
6479
diff
changeset
|
5028 |
files isEmptyOrNil ifTrue:[ ^ self ]. |
6373 | 5029 |
|
5030 |
thisIsAFileMoveOperation := self clipboard method == #cut. |
|
5031 |
||
3892 | 5032 |
buffer := self clipboard copy. |
3982 | 5033 |
directories := self currentSelectedDirectories. |
5880 | 5034 |
directories size ~~ 1 ifTrue:[ |
4414 | 5035 |
|box dirStringCol| |
5880 | 5036 |
|
4414 | 5037 |
dirStringCol := directories collect:[:aDir| aDir asString]. |
5038 |
box := ListSelectionBox new. |
|
6373 | 5039 |
box title:'Paste into which directory ?'. |
4414 | 5040 |
box list:dirStringCol. |
5041 |
box okAction:[:sel | destination := sel asFilename]. |
|
5003
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5042 |
box show. |
a14ce263ada5
boxes no longer show at pointer
Claus Gittinger <cg@exept.de>
parents:
4982
diff
changeset
|
5043 |
box destroy. |
3892 | 5044 |
] ifFalse:[ |
5880 | 5045 |
destination := directories anElement. |
3892 | 5046 |
]. |
6373 | 5047 |
|
5048 |
thisIsAFileMoveOperation ifTrue:[ |
|
5081 | 5049 |
buffer files copy do:[:aFile| |
5050 |
aFile directory = destination ifTrue:[ |
|
5051 |
buffer files remove:aFile. |
|
5052 |
]. |
|
5053 |
]. |
|
5054 |
]. |
|
5055 |
copiedFiles := self copyFiles:(buffer files) to:destination. |
|
6374 | 5056 |
copiedFiles notEmptyOrNil ifTrue:[ |
5057 |
thisIsAFileMoveOperation ifTrue:[ |
|
5058 |
self deleteFiles:(copiedFiles keys) confirm:false. |
|
5059 |
]. |
|
5060 |
||
5061 |
"/ select those pasted files. |
|
5062 |
self updateCurrentDirectory:true. |
|
5063 |
self currentFileNameHolder value:copiedFiles values. |
|
5064 |
] |
|
3892 | 5065 |
! |
5066 |
||
5067 |
renameFile:aFile |
|
5068 |
"rename the selected file(s)" |
|
5069 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5070 |
^ self renameFiles:(Array with:aFile). |
3892 | 5071 |
! |
5072 |
||
4230 | 5073 |
renameFile:filename to:newFileString update:aBoolean |
3892 | 5074 |
"rename filename to newFileString" |
5075 |
||
5076 |
|rename| |
|
5077 |
||
5961 | 5078 |
rename := FileOperation renameFile:filename to:newFileString. |
3892 | 5079 |
rename result ifTrue:[ |
4230 | 5080 |
aBoolean ifTrue:[ |
5081 |
self updateAndSelect:(rename renamedFiles). |
|
5082 |
]. |
|
3892 | 5083 |
] ifFalse:[ |
4523 | 5084 |
self notify:rename errorString. |
3892 | 5085 |
]. |
5086 |
^ rename result |
|
5087 |
! |
|
5088 |
||
5089 |
renameFiles:aColOfFiles |
|
6373 | 5090 |
"rename some file(s)" |
3892 | 5091 |
|
5092 |
|rename| |
|
5093 |
||
5961 | 5094 |
rename := FileOperation renameFiles:aColOfFiles. |
3892 | 5095 |
rename result ifFalse:[ |
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5096 |
self notify:rename errorString. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5097 |
^ nil. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5098 |
]. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5099 |
^ rename |
3892 | 5100 |
! |
5101 |
||
5102 |
renameSelection |
|
5103 |
"rename the selected file(s)" |
|
5104 |
||
9793
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5105 |
|renamed| |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5106 |
|
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5107 |
renamed := self renameFiles:(self currentSelectedObjects copy). |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5108 |
renamed notNil ifTrue:[ |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5109 |
self updateAndSelect:renamed renamedFiles. |
df3c1b8165fa
variable renamed in: #renameFile:
Stefan Vogel <sv@exept.de>
parents:
9784
diff
changeset
|
5110 |
]. |
7560 | 5111 |
|
5112 |
"Modified: / 04-12-2006 / 13:15:24 / cg" |
|
3892 | 5113 |
! ! |
5114 |
||
4080 | 5115 |
!AbstractFileBrowser methodsFor:'menu accessing'! |
3892 | 5116 |
|
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5117 |
bookmarksMenu |
3952 | 5118 |
<resource: #programMenu> |
5119 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5120 |
|menu bookmarks| |
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5121 |
|
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5122 |
menu := self class baseBookmarksMenuSpec decodeAsLiteralArray. |
7763 | 5123 |
|
5124 |
"/ add the bookmark items ... |
|
5125 |
bookmarks := self class directoryBookmarks. |
|
5126 |
bookmarks notEmptyOrNil ifTrue:[ |
|
5127 |
menu addItem:(MenuItem labeled:'-'). |
|
5128 |
bookmarks do:[:dirName | |
|
5129 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
5130 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
|
5131 |
self setCurrentFileName:dirName. |
|
5132 |
]. |
|
5133 |
])). |
|
5134 |
]. |
|
5135 |
]. |
|
4080 | 5136 |
menu findGuiResourcesIn:self. |
7763 | 5137 |
^ menu |
5138 |
||
11135 | 5139 |
"Modified: / 14-01-2012 / 21:14:03 / cg" |
7763 | 5140 |
! |
5141 |
||
5142 |
canBackward |
|
5143 |
^ self directoryHistory canBackward. |
|
5144 |
||
5145 |
"Modified: / 27-03-2007 / 10:54:55 / cg" |
|
5146 |
! |
|
5147 |
||
5148 |
canForward |
|
5149 |
^ self directoryHistory canForward. |
|
5150 |
||
5151 |
"Modified: / 27-03-2007 / 10:54:57 / cg" |
|
5152 |
! |
|
5153 |
||
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
5154 |
gotoBookmarksMenu |
7763 | 5155 |
<resource: #programMenu> |
5156 |
||
5157 |
|menu bookmarks| |
|
5158 |
||
5159 |
menu := self class baseBookmarksMenuSpec2 decodeAsLiteralArray. |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5160 |
|
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5161 |
"/ add the bookmark items ... |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5162 |
bookmarks := self class directoryBookmarks. |
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5163 |
bookmarks notEmptyOrNil ifTrue:[ |
4414 | 5164 |
menu addItem:(MenuItem labeled:'-'). |
5165 |
bookmarks do:[:dirName | |
|
5166 |
menu addItem:((MenuItem label:dirName asString value:[ |
|
6725 | 5167 |
(self currentSelectedDirectories includes:dirName) ifFalse:[ |
5959 | 5168 |
self setCurrentFileName:dirName. |
4414 | 5169 |
]. |
5170 |
])). |
|
5171 |
]. |
|
3952 | 5172 |
]. |
7763 | 5173 |
menu findGuiResourcesIn:self. |
3952 | 5174 |
^ menu |
5175 |
||
11135 | 5176 |
"Modified: / 14-01-2012 / 21:13:58 / cg" |
6099 | 5177 |
! |
5178 |
||
3892 | 5179 |
menuDirHistory:backOrForward |
7763 | 5180 |
"initialize the history menu" |
5181 |
||
3892 | 5182 |
<resource: #programMenu > |
5183 |
||
7763 | 5184 |
|hist menu pathList currentSel currentPath| |
5185 |
||
5186 |
hist := self directoryHistory. |
|
5187 |
hist isEmpty ifTrue:[^ nil]. |
|
5188 |
||
3892 | 5189 |
backOrForward == #back ifTrue:[ |
6725 | 5190 |
currentSel := self currentSelectedDirectories. |
4347 | 5191 |
currentSel size == 1 ifTrue:[ |
5192 |
currentPath := currentSel first asString. |
|
5193 |
] ifFalse:[ |
|
5194 |
currentPath := nil. |
|
5195 |
]. |
|
7763 | 5196 |
pathList := hist getBackCollection. |
3892 | 5197 |
] ifFalse:[ |
7763 | 5198 |
pathList := hist getForwardCollection. |
3892 | 5199 |
]. |
4022 | 5200 |
pathList isEmpty ifTrue:[ ^ nil]. |
7763 | 5201 |
|
6370 | 5202 |
pathList size > 30 ifTrue:[ |
5203 |
pathList := pathList copyTo:30 |
|
5204 |
]. |
|
7763 | 5205 |
|
5206 |
menu := Menu new. |
|
5207 |
||
3964 | 5208 |
pathList do:[:aPath| |
4347 | 5209 |
| menuItem | |
5210 |
menuItem := MenuItem new. |
|
5211 |
menuItem label:aPath. |
|
11783 | 5212 |
menuItem itemValue:[ self setCurrentFileName:(aPath asFilename) ]. |
4347 | 5213 |
menu addItem:menuItem. |
3952 | 5214 |
]. |
7763 | 5215 |
menu findGuiResourcesIn:self. |
3892 | 5216 |
^ menu |
7763 | 5217 |
|
11783 | 5218 |
"Modified: / 09-09-2012 / 13:07:22 / cg" |
3892 | 5219 |
! |
5220 |
||
5221 |
menuDirHistoryBack |
|
5222 |
"initialize the directory menu |
|
5223 |
" |
|
5224 |
<resource: #programMenu > |
|
5225 |
||
5226 |
^ self menuDirHistory:#back. |
|
5227 |
! |
|
5228 |
||
5229 |
menuDirHistoryForward |
|
5230 |
"initialize the directory menu |
|
5231 |
" |
|
5232 |
<resource: #programMenu > |
|
5233 |
||
5234 |
^ self menuDirHistory:#forward. |
|
3906 | 5235 |
! |
5236 |
||
5237 |
menuFileHistory |
|
5238 |
"initialize the file history menu |
|
5239 |
" |
|
5240 |
<resource: #programMenu > |
|
5241 |
||
7763 | 5242 |
|menu hist text removeItem| |
3906 | 5243 |
|
5244 |
hist := self fileHistory. |
|
5245 |
hist isEmpty ifTrue:[^ nil]. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5246 |
|
7763 | 5247 |
menu := Menu new. |
5248 |
||
5249 |
hist copy do:[:aFileItem| |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5250 |
aFileItem fileName exists ifTrue:[ |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5251 |
menu addItem:(MenuItem label: aFileItem fileName asString value:[ |
5959 | 5252 |
self setCurrentFileName:(aFileItem fileName). |
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5253 |
self openApplByFileItem:aFileItem |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5254 |
]). |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5255 |
] ifFalse:[ |
7763 | 5256 |
"/ remove all not existing history entries |
5257 |
hist remove:aFileItem. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5258 |
] |
3906 | 5259 |
]. |
7763 | 5260 |
menu addSeparator. |
5261 |
||
4080 | 5262 |
removeItem := MenuItem new. |
5263 |
removeItem translateLabel:true. |
|
4391
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5264 |
text := resources string:'Clear History'. |
05ad03de6f3c
no icon in clearHistory menuItem
Claus Gittinger <cg@exept.de>
parents:
4368
diff
changeset
|
5265 |
"/ text := LabelAndIcon icon:(self class clearHistoryIcon) string:text. |
4080 | 5266 |
removeItem label:text. |
11783 | 5267 |
removeItem |
5268 |
itemValue:[ |
|
5269 |
self fileHistory removeAll. |
|
5270 |
self enableFileHistory value:false. |
|
5271 |
]. |
|
3906 | 5272 |
menu addItem:removeItem. |
7763 | 5273 |
menu findGuiResourcesIn:self. |
3906 | 5274 |
^ menu |
7763 | 5275 |
|
11783 | 5276 |
"Modified (format): / 09-09-2012 / 13:07:36 / cg" |
3952 | 5277 |
! |
5278 |
||
4080 | 5279 |
sortMenu |
5280 |
<resource: #programMenu > |
|
5281 |
||
5282 |
|menu| |
|
5283 |
||
7763 | 5284 |
menu := Menu decodeFromLiteralArray:self class sortMenu. |
4080 | 5285 |
menu findGuiResourcesIn:self. |
5286 |
^ menu |
|
7763 | 5287 |
|
5288 |
"Modified: / 27-03-2007 / 10:47:42 / cg" |
|
4080 | 5289 |
! |
5290 |
||
5291 |
viewDetailsMenuSpec |
|
4976
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5292 |
|specContentsBrowser itemsContentsBrowser specHere itemsHere spec| |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5293 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5294 |
specHere := self class viewDetailsMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5295 |
itemsHere := specHere at:2. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5296 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5297 |
specContentsBrowser := self directoryContentsBrowser class viewBrowserMenuSpec. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5298 |
itemsContentsBrowser := (specContentsBrowser at:2). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5299 |
|
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5300 |
spec := specHere copy. |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5301 |
spec at:2 put:(itemsContentsBrowser , itemsHere). |
86594f3f8a9b
refactoring column visibility holder of DirectoryContentsBrowser
penk
parents:
4974
diff
changeset
|
5302 |
^ spec |
4080 | 5303 |
! |
5304 |
||
5305 |
viewInContentsBrowserMenu |
|
5009 | 5306 |
self |
5307 |
applicationNamed:#DirectoryContentsBrowser |
|
5308 |
ifPresentDo:[:appl | ^ appl viewBrowserMenu]. |
|
5309 |
||
5310 |
^ nil. |
|
4080 | 5311 |
! |
5312 |
||
3952 | 5313 |
visitedDirectoriesMenu |
5314 |
<resource: #programMenu > |
|
5315 |
||
5316 |
|menu histCopy text removeItem| |
|
5317 |
||
7763 | 5318 |
histCopy := self directoryHistory. |
5319 |
histCopy isEmpty ifTrue:[^ nil]. |
|
5320 |
||
3952 | 5321 |
menu := Menu new. |
7763 | 5322 |
|
5323 |
histCopy do:[:aFile| |
|
5324 |
menu addItem:(MenuItem label:aFile asString value:[ |
|
5325 |
self setCurrentFileName:(aFile path asFilename). |
|
5326 |
]). |
|
5327 |
]. |
|
5328 |
menu addSeparator. |
|
5329 |
||
4672
185a4d75348f
common bookmark code with new fileBrowser
Claus Gittinger <cg@exept.de>
parents:
4663
diff
changeset
|
5330 |
"/ 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
|
5331 |
text := (resources string:'Clear History'). |
3952 | 5332 |
removeItem := MenuItem new. |
4040 | 5333 |
removeItem translateLabel:true. |
3952 | 5334 |
removeItem label:text. |
11783 | 5335 |
removeItem |
5336 |
itemValue:[ |
|
5337 |
self directoryHistory removeAll. |
|
5338 |
self enableForward value:self canForward. |
|
5339 |
self enableBack value:self canBackward. |
|
5340 |
]. |
|
7763 | 5341 |
|
3952 | 5342 |
menu addItem:removeItem. |
7763 | 5343 |
menu findGuiResourcesIn:self. |
3952 | 5344 |
^ menu |
7763 | 5345 |
|
11783 | 5346 |
"Modified: / 09-09-2012 / 13:07:45 / cg" |
3892 | 5347 |
! ! |
5348 |
||
5880 | 5349 |
!AbstractFileBrowser methodsFor:'menu actions'! |
5350 |
||
5351 |
doCompareTwoFiles |
|
5352 |
self openDiffView. |
|
5353 |
! |
|
5354 |
||
5355 |
doGoDirectoryUp |
|
5960 | 5356 |
| upDir directory rootInTreeView| |
5880 | 5357 |
|
5358 |
self enableDirectoryUp value ifFalse:[ ^ self]. |
|
5359 |
self currentFilesAreInSameDirectory ifTrue:[ |
|
5960 | 5360 |
directory := self currentDirectory. |
5361 |
directory isNil ifTrue:[ ^ self]. |
|
5880 | 5362 |
] ifFalse:[ |
5363 |
rootInTreeView := self |
|
5364 |
applicationNamed:#DirectoryTreeBrowser |
|
5365 |
ifPresentDo:[:appl | appl rootHolder]. |
|
5960 | 5366 |
directory := rootInTreeView value asFilename. |
5367 |
]. |
|
5368 |
upDir := directory directory. |
|
5959 | 5369 |
self setCurrentFileName:upDir. |
5880 | 5370 |
! |
5371 |
||
5372 |
doGotoDefaultDirectory |
|
5373 |
self gotoFile:(Filename defaultDirectory). |
|
5374 |
! |
|
5375 |
||
8091 | 5376 |
doGotoDesktopDirectory |
5377 |
self gotoFile:(Filename desktopDirectory). |
|
5378 |
! |
|
5379 |
||
5880 | 5380 |
doGotoHomeDirectory |
8091 | 5381 |
self gotoFile:(Filename homeDirectory). |
5880 | 5382 |
! |
5383 |
||
6434 | 5384 |
doGotoSmalltalkDirectory |
5385 |
self gotoFile:(self smalltalkDirectory). |
|
5386 |
! |
|
5387 |
||
9677 | 5388 |
doGotoTempDirectory |
5389 |
self gotoFile:(self tempDirectory). |
|
5390 |
||
5391 |
"Created: / 29-12-2010 / 11:03:17 / cg" |
|
5392 |
! |
|
5393 |
||
9596 | 5394 |
doMakeCurrentDirectory |
5395 |
OperatingSystem setCurrentDirectory:(self currentDirectory pathName). |
|
5396 |
self currentFileNameHolderChangedForCommon. |
|
5397 |
||
5398 |
"Created: / 26-10-2010 / 17:21:19 / cg" |
|
5399 |
! |
|
5400 |
||
5880 | 5401 |
fileGetInfo:longInfo |
5402 |
"get info on selected file - show it in a box" |
|
5403 |
||
5404 |
|string box updater| |
|
5405 |
||
5406 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5407 |
string notNil ifTrue:[ |
|
5408 |
box := InfoBox title:string. |
|
5409 |
updater := [ |
|
5410 |
[true] whileTrue:[ |
|
5411 |
Delay waitForSeconds:2. |
|
5412 |
string := self getFileInfoStringForFirstSelectedFile:longInfo. |
|
5413 |
string isNil ifTrue:[ ^ self]. |
|
5414 |
box title:string |
|
5415 |
] |
|
5416 |
] fork. |
|
5417 |
box show. |
|
5418 |
updater terminate. |
|
5419 |
box destroy |
|
5420 |
] |
|
6434 | 5421 |
! |
5422 |
||
5423 |
smalltalkDirectory |
|
8590 | 5424 |
|stxPath| |
6434 | 5425 |
|
5426 |
stxPath := OperatingSystem pathOfSTXExecutable. |
|
8590 | 5427 |
stxPath isNil ifTrue:[ |
5428 |
^ Filename currentDirectory |
|
5429 |
]. |
|
5430 |
^ stxPath asFilename directory. |
|
9677 | 5431 |
! |
5432 |
||
5433 |
tempDirectory |
|
5434 |
^ Filename tempDirectory. |
|
5435 |
||
5436 |
"Created: / 29-12-2010 / 11:03:00 / cg" |
|
5880 | 5437 |
! ! |
5438 |
||
11139 | 5439 |
!AbstractFileBrowser methodsFor:'menu actions-file'! |
5440 |
||
5441 |
copyFiles |
|
5442 |
self |
|
5443 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self copyFilesToClipBoard:filesOrDirs] |
|
5444 |
! |
|
5445 |
||
5446 |
cutFiles |
|
5447 |
self |
|
5448 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self cutFilesToClipBoard:filesOrDirs] |
|
5449 |
! |
|
5450 |
||
5451 |
deleteFiles |
|
5452 |
self |
|
5453 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self deleteFiles:filesOrDirs] |
|
5454 |
! |
|
5455 |
||
5456 |
eraseFiles |
|
5457 |
self |
|
5458 |
withSelectedFilesOrDirectoriesDo:[:filesOrDirs | self eraseFiles:filesOrDirs] |
|
5459 |
! |
|
5460 |
||
5461 |
openSettingsDialog |
|
5462 |
|dialog| |
|
5463 |
||
5464 |
dialog := FileBrowserV2SettingsDialog new. |
|
5465 |
dialog settingsDialog:self. |
|
5466 |
dialog allButOpen. |
|
5467 |
dialog doReload. |
|
5468 |
dialog openWindow |
|
5469 |
! |
|
5470 |
||
5471 |
withSelectedFilesOrDirectoriesDo:aBlock |
|
5472 |
|files dirs| |
|
5473 |
||
5474 |
files := self currentSelectedFiles. |
|
5475 |
files notEmpty ifTrue:[ |
|
5476 |
aBlock value:files. |
|
5477 |
] ifFalse:[ |
|
5478 |
dirs := self currentSelectedDirectories. |
|
5479 |
dirs notEmpty ifTrue:[ |
|
5480 |
aBlock value:dirs. |
|
5481 |
]. |
|
5482 |
]. |
|
5483 |
! ! |
|
5484 |
||
5485 |
!AbstractFileBrowser methodsFor:'menu actions-help'! |
|
5486 |
||
5487 |
openAboutThisApplication |
|
5488 |
"opens an about box for this application." |
|
5489 |
||
5490 |
Dialog aboutClass:self class. |
|
5491 |
! |
|
5492 |
||
5493 |
openHTMLDocument:relativeDocPath |
|
5494 |
HTMLDocumentView openFullOnDocumentationFile:relativeDocPath |
|
5495 |
! ! |
|
5496 |
||
5497 |
!AbstractFileBrowser methodsFor:'menu actions-scm-cvs'! |
|
3892 | 5498 |
|
12777 | 5499 |
commitFilesToCVS:files |
5500 |
|numFiles| |
|
5501 |
||
5502 |
(numFiles := files size) > 0 ifTrue:[ |
|
5503 |
self withActivityIndicationDo:[ |
|
5504 |
self cvsCommitFiles:files |
|
5505 |
] |
|
5506 |
] |
|
5507 |
! |
|
5508 |
||
3892 | 5509 |
cvsAddAndCommit |
4849 | 5510 |
self cvsAddAndCommitAsBinary:false |
5511 |
! |
|
5512 |
||
5513 |
cvsAddAndCommitAsBinary:asBinary |
|
8588 | 5514 |
|sel log logArg binArg cmd dir executionBlock nameString| |
3892 | 5515 |
|
5516 |
log := Dialog |
|
11139 | 5517 |
requestText:(resources string:'Enter initial log message:') |
4414 | 5518 |
lines:10 |
5519 |
columns:70 |
|
5520 |
initialAnswer:nil. |
|
8322
cf10f08b6164
care for cancel in #cvsAddAndCommitAsBinary:
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
5521 |
log isNil ifTrue:[^ self]. |
3892 | 5522 |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5523 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5524 |
logArg := '-m "' , log , '"'. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5525 |
] ifFalse:[ |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5526 |
logArg := '-m ''' , log , ''''. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5527 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5528 |
|
8588 | 5529 |
binArg := ''. |
5530 |
asBinary ifTrue:[ |
|
5531 |
binArg := '-kb '. |
|
5532 |
]. |
|
3982 | 5533 |
sel := self currentSelectedFiles. |
11139 | 5534 |
executionBlock := |
5535 |
[:stream | |
|
5536 |
log notNil ifTrue:[ |
|
5537 |
sel size > 0 ifTrue:[ |
|
5538 |
sel do:[:fn | |
|
5539 |
|nameArg| |
|
5540 |
||
5541 |
nameArg := '"',fn baseName,'"'. |
|
5542 |
||
5543 |
dir := self getDirWithoutFileName:fn. |
|
5544 |
cmd := 'cvs add ',logArg,' ',binArg,nameArg. |
|
5545 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5546 |
||
5547 |
cmd := ('cvs commit -l ',logArg,' ',nameArg). |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5548 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
11139 | 5549 |
"/ mhmh - it seems that only old CVS implementations (at least turqoise) |
5550 |
"/ support and need the 'admin -kb' command. |
|
5551 |
"/ newer ones use the '-kb' option in the 'cvs add' command |
|
5552 |
asBinary ifTrue:[ |
|
5553 |
cmd := ('cvs admin -kb ' , nameArg). |
|
5554 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5555 |
||
5556 |
cmd := ('cvs upd ' , nameArg). |
|
5557 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5558 |
]. |
|
5559 |
] |
|
5560 |
] |
|
5561 |
] |
|
5562 |
]. |
|
4107 | 5563 |
nameString := 'Command> cvs add and commit'. |
3892 | 5564 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
11139 | 5565 |
|
5566 |
"Modified (format): / 15-01-2012 / 16:02:07 / cg" |
|
3892 | 5567 |
! |
5568 |
||
4849 | 5569 |
cvsAddBinaryAndCommit |
5570 |
self cvsAddAndCommitAsBinary:true |
|
5571 |
! |
|
5572 |
||
3892 | 5573 |
cvsCommit |
12777 | 5574 |
|selectedFiles| |
3892 | 5575 |
|
3982 | 5576 |
selectedFiles:= self currentSelectedFiles. |
12777 | 5577 |
self cvsCommitFiles:selectedFiles |
5578 |
! |
|
5579 |
||
5580 |
cvsCommitFiles:files |
|
5581 |
|nFiles log logTmp s logArg msg executionBlock nameString | |
|
5582 |
||
5583 |
nFiles := files size. |
|
5584 |
nFiles == 0 ifTrue:[^ self]. |
|
5585 |
||
5586 |
nFiles == 1 ifTrue:[ |
|
5587 |
msg := resources string:'Enter log message for checkIn of "%1"' with:(files first baseName) |
|
3892 | 5588 |
] ifFalse:[ |
12777 | 5589 |
nFiles > 1 ifTrue:[ |
5590 |
msg := resources string:'Enter log message for %1 files to checkIn' with:nFiles printString |
|
4414 | 5591 |
] ifFalse:[ |
6627 | 5592 |
msg := resources string:'Enter log message for checkIn' |
4414 | 5593 |
] |
3892 | 5594 |
]. |
5595 |
||
5596 |
log := Dialog |
|
4414 | 5597 |
requestText:msg |
5598 |
lines:10 |
|
5599 |
columns:70 |
|
5600 |
initialAnswer:nil. |
|
3892 | 5601 |
|
4663 | 5602 |
log isNil ifTrue:[^ self]. |
12777 | 5603 |
log := log replChar:$" withString:'\"'. |
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5604 |
|
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5605 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
12777 | 5606 |
"/ save the log message into another tempFile ... |
5607 |
logTmp := Filename newTemporary. |
|
5608 |
s := logTmp writeStream. |
|
5609 |
s nextPutAll:log. |
|
5610 |
s close. |
|
5611 |
||
5612 |
logArg := '-F "', logTmp pathName, '"'. |
|
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5613 |
] ifFalse:[ |
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 |
]. |
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5616 |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
5617 |
executionBlock := [:stream | |
12777 | 5618 |
[ |
5619 |
files do:[:fn | |
|
5620 |
| dir nameArg cmd | |
|
5621 |
||
5622 |
nameArg := '"',fn baseName,'"'. |
|
5623 |
dir := fn directory. |
|
5624 |
cmd := 'cvs commit ',logArg,' ' , nameArg. |
|
5625 |
stream showCR:fn pathName. |
|
5626 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
4663 | 5627 |
] |
12777 | 5628 |
] ensure:[ |
5629 |
logTmp notNil ifTrue:[ logTmp remove ]. |
|
5630 |
]. |
|
4107 | 5631 |
]. |
5632 |
nameString := 'Command> cvs commit'. |
|
5633 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
3892 | 5634 |
! |
5635 |
||
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5636 |
cvsCompareWithNewest |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5637 |
|selectedFiles| |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5638 |
|
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5639 |
selectedFiles:= self currentSelectedFiles. |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5640 |
selectedFiles do:[:each | |
11176
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5641 |
|out diffs| |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5642 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5643 |
out := WriteStream on:(String new:100). |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5644 |
OperatingSystem |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5645 |
executeCommand:'cvs diff -b ',each baseName |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5646 |
outputTo:out |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5647 |
inDirectory:each directoryName. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5648 |
diffs := out contents. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5649 |
TextView openWith:diffs. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5650 |
]. |
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5651 |
|
eb02b211e777
changed: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
11162
diff
changeset
|
5652 |
"Modified: / 23-01-2012 / 14:08:28 / cg" |
9407
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5653 |
! |
cf114ba82b6d
added: #cvsCompareWithNewest
Claus Gittinger <cg@exept.de>
parents:
9405
diff
changeset
|
5654 |
|
3892 | 5655 |
cvsRemoveAndRemoveFromCVS:filesToRemove |
5656 |
"remove the selected file(s) and their CVS containers - no questions asked" |
|
5657 |
||
6205
0c94c101cfde
cvs - log-argument fixes for win32
Claus Gittinger <cg@exept.de>
parents:
6204
diff
changeset
|
5658 |
|toRemove updateRunning executionBlock nameString| |
3892 | 5659 |
|
5660 |
updateRunning := self backgroundProcesses value notEmpty. |
|
5661 |
self killAllRunningBackgroundProcesses. |
|
5662 |
toRemove := OrderedCollection new. |
|
5663 |
||
12493 | 5664 |
executionBlock := |
5665 |
[:stream | |
|
5666 |
|cmd logArg prevDir prevFiles| |
|
5667 |
||
5668 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
|
5669 |
logArg := '-m "' , 'removed via FileBrowser' , '"'. |
|
5670 |
] ifFalse:[ |
|
5671 |
logArg := '-m ''' , 'removed via FileBrowser' , ''''. |
|
5672 |
]. |
|
5673 |
prevFiles := ''. |
|
5674 |
||
5675 |
filesToRemove do:[:fileName | |
|
5676 |
|dir file| |
|
5677 |
||
5678 |
dir := fileName directory. |
|
5679 |
(prevDir notNil and:[prevDir ~= dir]) ifTrue:[ |
|
5680 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
|
5681 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5682 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5683 |
prevFiles := ''. |
|
4414 | 5684 |
]. |
12493 | 5685 |
|
5686 |
OperatingSystem accessDeniedErrorSignal handle:[:ex| |
|
5687 |
"was not able to remove it" |
|
5688 |
| lastError msg | |
|
5689 |
lastError := OperatingSystem lastErrorString. |
|
5690 |
msg := (resources string:'cannot remove ''%1'' !!' with:fileName). |
|
5691 |
lastError isNil ifFalse:[ |
|
5692 |
msg := msg , '\\(' , lastError , ')' |
|
5693 |
]. |
|
5694 |
Dialog warn:msg withCRs |
|
5695 |
] do:[ |
|
5696 |
(fileName isSymbolicLink) ifFalse:[ |
|
5697 |
fileName remove. |
|
5698 |
file := fileName baseName. |
|
5699 |
cmd := ('cvs remove -f "',file,'"'). |
|
5700 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5701 |
"/ Transcript show:dir; space; showCR:cmd. |
|
5702 |
] |
|
5703 |
]. |
|
5704 |
prevDir := dir. |
|
5705 |
prevFiles := prevFiles,' ',file. |
|
4414 | 5706 |
]. |
12493 | 5707 |
cmd := 'cvs commit -l ',logArg, ' ',prevFiles. |
5708 |
"/ Transcript show:prevDir; space; showCR:cmd. |
|
5709 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5710 |
]. |
|
4107 | 5711 |
nameString := 'Command> cvs remove and commit ', filesToRemove first baseName. |
3892 | 5712 |
filesToRemove size > 1 ifTrue:[ |
4414 | 5713 |
nameString := nameString, ' ...'. |
3892 | 5714 |
]. |
5715 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5716 |
! |
|
5717 |
||
5718 |
cvsRemoveFileAndCVSContainer |
|
12493 | 5719 |
|files| |
5720 |
||
5721 |
files := self currentSelectedFiles copy. |
|
5722 |
self removeFilesAndCVSContainers:files |
|
3892 | 5723 |
! |
5724 |
||
9338 | 5725 |
cvsRevisionLog |
5726 |
| cmd sel executionBlock nameString| |
|
5727 |
||
5728 |
sel := self currentSelectedObjects. |
|
5729 |
sel isEmpty ifTrue:[ ^ self ]. |
|
5730 |
||
5731 |
executionBlock := [:stream | |
|
5732 |
sel do:[:fn | |
|
5733 |
| dir nameArg | |
|
5734 |
||
5735 |
nameArg := '"',fn baseName,'"'. |
|
5736 |
dir := fn directory. |
|
5737 |
cmd := 'cvs log ' , nameArg. |
|
5738 |
(self getExecutionBlockForCommand:cmd inDirectory:dir) value:stream. |
|
5739 |
] |
|
5740 |
]. |
|
5741 |
nameString := 'Command> cvs log'. |
|
5742 |
self makeExecutionResultProcessFor:executionBlock withName:nameString. |
|
5743 |
! |
|
5744 |
||
8562 | 5745 |
cvsTagSelection |
12856 | 5746 |
|tag tags cmd| |
5747 |
||
5748 |
tag := Dialog |
|
5749 |
request:(resources string:'Tag (possibly multiple, separated by ";"):') |
|
5750 |
initialAnswer:(CVSSourceCodeManager recentTag). |
|
5751 |
tag isEmptyOrNil ifTrue:[^ self ]. |
|
5752 |
||
5753 |
CVSSourceCodeManager recentTag:tag. |
|
8562 | 5754 |
|
5755 |
CVSSourceCodeManager notNil ifTrue:[ |
|
5756 |
cmd := CVSSourceCodeManager cvsExecutable. |
|
5757 |
] ifFalse:[ |
|
5758 |
cmd := 'cvs'. |
|
5759 |
]. |
|
5760 |
||
12856 | 5761 |
tags := tag asCollectionOfSubstringsSeparatedByAny:',;'. |
5762 |
tags do:[:eachTag | |
|
5763 |
self executeCommand:('%1 tag -F "%2" %3' |
|
5764 |
bindWith:cmd |
|
12858 | 5765 |
with:(eachTag withoutSeparators) |
12856 | 5766 |
with:(self makeFileNameArgumentString)) |
5767 |
]. |
|
8562 | 5768 |
! |
5769 |
||
3892 | 5770 |
cvsUpdateAll |
5771 |
| cmd | |
|
5772 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5773 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5774 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5775 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5776 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5777 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5778 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5779 |
self executeCommand:(cmd, ' upd -l'). |
3892 | 5780 |
! |
5781 |
||
5782 |
cvsUpdateAllRecursive |
|
5783 |
| cmd | |
|
5784 |
||
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5785 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5786 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5787 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5788 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5789 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5790 |
self executeCommand:(cmd, ' upd -d'). |
3892 | 5791 |
! |
5792 |
||
5793 |
cvsUpdateSelection |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5794 |
|stream cmd| |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5795 |
|
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5796 |
CVSSourceCodeManager notNil ifTrue:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5797 |
cmd := CVSSourceCodeManager cvsExecutable. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5798 |
] ifFalse:[ |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5799 |
cmd := 'cvs'. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5800 |
]. |
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5801 |
|
3892 | 5802 |
stream := WriteStream on:''. |
8563 | 5803 |
stream |
5804 |
nextPutAll:cmd; |
|
5805 |
nextPutAll:' upd '; |
|
5806 |
nextPutAll:(self makeFileNameArgumentString). |
|
5807 |
||
5808 |
self executeCommand:stream contents. |
|
5809 |
! |
|
5810 |
||
5811 |
makeFileNameArgumentString |
|
5812 |
|stream| |
|
5813 |
||
5814 |
stream := WriteStream on:''. |
|
8042
5a4655a03124
Get cvs executable path from CVSSourceCodeManager
Stefan Vogel <sv@exept.de>
parents:
8039
diff
changeset
|
5815 |
self currentSelectedFiles do:[: file | |
8563 | 5816 |
stream nextPut:$". |
4414 | 5817 |
stream nextPutAll:file baseName. |
8563 | 5818 |
stream nextPutAll:'" '. |
5819 |
]. |
|
5820 |
^ stream contents. |
|
12493 | 5821 |
! |
5822 |
||
5823 |
removeFilesAndCVSContainers:files |
|
5824 |
|numFiles question aswer| |
|
5825 |
||
5826 |
(numFiles := files size) > 0 ifTrue:[ |
|
5827 |
numFiles > 1 ifTrue:[ |
|
5828 |
question := resources string:'Remove %1 selected files and their CVS containers ?' with:numFiles |
|
5829 |
] ifFalse:[ |
|
5830 |
question := resources string:'Remove ''%1'' and its CVS container ?' with:(files first baseName allBold) |
|
5831 |
]. |
|
5832 |
||
5833 |
aswer := Dialog |
|
5834 |
confirm:question withCRs |
|
5835 |
yesLabel:(resources string:'Remove') |
|
5836 |
noLabel:(resources string:'Cancel'). |
|
5837 |
||
5838 |
aswer ifTrue:[ |
|
5839 |
self withActivityIndicationDo:[ |
|
5840 |
self cvsRemoveAndRemoveFromCVS:files |
|
5841 |
] |
|
5842 |
] |
|
5843 |
] |
|
3892 | 5844 |
! ! |
5845 |
||
11139 | 5846 |
!AbstractFileBrowser methodsFor:'menu actions-scm-mercurial'! |
5847 |
||
5848 |
mercurialAdd |
|
5849 |
|executionBlock sel maxCmdSize| |
|
5850 |
||
5851 |
maxCmdSize := 512. |
|
5852 |
||
5853 |
sel := self currentSelectedObjects. |
|
5854 |
sel isEmptyOrNil ifTrue:[ |
|
5855 |
^ self |
|
5856 |
]. |
|
5857 |
||
5858 |
executionBlock := |
|
5859 |
[:stream | |
|
5860 |
|prevDir cmd| |
|
5861 |
||
5862 |
prevDir := nil. |
|
5863 |
sel do:[:fn | |
|
5864 |
|nameArg dir| |
|
5865 |
||
5866 |
nameArg := '"',fn baseName,'"'. |
|
5867 |
dir := fn directory. |
|
5868 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
5869 |
"/ flush |
|
5870 |
cmd notNil ifTrue:[ |
|
5871 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5872 |
cmd := nil. |
|
5873 |
] |
|
5874 |
]. |
|
5875 |
cmd isNil ifTrue:[ |
|
5876 |
cmd := 'hg add'. |
|
5877 |
]. |
|
5878 |
cmd := cmd,' ',nameArg. |
|
5879 |
prevDir := dir. |
|
5880 |
]. |
|
5881 |
cmd notNil ifTrue:[ |
|
5882 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5883 |
cmd := nil. |
|
5884 |
]. |
|
5885 |
stream nextPutLine:'Commit to finish the transaction'. |
|
5886 |
]. |
|
5887 |
||
5888 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg add'. |
|
5889 |
||
5890 |
"Created: / 15-01-2012 / 15:55:47 / cg" |
|
5891 |
! |
|
5892 |
||
5893 |
mercurialCommit |
|
5894 |
|dir executionBlock| |
|
5895 |
||
5896 |
"/ dir := self currentDirectory. |
|
5897 |
dir := self directoryContentsBrowser directory. |
|
5898 |
executionBlock := |
|
5899 |
[:stream | |
|
5900 |
(self getExecutionBlockForCommand:'hg commit' |
|
5901 |
inDirectory:dir) value:stream. |
|
5902 |
stream nextPutLine:'Push to sync other repositories'. |
|
6169 | 5903 |
]. |
11139 | 5904 |
|
5905 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg commit'. |
|
5906 |
||
5907 |
"Created: / 15-01-2012 / 16:21:27 / cg" |
|
5908 |
! |
|
5909 |
||
11144 | 5910 |
mercurialInit |
5911 |
|dir executionBlock| |
|
5912 |
||
5913 |
dir := self directoryContentsBrowser directory. |
|
5914 |
||
5915 |
(Dialog confirm:(resources |
|
5916 |
string:'Initialize new Mercurial Repository in %1?' |
|
5917 |
with:dir baseName)) ifFalse:[^ self]. |
|
5918 |
||
5919 |
executionBlock := |
|
5920 |
[:stream | |
|
5921 |
(self getExecutionBlockForCommand:('hg init') |
|
5922 |
inDirectory:dir) value:stream. |
|
5923 |
]. |
|
5924 |
||
5925 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg init'. |
|
5926 |
||
5927 |
"Created: / 17-01-2012 / 15:58:46 / cg" |
|
5928 |
! |
|
5929 |
||
11139 | 5930 |
mercurialPush |
5931 |
|destination dir executionBlock| |
|
5932 |
||
5933 |
destination := Dialog request:'Mercurial Repository' |
|
5934 |
initialAnswer:(LastMercurialRepository ? MercurialSourceCodeManager repositoryName). |
|
5935 |
destination isEmptyOrNil ifTrue:[^ self]. |
|
5936 |
||
5937 |
LastMercurialRepository := destination. |
|
5938 |
||
5939 |
dir := self directoryContentsBrowser directory. |
|
5940 |
executionBlock := |
|
5941 |
[:stream | |
|
5942 |
(self getExecutionBlockForCommand:('hg push "%1"' bindWith:destination) |
|
5943 |
inDirectory:dir) value:stream. |
|
5944 |
]. |
|
5945 |
||
5946 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg push'. |
|
5947 |
||
5948 |
"Created: / 15-01-2012 / 16:29:41 / cg" |
|
5949 |
! |
|
5950 |
||
5951 |
mercurialStatus |
|
5952 |
|executionBlock sel maxCmdSize| |
|
5953 |
||
5954 |
maxCmdSize := 512. |
|
5955 |
||
5956 |
sel := self currentSelectedObjects. |
|
5957 |
sel isEmptyOrNil ifTrue:[ |
|
5958 |
^ self |
|
5959 |
]. |
|
5960 |
||
5961 |
executionBlock := |
|
5962 |
[:stream | |
|
5963 |
|prevDir cmd| |
|
5964 |
||
5965 |
prevDir := nil. |
|
5966 |
sel do:[:fn | |
|
5967 |
|nameArg dir| |
|
5968 |
||
5969 |
nameArg := '"',fn baseName,'"'. |
|
5970 |
dir := fn directory. |
|
5971 |
(dir ~= prevDir or:[ (cmd size + nameArg size) > maxCmdSize]) ifTrue:[ |
|
5972 |
"/ flush |
|
5973 |
cmd notNil ifTrue:[ |
|
5974 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5975 |
cmd := nil. |
|
5976 |
] |
|
5977 |
]. |
|
5978 |
cmd isNil ifTrue:[ |
|
5979 |
cmd := 'hg status'. |
|
5980 |
]. |
|
5981 |
cmd := cmd,' ',nameArg. |
|
5982 |
prevDir := dir. |
|
5983 |
]. |
|
5984 |
cmd notNil ifTrue:[ |
|
5985 |
(self getExecutionBlockForCommand:cmd inDirectory:prevDir) value:stream. |
|
5986 |
cmd := nil. |
|
5987 |
]. |
|
5988 |
]. |
|
5989 |
||
5990 |
self makeExecutionResultProcessFor:executionBlock withName:'Command> hg status'. |
|
5991 |
||
5992 |
"Created: / 15-01-2012 / 19:43:08 / cg" |
|
3892 | 5993 |
! ! |
5994 |
||
4849 | 5995 |
!AbstractFileBrowser methodsFor:'menu actions-tools'! |
3892 | 5996 |
|
8510 | 5997 |
allFilesInSelectedDirectoriesForWhich:aBlock |
5998 |
|directories allFiles| |
|
5999 |
||
6000 |
directories := self currentSelectedDirectories. |
|
6001 |
directories isEmpty ifTrue:[^ self]. |
|
6002 |
||
6003 |
allFiles := OrderedCollection new. |
|
6004 |
directories do:[:dir| |
|
6005 |
[ |
|
6006 |
|fileNames| |
|
6007 |
||
6008 |
fileNames := dir directoryContents. |
|
6009 |
fileNames notNil ifTrue:[ |
|
6010 |
fileNames := fileNames |
|
6011 |
collect:[:fn | dir construct:fn] |
|
6012 |
thenSelect:[:fn | fn isDirectory not and:[aBlock value:fn]]. |
|
6013 |
allFiles addAll:fileNames. |
|
6014 |
] |
|
6015 |
] on:FileStream openErrorSignal do:[:ex| |
|
6016 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
|
6017 |
with:ex pathName |
|
6018 |
with:ex description). |
|
6019 |
ex proceedWith:nil. |
|
6020 |
]. |
|
6021 |
]. |
|
6022 |
||
6023 |
^ allFiles |
|
6024 |
! |
|
6025 |
||
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6026 |
conversionChainFrom:inSuffix to:outSuffix |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6027 |
|conv| |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6028 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6029 |
inSuffix = outSuffix ifTrue:[ |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6030 |
^ nil |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6031 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6032 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6033 |
"/ 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
|
6034 |
"/ 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
|
6035 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6036 |
conv := OrderedCollection new. |
4722 | 6037 |
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
|
6038 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6039 |
outSuffix = 'png' ifTrue:[ |
4722 | 6040 |
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
|
6041 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6042 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6043 |
outSuffix = 'gif' ifTrue:[ |
4722 | 6044 |
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
|
6045 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6046 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6047 |
outSuffix = 'xpm' ifTrue:[ |
4722 | 6048 |
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
|
6049 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6050 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6051 |
outSuffix = 'jpg' ifTrue:[ |
4722 | 6052 |
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
|
6053 |
^ conv. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6054 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6055 |
self error:'unimplemented conversion'. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6056 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6057 |
|
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6058 |
convertImageFrom:fileName to:outFile onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6059 |
|writer image outSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6060 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6061 |
outSuffix := outFile suffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6062 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6063 |
((writer := MIMETypes imageReaderForSuffix:outSuffix) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6064 |
and:[ (image := Image fromFile:fileName) notNil |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6065 |
and:[ writer canRepresent:image ]]) ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6066 |
"/ can do it with Smalltalk tools |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6067 |
writer save:image onFile:outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6068 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6069 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6070 |
"/ use external tools (pbm-package, if available) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6071 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6072 |
convertImageUsingExternalFileToolsFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6073 |
toSuffix:outSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6074 |
onError:exceptionBlock. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6075 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6076 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6077 |
"Created: / 20-05-2010 / 11:12:36 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6078 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6079 |
|
4367 | 6080 |
convertImageToGIF |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6081 |
self convertImageToSuffix:'gif' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6082 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6083 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6084 |
convertImageToJPG |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6085 |
self convertImageToSuffix:'jpg' |
4531 | 6086 |
! |
6087 |
||
6088 |
convertImageToPNG |
|
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6089 |
self convertImageToSuffix:'png' |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6090 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6091 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6092 |
convertImageToSuffix:outSuffix |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6093 |
|outFile filesToConvert| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6094 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6095 |
self withActivityIndicationDo:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6096 |
filesToConvert := self currentSelectedObjects copy. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6097 |
filesToConvert do:[:fileName | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6098 |
self notify:(resources string:'Converting: %1...' with:fileName baseName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6099 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6100 |
fileName isDirectory ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6101 |
|skip| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6102 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6103 |
skip := false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6104 |
outFile := fileName withSuffix:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6105 |
outFile exists ifTrue:[ |
4722 | 6106 |
|answer| |
6107 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6108 |
answer := Dialog |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6109 |
confirmWithCancel:(resources string:'Overwrite existing %1 ?' with:outFile baseName allBold) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6110 |
default:false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6111 |
answer isNil ifTrue:[AbortSignal raise]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6112 |
answer ifFalse:[ skip := true ]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6113 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6114 |
skip ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6115 |
self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6116 |
convertImageFrom:fileName |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6117 |
to:outFile |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6118 |
onError:[:errMsg | |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6119 |
filesToConvert size == 1 ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6120 |
Dialog warn:errMsg |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6121 |
] ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6122 |
(Dialog confirm:errMsg yesLabel:(resources string:'OK') noLabel:(resources string:'Cancel')) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6123 |
^ self |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6124 |
] |
4721
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6125 |
]. |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6126 |
]. |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6127 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6128 |
self updateAndSelect:nil. |
4367 | 6129 |
] |
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6130 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6131 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6132 |
self notify:nil. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6133 |
] |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6134 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6135 |
"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
|
6136 |
! |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6137 |
|
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6138 |
convertImageToXPM |
2fe2500194e6
more image conversions (png); req'd for eXept swiki.
Claus Gittinger <cg@exept.de>
parents:
4708
diff
changeset
|
6139 |
self convertImageToSuffix:'xpm' |
4367 | 6140 |
! |
6141 |
||
9493
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6142 |
convertImageUsingExternalFileToolsFrom:fileName toSuffix:outSuffix onError:exceptionBlock |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6143 |
|inFile outFile chainOfConversions conversionStream tempFileTemplate |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6144 |
eachConversionSuffixCommandPair eachConversionCommand eachConversionSuffix| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6145 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6146 |
chainOfConversions := self conversionChainFrom:(fileName suffix) to:outSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6147 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6148 |
chainOfConversions isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6149 |
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
|
6150 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6151 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6152 |
conversionStream := chainOfConversions readStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6153 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6154 |
tempFileTemplate := Filename newTemporary. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6155 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6156 |
inFile := fileName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6157 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6158 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6159 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6160 |
eachConversionCommand == #readToXPM ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6161 |
|image tempFileXPM| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6162 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6163 |
image := Image fromFile:(inFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6164 |
image isNil ifTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6165 |
self warn:'Unknown format/not an image: ' , inFile baseName. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6166 |
^ false. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6167 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6168 |
tempFileXPM := tempFileTemplate withSuffix:'xpm'. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6169 |
image saveOn:tempFileXPM using:XPMReader. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6170 |
inFile := tempFileXPM. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6171 |
eachConversionSuffixCommandPair := conversionStream next. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6172 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6173 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6174 |
[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6175 |
|command errOutput errMsg| |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6176 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6177 |
[eachConversionSuffixCommandPair notNil] whileTrue:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6178 |
eachConversionCommand := eachConversionSuffixCommandPair key. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6179 |
eachConversionSuffix := eachConversionSuffixCommandPair value. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6180 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6181 |
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
|
6182 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6183 |
outFile := tempFileTemplate withSuffix:eachConversionSuffix. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6184 |
command := eachConversionCommand |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6185 |
bindWith:(inFile pathName) |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6186 |
with:(outFile pathName). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6187 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6188 |
errOutput := String writeStream. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6189 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6190 |
(OperatingSystem executeCommand:command errorTo:errOutput) ifFalse:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6191 |
errMsg := resources |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6192 |
stringWithCRs:'Conversion of %1 to %2 using %3 failed:\\%4.' |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6193 |
with:inFile baseName allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6194 |
with:eachConversionSuffix |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6195 |
with:eachConversionCommand allBold |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6196 |
with:errOutput contents. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6197 |
exceptionBlock value:errMsg. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6198 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6199 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6200 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6201 |
^ false |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6202 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6203 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6204 |
inFile := outFile. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6205 |
eachConversionSuffixCommandPair := conversionStream next |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6206 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6207 |
outFile moveTo:(fileName withSuffix:(chainOfConversions last value)). |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6208 |
] ifCurtailed:[ |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6209 |
(inFile ~= fileName) ifTrue:[inFile delete]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6210 |
outFile delete. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6211 |
]. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6212 |
^ true. |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6213 |
|
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6214 |
"Created: / 20-05-2010 / 11:05:50 / cg" |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6215 |
! |
3fc4fb8c1b0a
changed: #convertImageToSuffix:
Claus Gittinger <cg@exept.de>
parents:
9490
diff
changeset
|
6216 |
|
3892 | 6217 |
createProjectAndOpenProjectBrowser |
6218 |
|nm f s directory| |
|
6219 |
||
6220 |
self currentFilesAreInSameDirectory ifFalse:[^ self]. |
|
5960 | 6221 |
directory := self currentDirectory. |
3892 | 6222 |
nm := directory baseName. |
6223 |
f := (directory construct:nm) withSuffix:'prj'. |
|
6224 |
f exists ifTrue:[ |
|
4414 | 6225 |
Dialog warn:'A file named ' , f baseName , ' already exists.'. |
6226 |
^ self. |
|
3892 | 6227 |
]. |
6228 |
s := f writeStream. |
|
6229 |
s nextPutAll:' |
|
6230 |
name ''' , nm , ''' |
|
6231 |
type #classLibrary |
|
6232 |
package #''private:' , nm , ''' |
|
6233 |
prerequisites nil |
|
6234 |
||
6235 |
classes #( ) |
|
6236 |
'. |
|
6237 |
s close. |
|
6238 |
ProjectBrowser openOnFile:f. |
|
6239 |
! |
|
6240 |
||
5880 | 6241 |
doExecuteCommand |
6242 |
"execute an OperatingSystem-command" |
|
6243 |
||
6244 |
| action fileName| |
|
6245 |
||
6246 |
fileName := self firstSelectedFile. |
|
6247 |
action := [:command | |
|
6248 |
self addToCommandHistory:command for:fileName. |
|
6249 |
self executeCommand:command. |
|
6250 |
]. |
|
6251 |
self askForCommandFor:fileName thenDo:action |
|
6252 |
! |
|
6253 |
||
6254 |
doExecuteScript |
|
6255 |
"execute a smalltalk script" |
|
6256 |
||
6257 |
|textHolder dialog template dummyClass dummyInstance| |
|
6258 |
||
6259 |
template := |
|
6260 |
'"/ Smalltalk script: |
|
6261 |
||
6262 |
"/ the following variables are accessable: |
|
6263 |
"/ directory (= ' , (self theSingleSelectedDirectoryOrNil ? Filename homeDirectory) pathName , ') |
|
6264 |
"/ selectedFiles (= ...) |
|
6265 |
"/ |
|
6266 |
"/ Beginner warning: Smalltalk know-how is useful here ;-). |
|
6267 |
"/ |
|
6268 |
"/ Useful operations are: |
|
6269 |
"/ directory directoryContentsDo:[:eachBaseNameString | ...] |
|
6270 |
"/ directory directoryContentsAsFilenamesDo:[:eachFilename | ...] |
|
6271 |
"/ directory directory |
|
6272 |
"/ |
|
6273 |
"/ example: move all files which match a aarticular pattern to |
|
6274 |
"/ a separate directory: |
|
6275 |
"/ |
|
6276 |
"/ |directory idx prefix rest newDir oldFile newFile| |
|
6277 |
"/ |
|
6278 |
"/ directory := ''/mnt/var/priv/image/tv/frank/frank2/2131_008.jpg'' asFilename. |
|
6279 |
"/ |
|
6280 |
"/ directory directoryContentsDo:[:eachBaseNameString | |
|
6281 |
"/ (eachBaseNameString includes:$_) ifTrue:[ |
|
6282 |
"/ idx := eachBaseNameString indexOf:$_. |
|
6283 |
"/ prefix := eachBaseNameString copyTo:(idx - 1). |
|
6284 |
"/ rest := eachBaseNameString copyFrom:(idx + 1). |
|
6285 |
"/ newDir := directory construct:prefix. |
|
6286 |
"/ newDir exists ifFalse:[ |
|
6287 |
"/ (Dialog confirm:''Create '' , newDir pathName) ifTrue:[ |
|
6288 |
"/ newDir makeDirectory. |
|
6289 |
"/ ]. |
|
6290 |
"/ ]. |
|
6291 |
"/ newDir exists ifTrue:[ |
|
6292 |
"/ oldFile := directory construct:eachBaseNameString. |
|
6293 |
"/ newFile := newDir construct:rest. |
|
6294 |
"/ oldFile moveTo:newFile |
|
6295 |
"/ ] |
|
6296 |
"/ ] |
|
6297 |
"/ ] |
|
6298 |
'. |
|
6299 |
||
6300 |
LastScriptBlockString isNil ifTrue:[ |
|
6301 |
LastScriptBlockString := template. |
|
6302 |
]. |
|
6303 |
||
6304 |
textHolder := ValueHolder new. |
|
6305 |
dialog := Dialog |
|
6306 |
forRequestText:(resources string:'Enter script') |
|
6307 |
editViewClass:CodeView |
|
6308 |
lines:25 |
|
6309 |
columns:70 |
|
6310 |
initialAnswer:LastScriptBlockString |
|
6311 |
model:textHolder. |
|
6312 |
dialog addButton:(Button label:'Template' action:[textHolder value:template. textHolder changed:#value.]). |
|
6313 |
dialog open. |
|
6314 |
dialog accepted ifFalse:[^ self]. |
|
6315 |
||
6316 |
LastScriptBlockString := textHolder value. |
|
6317 |
||
6318 |
Class classConventionViolationConfirmationQuerySignal |
|
6319 |
answer:true |
|
6320 |
do:[ |
|
6321 |
dummyClass := Object class |
|
6322 |
name:#Dummy |
|
6323 |
inEnvironment:nil |
|
6324 |
subclassOf:Object |
|
6325 |
instanceVariableNames:'directory selectedFiles' |
|
6326 |
variable:false |
|
6327 |
words:true |
|
6328 |
pointers:true |
|
6329 |
classVariableNames:'' |
|
6330 |
poolDictionaries:'' |
|
6331 |
category:#dummyCategory |
|
6332 |
comment:nil |
|
6333 |
changed:true. |
|
6334 |
]. |
|
6335 |
||
6336 |
dummyInstance := dummyClass basicNew. |
|
6337 |
dummyInstance instVarAt:1 put:(self theSingleSelectedDirectoryOrNil ? Filename homeDirectory). |
|
6338 |
dummyInstance instVarAt:2 put:(self currentSelectedFiles value). |
|
6339 |
||
6340 |
Compiler |
|
6341 |
evaluate:textHolder value |
|
6342 |
in:nil |
|
6343 |
receiver:dummyInstance |
|
6344 |
notifying:nil |
|
6345 |
logged:false |
|
6346 |
ifFail:[] |
|
6347 |
compile:true. |
|
6348 |
||
6349 |
"/ fileName := self firstSelectedFile. |
|
6350 |
"/ action := [:command | |
|
6351 |
"/ self addToCommandHistory:command for:fileName. |
|
6352 |
"/ self executeCommand:command. |
|
6353 |
"/ ]. |
|
6354 |
"/ self askForCommandFor:fileName thenDo:action |
|
6355 |
! |
|
6356 |
||
4230 | 6357 |
doMake |
7938 | 6358 |
|dir cmd| |
4230 | 6359 |
|
12230
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6360 |
cmd := self makeCommandHolder value. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6361 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6362 |
"Make" |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6363 |
cmd = 'make' ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6364 |
dir := self theSingleSelectedDirectoryOrNil. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6365 |
OperatingSystem isMSWINDOWSlike ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6366 |
dir notNil ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6367 |
(dir construct:'bmake.bat') exists ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6368 |
cmd := 'bmake.bat'. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6369 |
] |
7938 | 6370 |
] |
12230
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6371 |
]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6372 |
self executeCommand:cmd. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6373 |
^self. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6374 |
]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6375 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6376 |
"Apache ant" |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6377 |
cmd = 'ant' ifTrue:[ |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6378 |
self executeCommand:cmd. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6379 |
^self. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6380 |
]. |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6381 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6382 |
"Add more here..." |
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6383 |
|
5568874ba4cf
- AbstractFileBrowser: added support for ant, hammer as build icon
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12217
diff
changeset
|
6384 |
"Modified (comment): / 13-04-2012 / 17:07:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4230 | 6385 |
! |
6386 |
||
8256 | 6387 |
doOpenCBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6388 |
"the CBrowser is an eXept-internal C-language IDE tool. |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6389 |
(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
|
6390 |
20 years ago ;-)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6391 |
|
8256 | 6392 |
|destDir| |
6393 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6394 |
(CBrowser isNil or:[ CBrowser::Browser isNil ]) ifTrue:[ |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6395 |
Smalltalk loadPackage:'exept:CC' |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6396 |
]. |
8256 | 6397 |
destDir := self currentDirectory. |
6398 |
CBrowser::Browser openIn:destDir pathName |
|
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6399 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
6400 |
"Modified: / 04-10-2011 / 13:41:31 / cg" |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
6401 |
"Modified (comment): / 27-07-2012 / 20:41:40 / cg" |
8256 | 6402 |
! |
6403 |
||
7829 | 6404 |
doOpenExplorer |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6405 |
self currentDirectory asFilename openExplorer |
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6406 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6407 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
7829 | 6408 |
! |
6409 |
||
12473 | 6410 |
doOpenFinder |
6411 |
self currentDirectory asFilename openFinder |
|
6412 |
||
6413 |
"Modified: / 21-07-2012 / 12:28:36 / cg" |
|
6414 |
! |
|
6415 |
||
12811 | 6416 |
doOpenMonticelloBrowser |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6417 |
MCMczReader isNil ifTrue:[ Smalltalk loadPackage:'stx:goodies/monticello']. |
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
6418 |
|
12811 | 6419 |
self withWaitCursorDo:[ |
6420 |
self currentSelectedFiles do:[:fn | |
|
6421 |
|version snapshot| |
|
6422 |
||
6423 |
fn suffix asLowercase = 'mcz' ifTrue:[ |
|
6424 |
version := MCMczReader versionFromFile:fn. |
|
6425 |
snapshot := version snapshot. |
|
6426 |
(Tools::ChangeSetBrowser2 |
|
6427 |
on: snapshot asChangeSet |
|
6428 |
label: version info name) |
|
6429 |
beTwoColumn; |
|
6430 |
targetNamespace:nil; |
|
6431 |
targetPackage:nil; |
|
6432 |
open |
|
6433 |
] |
|
6434 |
] |
|
6435 |
] |
|
6436 |
! |
|
6437 |
||
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6438 |
doOpenSettings |
8168 | 6439 |
self openSettingsDialog |
4317
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6440 |
! |
bf3f150809c2
settings is a new application now and will be inserted under tools in
penk
parents:
4294
diff
changeset
|
6441 |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6442 |
doOpenWithShellCommand |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6443 |
"open using win32-shell" |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6444 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6445 |
|fileName| |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6446 |
|
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6447 |
fileName := self firstSelectedFile. |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6448 |
fileName notNil ifTrue:[ |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6449 |
OperatingSystem |
9405
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6450 |
openApplicationForDocument:fileName pathName |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6451 |
operation:#open |
5b598565288a
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9393
diff
changeset
|
6452 |
] |
11642
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6453 |
|
72cd5c5e2615
changed: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
11591
diff
changeset
|
6454 |
"Modified: / 21-07-2012 / 12:26:10 / cg" |
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6455 |
! |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
6456 |
|
7104 | 6457 |
editMode:aSymbol |
6458 |
self |
|
6459 |
applicationNamed:#FileApplicationNoteBook |
|
6460 |
ifPresentDo:[:appl | |
|
6461 |
|subApp| |
|
6462 |
||
6463 |
subApp := appl selectedApplication. |
|
6464 |
subApp notNil ifTrue:[ |
|
6465 |
^ subApp perform:aSymbol |
|
6466 |
] |
|
6467 |
]. |
|
6468 |
||
6469 |
"Created: / 11-09-2006 / 12:42:08 / cg" |
|
6470 |
! |
|
6471 |
||
6472 |
editModeInsert |
|
6473 |
self editMode:#editModeInsert |
|
6474 |
||
6475 |
"Created: / 11-09-2006 / 12:40:36 / cg" |
|
6476 |
! |
|
6477 |
||
6478 |
editModeInsertAndSelect |
|
6479 |
self editMode:#editModeInsertAndSelect |
|
6480 |
||
6481 |
"Created: / 11-09-2006 / 12:40:45 / cg" |
|
6482 |
! |
|
6483 |
||
6484 |
editModeOverwrite |
|
6485 |
self editMode:#editModeOverwrite |
|
6486 |
||
6487 |
"Modified: / 11-09-2006 / 12:42:26 / cg" |
|
6488 |
! |
|
6489 |
||
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6490 |
fileContentsAsByteArray |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6491 |
|file| |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6492 |
|
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6493 |
file := self firstSelectedFile. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6494 |
file isNil ifTrue:[^ self ]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6495 |
file asFilename fileSize > (1024*1024) ifTrue:[ |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6496 |
file asFilename fileSize > (128*1024*1024) ifTrue:[ |
11889 | 6497 |
Dialog warn:(resources string:'File is too big'). |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6498 |
^ self. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6499 |
]. |
11889 | 6500 |
(Dialog confirm:(resources string:'File is big - proceed ?')) ifFalse:[^ self]. |
8454
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6501 |
]. |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6502 |
file asFilename binaryContentsOfEntireFile inspect |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6503 |
! |
15917af80ff6
changed #fileContentsAsByteArray
Claus Gittinger <cg@exept.de>
parents:
8440
diff
changeset
|
6504 |
|
3892 | 6505 |
fileFileIn |
6506 |
"fileIn the selected file(s)" |
|
6507 |
||
6508 |
self fileFileInLazy:false |
|
6509 |
! |
|
6510 |
||
7324 | 6511 |
fileFileIn:aFilename lazy:lazy |
6512 |
"fileIn a file" |
|
6513 |
||
6514 |
self withActivityIndicationDo:[ |
|
6515 |
self notify:('File in:', aFilename asFilename baseName). |
|
6516 |
self singleFileFileIn:aFilename lazy:lazy. |
|
6517 |
self notify:nil. |
|
6518 |
] |
|
6519 |
||
6520 |
"Created: / 20-09-2006 / 14:28:35 / cg" |
|
6521 |
! |
|
6522 |
||
3892 | 6523 |
fileFileInLazy |
6524 |
"fileIn the selected file(s). Do a quick load (no compilation)" |
|
6525 |
||
6526 |
self fileFileInLazy:true |
|
6527 |
! |
|
6528 |
||
6529 |
fileFileInLazy:lazy |
|
6530 |
"fileIn the selected file(s)" |
|
6531 |
||
7324 | 6532 |
self currentSelectedFiles do:[:fileName | |
6533 |
self fileIn:fileName lazy:lazy |
|
6534 |
]. |
|
6535 |
||
6536 |
"Modified: / 20-09-2006 / 14:29:24 / cg" |
|
3892 | 6537 |
! |
6538 |
||
12497 | 6539 |
fileFileInPackage |
6540 |
"assuming the current directory is a package directory, load it" |
|
6541 |
||
6542 |
|packageDir dir path top packageID| |
|
6543 |
||
6544 |
"/ find a reasonable package-id (walk up until we find stx) |
|
6545 |
path := ''. |
|
6546 |
dir := packageDir := self currentDirectory. |
|
6547 |
||
6548 |
top := (Smalltalk projectDirectoryForPackage:'stx') asFilename. |
|
6549 |
[ (dir / 'stx') = top ] whileFalse:[ |
|
6550 |
path := dir baseName , '/' , path. |
|
6551 |
dir := dir directory. |
|
6552 |
dir isNil ifTrue:[ |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6553 |
Dialog warn:'Could not find a path from "stx" to the current directory.'. |
12497 | 6554 |
"/ should ask the user for a packageID and proceed... |
6555 |
^ self. |
|
6556 |
]. |
|
6557 |
]. |
|
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
6558 |
packageID := path copyButLast:1. |
12497 | 6559 |
Smalltalk loadPackage:packageID fromDirectory:packageDir asAutoloaded:true |
6560 |
! |
|
6561 |
||
3892 | 6562 |
fileFileInToNameSpace |
6563 |
"fileIn the selected file(s)<into a nameSpace" |
|
6564 |
||
6565 |
|ns listOfKnownNameSpaces| |
|
6566 |
||
6567 |
listOfKnownNameSpaces := Set new. |
|
6568 |
NameSpace |
|
6672
478b83a3753a
max size to be shown without dialog
Claus Gittinger <cg@exept.de>
parents:
6671
diff
changeset
|
6569 |
allNameSpaces |
4414 | 6570 |
do:[:eachNameSpace | |
6571 |
listOfKnownNameSpaces add:eachNameSpace name |
|
6572 |
]. |
|
3892 | 6573 |
listOfKnownNameSpaces := listOfKnownNameSpaces asOrderedCollection sort. |
6574 |
||
6575 |
ns := Dialog |
|
4414 | 6576 |
request:'During fileIn, new classes are created in nameSpace:' |
6577 |
initialAnswer:(LastEnforcedNameSpace ? Class nameSpaceQuerySignal query name) |
|
6578 |
list:listOfKnownNameSpaces. |
|
3892 | 6579 |
ns isEmptyOrNil ifTrue:[^ self]. |
6580 |
||
6581 |
LastEnforcedNameSpace := ns. |
|
6582 |
ns := NameSpace name:ns. |
|
6583 |
||
6584 |
Class nameSpaceQuerySignal |
|
4414 | 6585 |
answer:ns |
6586 |
do:[ |
|
6587 |
self fileFileInLazy:false |
|
6588 |
] |
|
3892 | 6589 |
! |
6590 |
||
6591 |
fileFindAllDuplicates |
|
6592 |
"scan directory and all subdirs for duplicate files" |
|
6593 |
||
6594 |
|fileNames dir infoDir filesBySize |
|
6595 |
result info dirPrefix myName stream textBox maxLength directories| |
|
6596 |
||
6597 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6598 |
self withActivityIndicationDo:[ |
4414 | 6599 |
result := Dictionary new. |
6600 |
myName := self class name asString. |
|
6601 |
directories := self currentSelectedDirectories. |
|
6602 |
directories isEmpty ifTrue:[^ self]. |
|
3892 | 6603 |
|
4414 | 6604 |
dir := directories first. |
3892 | 6605 |
"/ self label: myName, '- gathering file names ...'. |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6606 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6607 |
fileNames := dir recursiveDirectoryContents. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6608 |
] on:FileStream openErrorSignal do:[:ex| |
6352 | 6609 |
self warn:(resources stringWithCRs:'Cannot access: %1\(%2)' |
6610 |
with:ex pathName |
|
6611 |
with:ex description). |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6612 |
^ self |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6613 |
]. |
4765 | 6614 |
fileNames := fileNames |
6615 |
collect:[:fn | dir construct:fn] |
|
6616 |
thenSelect:[:fn | fn isDirectory not]. |
|
3892 | 6617 |
|
6618 |
"/ self label:myName , '- gathering sizes ...'. |
|
4414 | 6619 |
infoDir := Dictionary new. |
6620 |
fileNames do:[:fn | |
|
6621 |
infoDir at:fn put:(fn fileSize) |
|
6622 |
]. |
|
6623 |
||
6624 |
"/ for each, get the files size. |
|
6625 |
"/ in a first pass, look for files of the same size and |
|
6626 |
"/ compare them ... |
|
3892 | 6627 |
|
6628 |
"/ self label:myName , '- preselect possible duplicates ...'. |
|
4414 | 6629 |
filesBySize := Dictionary new. |
6630 |
infoDir keysAndValuesDo:[:fn :sz | |
|
6631 |
|entry| |
|
6632 |
||
6633 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6634 |
entry add:fn. |
|
6635 |
]. |
|
6636 |
||
6637 |
"/ any of same size ? |
|
3892 | 6638 |
|
6639 |
"/ self label:myName , '- checking for duplicates ...'. |
|
4414 | 6640 |
filesBySize do:[:entry | |
6641 |
|files| |
|
6642 |
||
6643 |
entry size > 1 ifTrue:[ |
|
6644 |
files := entry asArray. |
|
6645 |
1 to:files size-1 do:[:idx1 | |
|
6646 |
idx1+1 to:files size do:[:idx2 | |
|
6647 |
|fn1 fn2| |
|
6648 |
||
6649 |
fn1 := files at:idx1. |
|
6650 |
fn2 := files at:idx2. |
|
3892 | 6651 |
|
6652 |
"/ self label:myName , '- checking ' , fn1 baseName , ' vs. ' , fn2 baseName , ' ...'. |
|
4414 | 6653 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
6654 |
"/ compare the files |
|
6655 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6656 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4414 | 6657 |
result at:fn1 put:fn2. |
6658 |
] |
|
6659 |
] |
|
6660 |
] |
|
6661 |
] |
|
6662 |
] |
|
6663 |
]. |
|
3892 | 6664 |
|
6665 |
"/ self label:myName , '- sorting ...'. |
|
4414 | 6666 |
dirPrefix := dir pathName. |
6667 |
result := result associations. |
|
6668 |
result := result collect:[:assoc | |
|
6669 |
|f1 f2| |
|
6670 |
||
6671 |
f1 := assoc key name. |
|
6672 |
f2 := assoc value name. |
|
6673 |
(f1 startsWith:dirPrefix) ifTrue:[ |
|
6674 |
f1 := f1 copyFrom:dirPrefix size + 2. |
|
6675 |
]. |
|
6676 |
(f2 startsWith:dirPrefix) ifTrue:[ |
|
6677 |
f2 := f2 copyFrom:dirPrefix size + 2. |
|
6678 |
]. |
|
6679 |
f1 < f2 ifTrue:[ |
|
6680 |
f2 -> f1 |
|
6681 |
] ifFalse:[ |
|
6682 |
f1 -> f2 |
|
6683 |
] |
|
6684 |
]. |
|
6685 |
result sort:[:f1 :f2 | f2 value < f1 value]. |
|
6686 |
||
6687 |
info := OrderedCollection new. |
|
6688 |
result do:[:assoc | |
|
6689 |
info add:(assoc key , ' same as ' , assoc value) |
|
6690 |
]. |
|
6691 |
info isEmpty ifTrue:[ |
|
11889 | 6692 |
Dialog information:(resources string:'No duplicate files found.'). |
5543 | 6693 |
^ self. |
4414 | 6694 |
]. |
3892 | 6695 |
]. |
6696 |
||
6697 |
stream := WriteStream on:''. |
|
11688 | 6698 |
stream nextPutAllLines:info. |
5542 | 6699 |
|
3892 | 6700 |
textBox := TextBox new. |
6701 |
textBox initialText:(stream contents). |
|
5542 | 6702 |
stream close. |
11889 | 6703 |
textBox title:(resources string:'File duplicates in directory: %1' with:dir asString). |
3892 | 6704 |
textBox readOnly:true. |
6705 |
textBox noCancel. |
|
11889 | 6706 |
textBox label:(resources string:'Duplicates in %1' with:dir asString). |
3892 | 6707 |
maxLength := 10. |
6708 |
info do:[: el | |
|
4414 | 6709 |
maxLength := maxLength max:(el size). |
3892 | 6710 |
]. |
6711 |
textBox extent:((maxLength * 5)@(info size * 20)); sizeFixed:false. |
|
5542 | 6712 |
textBox maxExtent:Screen current extent. |
6713 |
textBox openModeless. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6714 |
|
11688 | 6715 |
"Modified: / 27-07-2012 / 09:29:00 / cg" |
3892 | 6716 |
! |
6717 |
||
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6718 |
fileFindDuplicateFile |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6719 |
"scan directory for duplicates of the selected files" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6720 |
|
10306 | 6721 |
|files filesBySize samePerFile stream textBox mustHaveMatches| |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6722 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6723 |
files := self currentSelectedFiles. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6724 |
files isEmpty ifTrue:[^ self]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6725 |
|
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6726 |
self withWaitCursorDo:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6727 |
filesBySize := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6728 |
files do:[:fn | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6729 |
|sz entry| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6730 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6731 |
sz := fn asFilename fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6732 |
(filesBySize at:sz ifAbsentPut:[Set new]) add:fn. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6733 |
]. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6734 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6735 |
samePerFile := Dictionary new. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6736 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6737 |
self currentSelectedDirectories do:[:eachDir | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6738 |
eachDir recursiveDirectoryContentsAsFilenamesDo:[:eachFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6739 |
eachFile isDirectory ifFalse:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6740 |
|sz possibleMatches| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6741 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6742 |
sz := eachFile fileSize. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6743 |
possibleMatches := filesBySize at:sz ifAbsent:nil. |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6744 |
possibleMatches notNil ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6745 |
possibleMatches do:[:eachFileWithSameSize | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6746 |
eachFileWithSameSize ~= eachFile ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6747 |
(eachFileWithSameSize sameContentsAs:eachFile) ifTrue:[ |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6748 |
(samePerFile at:eachFileWithSameSize ifAbsentPut:[Set new]) add:eachFile |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6749 |
] |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6750 |
] |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6751 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6752 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6753 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6754 |
] |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6755 |
]. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6756 |
]. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6757 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6758 |
stream := WriteStream on:''. |
10306 | 6759 |
stream nextPutLine:'Duplicates:'. |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6760 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6761 |
do:[:origFile | |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6762 |
|sameFiles| |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6763 |
|
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
6764 |
sameFiles := samePerFile at:origFile. |
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6765 |
stream nextPutLine:origFile baseName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6766 |
(sameFiles asOrderedCollection collect:[:each | each baseName]) sort do:[:eachSameName | |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6767 |
stream nextPutAll:' '; nextPutLine:eachSameName. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6768 |
] |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6769 |
]. |
10306 | 6770 |
stream nextPutLine:'Files without duplicates:'. |
6771 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6772 |
do:[:origFile | |
|
6773 |
|sameFiles| |
|
6774 |
||
6775 |
sameFiles := samePerFile at:origFile. |
|
6776 |
sameFiles isEmpty ifTrue:[ |
|
6777 |
stream nextPutLine:origFile baseName. |
|
6778 |
]. |
|
6779 |
]. |
|
6780 |
||
6781 |
mustHaveMatches := Dialog request:'Must have for duplicates matching ?:' initialAnswer:(LastMustMatchPattern ? '[a-z][a-z][a-z]_[0-9][0-9][0-9].*'). |
|
6782 |
mustHaveMatches notEmptyOrNil ifTrue:[ |
|
6783 |
LastMustMatchPattern := mustHaveMatches. |
|
6784 |
||
6785 |
stream nextPutLine:'Files without duplicates in xxx_nnn.jpg:'. |
|
6786 |
(samePerFile keys asOrderedCollection sort:[:a :b | a asFilename baseName < b asFilename baseName]) |
|
6787 |
do:[:origFile | |
|
6788 |
|sameFiles| |
|
6789 |
||
6790 |
sameFiles := samePerFile at:origFile. |
|
6791 |
sameFiles notEmpty ifTrue:[ |
|
6792 |
(sameFiles contains:[:file | mustHaveMatches match:file baseName]) ifFalse:[ |
|
6793 |
stream nextPutLine:origFile baseName. |
|
6794 |
] |
|
6795 |
]. |
|
6796 |
]. |
|
6797 |
]. |
|
10304
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6798 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6799 |
textBox := TextBox new. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6800 |
textBox initialText:(stream contents). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6801 |
textBox title:'Files with same contents'. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6802 |
textBox readOnly:true. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6803 |
textBox noCancel. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6804 |
textBox extent:(350@400). |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6805 |
textBox maxExtent:Screen current extent. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6806 |
textBox openModeless. "/ showAtPointer. |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6807 |
|
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6808 |
"Created: / 11-07-2011 / 12:39:44 / cg" |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6809 |
! |
ef51c640ee76
added: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10258
diff
changeset
|
6810 |
|
3892 | 6811 |
fileFindDuplicates |
6812 |
"scan directory for duplicate files" |
|
6813 |
||
8510 | 6814 |
|infoDir filesBySize result info stream textBox maxLength directories allFiles titleStream size| |
6815 |
||
6816 |
directories := self currentSelectedDirectories. |
|
3892 | 6817 |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6818 |
self withActivityIndicationDo:[ |
4355 | 6819 |
result := Dictionary new. |
6820 |
||
6821 |
directories := self currentSelectedDirectories. |
|
6822 |
directories isEmpty ifTrue:[^ self]. |
|
6823 |
||
8510 | 6824 |
allFiles := self allFilesInSelectedDirectoriesForWhich:[:f | true]. |
4355 | 6825 |
|
6826 |
infoDir := Dictionary new. |
|
6827 |
allFiles do:[:fn | |
|
6828 |
infoDir at:fn put:(fn info) |
|
6829 |
]. |
|
6830 |
||
6831 |
"/ for each, get the files size. |
|
6832 |
"/ in a first pass, look for files of the same size and |
|
6833 |
"/ compare them ... |
|
6834 |
||
6835 |
filesBySize := Dictionary new. |
|
6836 |
infoDir keysAndValuesDo:[:fn :info | |
|
6837 |
|sz entry| |
|
6838 |
||
6839 |
sz := info size. |
|
6840 |
entry := filesBySize at:sz ifAbsentPut:[Set new]. |
|
6841 |
entry add:fn. |
|
6842 |
]. |
|
6843 |
||
6844 |
"/ any of same size ? |
|
6845 |
||
6846 |
filesBySize do:[:entry | |
|
6847 |
|files| |
|
6848 |
||
6849 |
entry size > 1 ifTrue:[ |
|
6850 |
files := entry asArray. |
|
6851 |
1 to:files size-1 do:[:idx1 | |
|
6852 |
idx1+1 to:files size do:[:idx2 | |
|
6853 |
|fn1 fn2| |
|
6854 |
||
6855 |
fn1 := files at:idx1. |
|
6856 |
fn2 := files at:idx2. |
|
6857 |
||
6858 |
(result at:fn2 ifAbsent:nil) ~= fn1 ifTrue:[ |
|
6859 |
"/ compare the files |
|
6860 |
(fn1 sameContentsAs:fn2) ifTrue:[ |
|
3892 | 6861 |
"/ Transcript show:'Same: '; show:fn1 baseName; show:' and '; showCR:fn2 baseName. |
4355 | 6862 |
result at:fn1 put:fn2. |
6863 |
] |
|
6864 |
] |
|
6865 |
] |
|
6866 |
] |
|
6867 |
] |
|
6868 |
]. |
|
6869 |
||
6870 |
result := result associations. |
|
6871 |
result := result collect:[:assoc | |
|
6872 |
|f1 f2| |
|
6873 |
||
6874 |
f1 := assoc key asString. |
|
6875 |
f2 := assoc value asString. |
|
6876 |
f1 < f2 ifTrue:[ |
|
6877 |
f2 -> f1 |
|
6878 |
] ifFalse:[ |
|
6879 |
f1 -> f2 |
|
6880 |
] |
|
6881 |
]. |
|
5789 | 6882 |
"/ result sort:[:f1 :f2 | f1 key > f2 key "f2 value < f1 key value"]. |
6883 |
result sort:[:f1 :f2 | " f1 key > f2 key" f2 value < f1 key value]. |
|
4355 | 6884 |
|
6885 |
info := OrderedCollection new. |
|
6886 |
size := self getBestDirectory asString size. |
|
6887 |
result do:[:assoc | |
|
6888 |
|fn1 fn2| |
|
6889 |
||
6890 |
fn1 := assoc key. |
|
6891 |
fn2 := assoc value. |
|
6892 |
size > 1 ifTrue:[ |
|
6893 |
fn1 := ('..', (fn1 copyFrom:(size + 1))). |
|
6894 |
fn2 := ('..', (fn2 copyFrom:(size + 1))). |
|
6895 |
]. |
|
6896 |
(fn1 includes:Character space) ifTrue:[ |
|
6897 |
fn1 := '"' , fn1 , '"' |
|
6898 |
]. |
|
6899 |
(fn2 includes:Character space) ifTrue:[ |
|
6900 |
fn2 := '"' , fn2 , '"' |
|
6901 |
]. |
|
6902 |
info add:(fn1 , ' same as ' , fn2) |
|
6903 |
]. |
|
6904 |
info isEmpty ifTrue:[ |
|
5543 | 6905 |
Dialog information:'No duplicate files found.'. |
6906 |
^ self. |
|
4355 | 6907 |
]. |
3892 | 6908 |
]. |
6909 |
stream := WriteStream on:''. |
|
11688 | 6910 |
stream nextPutAllLines:info. |
6911 |
||
3892 | 6912 |
titleStream := WriteStream on:''. |
12602 | 6913 |
titleStream nextPutAll:'File duplicates in directory'. |
3892 | 6914 |
directories size == 1 ifTrue:[ |
12602 | 6915 |
titleStream nextPutAll:'y: '; nextPutAll: directories first asString. |
3892 | 6916 |
] ifFalse:[ |
4535 | 6917 |
titleStream nextPutLine:'ies: '. |
4355 | 6918 |
directories do:[:dir| |
6919 |
size > 1 ifTrue:[ |
|
6920 |
titleStream nextPutAll:'..'. |
|
4535 | 6921 |
titleStream nextPutLine:((dir asString) copyFrom:(size + 1)). |
4355 | 6922 |
] ifFalse:[ |
4535 | 6923 |
titleStream nextPutLine:(dir asString). |
4355 | 6924 |
]. |
6925 |
] |
|
3892 | 6926 |
]. |
5543 | 6927 |
|
3892 | 6928 |
textBox := TextBox new. |
6929 |
textBox initialText:(stream contents). |
|
6930 |
textBox title:(titleStream contents). |
|
6931 |
textBox readOnly:true. |
|
6932 |
textBox noCancel. |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
6933 |
stream := WriteStream on:'Duplicates in '. |
4170 | 6934 |
directories do:[ :aDirectory | |
4355 | 6935 |
stream nextPutAll:aDirectory baseName. |
6936 |
stream space. |
|
4050 | 6937 |
]. |
4170 | 6938 |
textBox label:stream contents. |
3892 | 6939 |
maxLength := 10. |
6940 |
info do:[: el | |
|
4355 | 6941 |
maxLength := maxLength max:(el size). |
3892 | 6942 |
]. |
5092 | 6943 |
textBox extent:((maxLength * 5)@((info size max:40)* 10)). |
6944 |
textBox maxExtent:Screen current extent. |
|
4355 | 6945 |
textBox openModeless. "/ showAtPointer. |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
6946 |
|
11688 | 6947 |
"Modified: / 27-07-2012 / 09:29:14 / cg" |
3892 | 6948 |
! |
6949 |
||
6950 |
fileFindFile |
|
5961 | 6951 |
|filename| |
6952 |
||
6953 |
filename := self firstSelectedFileName. |
|
6954 |
filename isNil ifTrue:[ |
|
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
6955 |
filename := Filename homeDirectory. |
3892 | 6956 |
]. |
4101 | 6957 |
FindFileApplication openOnFileName:filename for:self. |
3892 | 6958 |
! |
6959 |
||
8510 | 6960 |
fileFindSimilarImages |
6961 |
"scan directory for similar image files" |
|
6962 |
||
8512 | 6963 |
|result stream textBox directories imageFiles histogramsV histogramsH |
6964 |
similarV similarH similar alreadyPrinted| |
|
8510 | 6965 |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
6966 |
self withWaitCursorDo:[ |
8510 | 6967 |
self withActivityIndicationDo:[ |
6968 |
result := Dictionary new. |
|
6969 |
||
6970 |
directories := self currentSelectedDirectories. |
|
6971 |
directories isEmpty ifTrue:[^ self]. |
|
6972 |
||
6973 |
imageFiles := self allFilesInSelectedDirectoriesForWhich:[:f | f mimeTypeFromName isImage]. |
|
8511 | 6974 |
"/ imageFiles := imageFiles select:[:f | f baseName startsWith:'foo']. |
6975 |
imageFiles sort:[:a :b | a pathName < b pathName]. |
|
6976 |
||
8510 | 6977 |
"/ for each, get the color histogram |
6978 |
histogramsV := Dictionary new. |
|
6979 |
histogramsH := Dictionary new. |
|
6980 |
imageFiles do:[:fn | |
|
6981 |
|hist image| |
|
6982 |
||
6983 |
image := Image fromFile:fn. |
|
6984 |
Transcript showCR:'generating histogram for ',fn baseName. |
|
6985 |
hist := ImageColorHistogram new forImage:image. |
|
6986 |
histogramsV at:fn put:(hist histogramVectorV). |
|
6987 |
histogramsH at:fn put:(hist histogramVectorH). |
|
6988 |
]. |
|
6989 |
||
6990 |
similarH := Dictionary new. |
|
6991 |
similarV := Dictionary new. |
|
6992 |
similar := Dictionary new. |
|
6993 |
||
8512 | 6994 |
(self firstSelectedFile notNil |
6995 |
ifTrue:[ Array with:self firstSelectedFile ] |
|
6996 |
ifFalse:[ imageFiles ]) |
|
6997 |
do:[:eachFile1 | |
|
8510 | 6998 |
|setOfSimilar distancesV distancesH| |
6999 |
||
7000 |
distancesV := OrderedCollection new. |
|
7001 |
distancesH := OrderedCollection new. |
|
7002 |
setOfSimilar := OrderedCollection new. |
|
7003 |
||
7004 |
imageFiles do:[:eachFile2 | |
|
7005 |
|v1 v2 dV dH| |
|
7006 |
||
7007 |
eachFile1 ~= eachFile2 ifTrue:[ |
|
7008 |
v1 := histogramsV at:eachFile1. |
|
7009 |
v2 := histogramsV at:eachFile2. |
|
7010 |
dV := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7011 |
distancesV add:(eachFile2 -> dV). |
|
7012 |
v1 := histogramsH at:eachFile1. |
|
7013 |
v2 := histogramsH at:eachFile2. |
|
7014 |
dH := ImageColorHistogram distanceFrom:v1 to:v2. |
|
7015 |
distancesH add:(eachFile2 -> dH). |
|
7016 |
(dV < 10000 and:[dH < 10000]) ifTrue:[ |
|
8512 | 7017 |
setOfSimilar add:eachFile2->(dV + dH). |
8510 | 7018 |
]. |
7019 |
] |
|
7020 |
]. |
|
7021 |
distancesV sort:[:a1 :a2 | a1 value < a2 value]. |
|
7022 |
distancesH sort:[:a1 :a2 | a1 value < a2 value]. |
|
7023 |
similarV at:eachFile1 put:distancesV. |
|
7024 |
similarH at:eachFile1 put:distancesH. |
|
7025 |
setOfSimilar notEmpty ifTrue:[ similar at:eachFile1 put:setOfSimilar ]. |
|
7026 |
]. |
|
7027 |
||
7028 |
similar isEmpty ifTrue:[ |
|
7029 |
Dialog information:'No similarities found.'. |
|
7030 |
^ self. |
|
7031 |
]. |
|
7032 |
]. |
|
7033 |
||
7034 |
stream := WriteStream on:''. |
|
8512 | 7035 |
alreadyPrinted := Set new. |
7036 |
||
7037 |
imageFiles do:[:eachFile | |
|
7038 |
|eachSet| |
|
7039 |
||
7040 |
(alreadyPrinted includes:eachFile) ifFalse:[ |
|
7041 |
eachSet := similar at:eachFile ifAbsent:nil. |
|
7042 |
eachSet notNil ifTrue:[ |
|
7043 |
stream nextPutLine:eachFile pathName. |
|
7044 |
eachSet do:[:info | |
|
7045 |
|fn2 dist| |
|
7046 |
||
7047 |
fn2 := info key. |
|
7048 |
dist := info value. |
|
7049 |
stream nextPutAll:' '. |
|
7050 |
stream nextPutAll:fn2 pathName. |
|
7051 |
stream nextPutLine:' (',dist printString,')'. |
|
7052 |
alreadyPrinted add:fn2. |
|
7053 |
]. |
|
7054 |
stream cr. |
|
7055 |
]. |
|
8510 | 7056 |
]. |
7057 |
]. |
|
8524
cac6b19eae23
changed #fileFindSimilarImages
Claus Gittinger <cg@exept.de>
parents:
8512
diff
changeset
|
7058 |
]. |
8510 | 7059 |
|
7060 |
textBox := TextBox new. |
|
7061 |
textBox initialText:(stream contents). |
|
7062 |
textBox title:'File similarities:'. |
|
7063 |
textBox readOnly:true. |
|
7064 |
textBox noCancel. |
|
7065 |
||
7066 |
textBox label:'File similarities'. |
|
7067 |
textBox extent:(400@((similar size max:40)* 10)). |
|
7068 |
textBox maxExtent:Screen current extent. |
|
7069 |
textBox openModeless. "/ showAtPointer. |
|
7070 |
||
7071 |
"Modified: / 25-07-2006 / 09:07:25 / cg" |
|
7072 |
! |
|
7073 |
||
4618 | 7074 |
fileHexDump |
7075 |
||
7076 |
| file item| |
|
7077 |
||
7078 |
file := self firstSelectedFile. |
|
7079 |
file notNil ifTrue:[ |
|
7080 |
item := DirectoryContentsBrowser itemClass fileName:file. |
|
5009 | 7081 |
self |
7082 |
applicationNamed:#FileApplicationNoteBook |
|
7083 |
ifPresentDo:[:appl | appl openTextEditorWithHexPresentationOn:item]. |
|
4618 | 7084 |
]. |
7085 |
! |
|
7086 |
||
7324 | 7087 |
fileIn:aFilename |
7088 |
"fileIn a file" |
|
7089 |
||
7090 |
self fileIn:aFilename lazy:false |
|
7091 |
||
7092 |
"Created: / 20-09-2006 / 14:30:06 / cg" |
|
7093 |
! |
|
7094 |
||
7095 |
fileIn:aFilename lazy:lazy |
|
7096 |
"fileIn a file" |
|
7097 |
||
7098 |
self withActivityIndicationDo:[ |
|
7099 |
self notify:('File in:', aFilename asFilename baseName). |
|
7100 |
self singleFileFileIn:aFilename lazy:lazy. |
|
7101 |
self notify:nil. |
|
7102 |
] |
|
7103 |
||
7104 |
"Created: / 20-09-2006 / 14:29:21 / cg" |
|
7105 |
! |
|
7106 |
||
4930 | 7107 |
filterSelectedFiles:whichFilter |
7108 |
|selectedFiles numFiles msg filterBlock| |
|
7109 |
||
7560 | 7110 |
selectedFiles := self currentSelectedObjects. |
4930 | 7111 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
7112 |
||
7113 |
msg := 'Replace contents of file ''%2'' with output of %3-filter ?'. |
|
7114 |
numFiles > 1 ifTrue:[ |
|
7115 |
msg := 'Replace contents of %1 files with output of %3-filter ?'. |
|
7116 |
]. |
|
7117 |
||
7118 |
(Dialog |
|
6352 | 7119 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold with:whichFilter) |
4930 | 7120 |
initialAnswer:false |
7121 |
) ifFalse:[ |
|
7122 |
^ self |
|
7123 |
]. |
|
7124 |
||
7125 |
whichFilter == #rot13 ifTrue:[ |
|
7126 |
filterBlock := [:charIn | charIn rot13 ]. |
|
7127 |
]. |
|
7128 |
"/ add more here... |
|
7129 |
||
7130 |
filterBlock isNil ifTrue:[ |
|
7131 |
self information:'No such filter: ' , whichFilter. |
|
7132 |
^ self. |
|
7133 |
]. |
|
7134 |
||
7135 |
selectedFiles do:[:fileName | |
|
7136 |
|s| |
|
7137 |
||
7138 |
self notify:('Processing:', fileName baseName). |
|
7139 |
fileName isDirectory ifFalse:[ |
|
7140 |
[ |
|
7141 |
|inFile outFile in out| |
|
7142 |
||
7143 |
inFile := fileName asFilename. |
|
7144 |
outFile := (fileName pathName , '.filter') asFilename. |
|
7145 |
||
7146 |
[ |
|
7147 |
|charIn charOut| |
|
7148 |
||
7149 |
in := inFile readStream. |
|
7150 |
out := outFile writeStream. |
|
7151 |
[in atEnd] whileFalse:[ |
|
7152 |
charIn := in next. |
|
7153 |
charOut := filterBlock value:charIn. |
|
7154 |
out nextPut:charOut. |
|
7155 |
]. |
|
7156 |
outFile renameTo:inFile. |
|
7157 |
] ensure:[ |
|
7158 |
out notNil ifTrue:[ out close ]. |
|
7159 |
in notNil ifTrue:[ in close ]. |
|
7160 |
outFile delete. |
|
7161 |
] |
|
7162 |
] on:FileStream openErrorSignal do:[:ex| |
|
7163 |
self warn:('Cannot process "%1".' bindWith:fileName baseName allBold). |
|
7164 |
]. |
|
7165 |
] |
|
7166 |
]. |
|
6190 | 7167 |
self notify:nil. |
7560 | 7168 |
|
7169 |
"Modified: / 04-12-2006 / 13:14:48 / cg" |
|
4930 | 7170 |
! |
7171 |
||
9784 | 7172 |
forEachParsedXmlFileDo:aBlock |
7173 |
"parse all selected XML files, for each dom-tree, evaluate aBlock" |
|
7174 |
||
7175 |
self withActivityIndicationDo:[ |
|
7176 |
| selectedFiles xmlDocument | |
|
7177 |
||
7178 |
selectedFiles:= self currentSelectedFiles. |
|
7179 |
selectedFiles do:[:fileName | |
|
7180 |
XML::XMLSignal handle:[:ex | |
|
7181 |
Dialog information:('Error while reading XML:\ %1' bindWith:ex description) withCRs. |
|
7182 |
^ self. |
|
7183 |
] do:[ |
|
7184 |
|s d magic encoder document| |
|
7185 |
||
7186 |
s := fileName asFilename readStream. |
|
7187 |
s binary. |
|
7188 |
magic := (s next:2). |
|
7189 |
magic = #[254 255] ifTrue:[ |
|
7190 |
"/ UTF16BE |
|
7191 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16be. |
|
7192 |
] ifFalse:[ |
|
7193 |
magic = #[255 254] ifTrue:[ |
|
7194 |
"/ UTF16LE |
|
7195 |
document := CharacterEncoder decodeString:(s upToEnd) from:#utf16le. |
|
7196 |
]. |
|
7197 |
]. |
|
7198 |
s close. |
|
7199 |
||
7200 |
document notNil ifTrue:[ |
|
7201 |
xmlDocument := XML::XMLParser |
|
7202 |
processDocumentString:document |
|
7203 |
beforeScanDo:[:parse| parse validate:false]. |
|
7204 |
] ifFalse:[ |
|
7205 |
xmlDocument := XML::XMLParser |
|
7206 |
processDocumentInFilename:fileName |
|
7207 |
beforeScanDo:[:parse| parse validate:false]. |
|
7208 |
] |
|
7209 |
]. |
|
7210 |
aBlock value:xmlDocument. |
|
7211 |
]. |
|
7212 |
] |
|
7213 |
||
7214 |
"Created: / 17-02-2011 / 13:58:21 / cg" |
|
7215 |
! |
|
7216 |
||
8832 | 7217 |
forEachSelectedFileIgnoringDirectories:ignoreDirs do:aBlock |
7218 |
|numItems path files| |
|
7219 |
||
7220 |
files := self currentSelectedFiles. |
|
7221 |
||
7222 |
(numItems := files size) > 2 ifTrue:[ |
|
7223 |
(self |
|
7224 |
confirm:(resources string:'Open for each of the %1 items ?' |
|
7225 |
with:numItems)) ifFalse:[^ self]. |
|
7226 |
]. |
|
7227 |
||
7228 |
self withActivityIndicationDo:[ |
|
7229 |
files do:[:fileName | |
|
7230 |
(ignoreDirs not or:[fileName isDirectory not]) ifTrue:[ |
|
7231 |
fileName isAbsolute ifTrue:[ |
|
7232 |
path := fileName getName. |
|
7233 |
] ifFalse:[ |
|
7234 |
path := fileName pathName. |
|
7235 |
]. |
|
7236 |
aBlock value:path |
|
7237 |
] |
|
7238 |
]. |
|
7239 |
]. |
|
7240 |
! |
|
7241 |
||
8648
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7242 |
generateDetachedSignaturesForSelectedFiles |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7243 |
"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
|
7244 |
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
|
7245 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7246 |
self withActivityIndicationDo:[ |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7247 |
self currentSelectedFiles do:[:fn | |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7248 |
|data hash signature signatureFile| |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7249 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7250 |
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
|
7251 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7252 |
data := fn contentsAsString. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7253 |
hash := SHA1Stream hashValueOf:data. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7254 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7255 |
signature := Expecco::KeyFileGenerator new signExpeccoCode:hash. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7256 |
|
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7257 |
signatureFile := fn addSuffix:'sig'. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7258 |
signatureFile contents:signature. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7259 |
]. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7260 |
self notify:nil. |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7261 |
] |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7262 |
! |
e8a98d146af2
Generate both integrated and detached PKCS#7 signatures
Stefan Vogel <sv@exept.de>
parents:
8646
diff
changeset
|
7263 |
|
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7264 |
generateSignaturesForSelectedFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7265 |
"generate signed pkcs7 files from the contents of the selected files" |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7266 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7267 |
self withActivityIndicationDo:[ |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7268 |
self currentSelectedFiles do:[:fn | |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7269 |
|pkcs7SignedData signatureFilename| |
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7270 |
|
8646 | 7271 |
self notify:'Generating signed file from: ', (fn baseName), '...'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7272 |
|
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7273 |
pkcs7SignedData := Expecco::KeyFileGenerator new signExpeccoCode:fn contentsOfEntireFile. |
12094 | 7274 |
signatureFilename := fn withSuffix:'expeccoPatch'. |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
7275 |
signatureFilename contents:pkcs7SignedData. |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7276 |
]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7277 |
self notify:nil. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7278 |
] |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7279 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
7280 |
|
9784 | 7281 |
inspectXmlFile |
7282 |
"Show an XML file - either in an XMLInspector or fall back to |
|
7283 |
a plain inspector on the XML tree" |
|
7284 |
||
7285 |
self forEachParsedXmlFileDo:[:xmlDocument | |
|
7286 |
XML::XMLInspector notNil ifTrue:[ |
|
7287 |
XML::XMLInspector openOn:xmlDocument. |
|
7288 |
] ifFalse:[ |
|
7289 |
"fall back..." |
|
7290 |
xmlDocument inspect. |
|
7291 |
] |
|
7292 |
]. |
|
7293 |
||
7294 |
"Modified: / 17-02-2011 / 13:58:16 / cg" |
|
7295 |
! |
|
7296 |
||
3892 | 7297 |
installAllAsAutoloaded |
7298 |
"install all classes found here as autoloaded classes" |
|
7299 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7300 |
self installAllAsAutoloadedRecursive:false |
3892 | 7301 |
! |
7302 |
||
6521 | 7303 |
installAllAsAutoloadedRecursive |
7304 |
"install all classes found here and in subdirectories as autoloaded classes" |
|
7305 |
||
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7306 |
self installAllAsAutoloadedRecursive:true |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7307 |
! |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7308 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7309 |
installAllAsAutoloadedRecursive:aBoolean |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7310 |
"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
|
7311 |
|
6521 | 7312 |
[ |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7313 |
|installAction| |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7314 |
|
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7315 |
installAction := |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7316 |
[:fn | |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7317 |
(fn suffix = 'st') ifTrue:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7318 |
self notify:('Install as autoloaded: ', fn baseName). |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7319 |
self installAsAutoloaded:fn. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7320 |
] |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7321 |
]. |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7322 |
|
6521 | 7323 |
self withActivityIndicationDo:[ |
6725 | 7324 |
self currentSelectedDirectories do:[:dir| |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7325 |
aBoolean ifTrue:[ |
9675
704831da3132
changed: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9674
diff
changeset
|
7326 |
dir recursiveDirectoryContentsAsFilenamesDo:installAction |
9674
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7327 |
] ifFalse:[ |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7328 |
dir directoryContentsAsFilenamesDo:installAction |
3c3c1ef9974b
added: #installAllAsAutoloadedRecursive:
Claus Gittinger <cg@exept.de>
parents:
9649
diff
changeset
|
7329 |
]. |
6521 | 7330 |
]. |
7331 |
self notify:nil. |
|
7332 |
] |
|
7333 |
] fork. |
|
7334 |
! |
|
7335 |
||
3892 | 7336 |
installAsAutoloaded:aFilename |
7337 |
"install aFilename as autoloaded class" |
|
7338 |
||
9455 | 7339 |
|chunks filename| |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7340 |
|
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7341 |
filename := aFilename asFilename. |
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7342 |
|
12396 | 7343 |
ChangeSet::InvalidChangeChunkError handle:[:ex | |
7344 |
^ self |
|
7345 |
] do:[ |
|
7346 |
filename readingFileDo:[:s| |
|
7347 |
chunks := ChangeSet fromStream:s while:[:chunk | chunk isMethodChange not]. |
|
7348 |
]. |
|
7349 |
]. |
|
7350 |
||
3892 | 7351 |
chunks |
4414 | 7352 |
select:[:eachChunk | eachChunk isClassDefinitionChange] |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7353 |
thenDo:[:eachClassChunk | |
8039
732cbc4ea214
keep absolute-pathname including suffix as classFilename
Claus Gittinger <cg@exept.de>
parents:
8013
diff
changeset
|
7354 |
eachClassChunk installAsAutoloadedClassIfPublicWithFilename:filename asAbsoluteFilename "withoutSuffix" name "baseName" |
5971
af337e1a857f
Use #setFilename:forClass:package: to define an abbreviation
Stefan Vogel <sv@exept.de>
parents:
5967
diff
changeset
|
7355 |
]. |
3892 | 7356 |
! |
7357 |
||
4558 | 7358 |
joinSelectedFiles |
6264 | 7359 |
|selectedFiles numFiles msg outFileName outFile outStream| |
4558 | 7360 |
|
7560 | 7361 |
selectedFiles := self currentSelectedObjects. |
4558 | 7362 |
(numFiles := selectedFiles size) <= 1 ifTrue:[^ self]. |
7363 |
||
7364 |
msg := 'Join each of the %1 files into single file named:\\Attention: order in which files were selected is relevant here !!'. |
|
6352 | 7365 |
outFileName := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 7366 |
outFileName isEmptyOrNil ifTrue:[^ self]. |
7367 |
outFile := selectedFiles first directory construct:outFileName. |
|
4558 | 7368 |
|
7369 |
outStream := outFile writeStream. |
|
7370 |
||
7371 |
selectedFiles do:[:fileName | |
|
7372 |
|inStream| |
|
7373 |
||
7374 |
self notify:('Adding:', fileName baseName). |
|
7375 |
inStream := fileName readStream. |
|
7376 |
inStream copyToEndInto:outStream. |
|
7377 |
inStream close. |
|
7378 |
]. |
|
7379 |
outStream close. |
|
6190 | 7380 |
self notify:nil. |
7560 | 7381 |
|
7382 |
"Modified: / 04-12-2006 / 13:15:10 / cg" |
|
4558 | 7383 |
! |
7384 |
||
6292 | 7385 |
loadImageThenDo:aBlock |
3892 | 7386 |
|img path files| |
7387 |
||
3982 | 7388 |
files := self currentSelectedFiles. |
3892 | 7389 |
files isEmpty ifTrue:[ ^ self]. |
7390 |
files do:[:fileName | |
|
4414 | 7391 |
path := fileName. |
7392 |
path isDirectory ifFalse:[ |
|
7393 |
img := Image fromFile:(path pathName). |
|
7394 |
img notNil ifTrue:[ |
|
6292 | 7395 |
aBlock value:img |
4414 | 7396 |
] ifFalse:[ |
6292 | 7397 |
Dialog warn:'Unknown format: ' , fileName asString |
4414 | 7398 |
] |
7399 |
] |
|
3892 | 7400 |
]. |
7401 |
! |
|
7402 |
||
7403 |
openASN1Browser |
|
7404 |
||
7405 |
self openTool:OSI::ASN1Browser |
|
7406 |
! |
|
7407 |
||
7408 |
openAppletViewer |
|
7409 |
|numItems files| |
|
7410 |
||
3982 | 7411 |
files := self currentSelectedFiles. |
3892 | 7412 |
(numItems := files size) > 2 ifTrue:[ |
4414 | 7413 |
(self |
7414 |
confirm:(resources string:'open for each of the %1 items ?' |
|
7415 |
with:numItems)) ifFalse:[^ self]. |
|
3892 | 7416 |
]. |
7417 |
||
7418 |
Java startupJavaSystem. |
|
7419 |
"/ Java markAllClassesUninitialized. |
|
7420 |
"/ Java initAllStaticFields. |
|
7421 |
"/ Java initAllClasses. |
|
7422 |
||
7423 |
files do:[:fileName | |
|
4414 | 7424 |
|p path| |
7425 |
||
7426 |
path := fileName. |
|
7427 |
path isDirectory ifFalse:[ |
|
7428 |
p := Java |
|
7429 |
javaProcessForMainOf:(Java classForName:'sun.applet.AppletViewer') |
|
7430 |
argumentString:path pathName. |
|
7431 |
p resume. |
|
7432 |
] |
|
3892 | 7433 |
]. |
7434 |
! |
|
7435 |
||
7436 |
openCBrowser |
|
6031 | 7437 |
|dir files| |
5880 | 7438 |
|
7439 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7440 |
dir isNil ifTrue:[ ^ self]. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7441 |
self withActivityIndicationDo:[ |
7560 | 7442 |
files := self currentSelectedObjects. |
6031 | 7443 |
files notEmptyOrNil ifTrue:[ |
7444 |
CBrowser::Browser openOn:files first. |
|
7445 |
] ifFalse:[ |
|
7446 |
CBrowser::Browser openIn:dir. |
|
7447 |
] |
|
3892 | 7448 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7449 |
|
7560 | 7450 |
"Modified: / 04-12-2006 / 13:15:19 / cg" |
3892 | 7451 |
! |
7452 |
||
4230 | 7453 |
openChangeSetBrowser |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7454 |
"open a changeSet browser on the selected file(s)" |
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7455 |
|
4230 | 7456 |
self |
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7457 |
openTool:(UserPreferences current changeSetBrowserClass) |
4230 | 7458 |
with:#openOnFile: |
7459 |
ignoreDirectories:true |
|
11712
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7460 |
|
ed8877d9356b
comment/format in: #doOpenCBrowser
Claus Gittinger <cg@exept.de>
parents:
11688
diff
changeset
|
7461 |
"Modified (comment): / 27-07-2012 / 20:42:55 / cg" |
4230 | 7462 |
! |
7463 |
||
3892 | 7464 |
openChangesBrowser |
7465 |
"open a change browser on the selected file(s)" |
|
7466 |
||
7467 |
self openTool:(UserPreferences current changesBrowserClass) |
|
7468 |
! |
|
7469 |
||
7470 |
openDiffView |
|
7471 |
"open a diff-view" |
|
7472 |
||
6388 | 7473 |
|name1 name2 text1 text2 d err nm l1 files title |
12850 | 7474 |
defaultName defaultDir sameContents msg| |
6460 | 7475 |
|
7476 |
files := self currentSelectedObjects. |
|
3892 | 7477 |
files isEmpty ifTrue:[ |
6460 | 7478 |
Dialog warn:(resources string:'You have to select a file first'). |
4414 | 7479 |
^ self. |
3892 | 7480 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7481 |
|
3892 | 7482 |
(files size == 2) ifTrue:[ |
4414 | 7483 |
name1 := files last. |
7484 |
name2 := files first. |
|
3892 | 7485 |
] ifFalse:[ |
4414 | 7486 |
LastFileDiffFile notNil ifTrue:[ |
11052 | 7487 |
LastFileDiffFile exists ifTrue:[ |
7488 |
name1 := LastFileDiffFile. |
|
7489 |
]. |
|
7490 |
"/ | directory | |
|
7491 |
"/ directory := self currentDirectory. |
|
7492 |
"/ directory notNil ifTrue:[ |
|
7493 |
"/ lastFile := directory asFilename construct:(LastFileDiffFile baseName). |
|
7494 |
"/ (lastFile exists and:[lastFile isReadable]) ifTrue:[ |
|
7495 |
"/ name1 := lastFile. |
|
7496 |
"/ ] |
|
7497 |
"/ ] |
|
4414 | 7498 |
]. |
7499 |
name2 := files first. |
|
6460 | 7500 |
title := resources string:'Show differences between "%1" and:' with:name2 baseName. |
4414 | 7501 |
defaultName := name1 notNil ifTrue:[name1 baseName] ifFalse:[nil]. |
11052 | 7502 |
defaultDir := name1 notNil ifTrue:[name1 directory] ifFalse:[self currentDirectory]. |
4414 | 7503 |
name1 := DialogBox |
7504 |
requestFileName:title |
|
7505 |
default:defaultName |
|
6460 | 7506 |
ok:(resources string:'OK') |
7507 |
abort:(resources string:'Compare against File List') |
|
4414 | 7508 |
pattern:'*' |
11052 | 7509 |
fromDirectory:defaultDir. |
3892 | 7510 |
]. |
7511 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7512 |
self withWaitCursorDo:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7513 |
(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
|
7514 |
text1 := self getAllFilesAsStrings asStringCollection withTabs. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7515 |
text1 := text1 collect:[:l | l isNil ifTrue:[' '] ifFalse:[l]]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7516 |
name1 := nil. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7517 |
l1 := 'browser contents' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7518 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7519 |
name1 := name1 asFilename. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7520 |
LastFileDiffFile := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7521 |
name1 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7522 |
nm := name1. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7523 |
name1 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7524 |
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
|
7525 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7526 |
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
|
7527 |
]. |
4414 | 7528 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7529 |
l1 := name1 pathName |
4414 | 7530 |
]. |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7531 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7532 |
err isNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7533 |
name2 isReadable ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7534 |
nm := name2. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7535 |
name2 exists ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7536 |
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
|
7537 |
] ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7538 |
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
|
7539 |
]. |
4414 | 7540 |
]. |
7541 |
]. |
|
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7542 |
err notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7543 |
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
|
7544 |
^ self |
6176 | 7545 |
]. |
7546 |
||
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7547 |
self withActivityIndicationDo:[ |
11494 | 7548 |
((name1 notNil and:[name1 fileSize > (1024*1024*32)]) |
7549 |
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
|
7550 |
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
|
7551 |
ProgressIndicator |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7552 |
displayBusyIndicator:'Comparing...' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7553 |
at:(Screen default center) |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7554 |
during:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7555 |
sameContents := (name1 sameContentsAs:name2). |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7556 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7557 |
sameContents ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7558 |
self information:'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7559 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7560 |
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
|
7561 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7562 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7563 |
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
|
7564 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7565 |
^ self. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7566 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7567 |
|
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7568 |
name1 notNil ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7569 |
name1 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7570 |
text1 := name1 directoryContents asString. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7571 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7572 |
text1 := name1 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7573 |
] |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7574 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7575 |
name2 isDirectory ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7576 |
text2 := name2 directoryContents asString. |
6460 | 7577 |
] ifFalse:[ |
8287
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7578 |
text2 := name2 contents. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7579 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7580 |
text1 = text2 ifTrue:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7581 |
(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
|
7582 |
msg := 'Same filename lists.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7583 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7584 |
msg := 'Same contents.' |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7585 |
]. |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7586 |
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
|
7587 |
] ifFalse:[ |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7588 |
d := DiffTextView |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7589 |
openOn:text1 label:l1 |
df5c80b5bbfb
show busy cursor while computing the diff of two files
Claus Gittinger <cg@exept.de>
parents:
8261
diff
changeset
|
7590 |
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
|
7591 |
d topView label:(resources string:'File Differences'). |
6460 | 7592 |
] |
4414 | 7593 |
] |
3892 | 7594 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7595 |
|
11494 | 7596 |
"Modified: / 03-05-2012 / 08:03:16 / cg" |
3892 | 7597 |
! |
7598 |
||
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7599 |
openDirectoryDiffView |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7600 |
"open a directory diff-view" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7601 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7602 |
|name1 name2 files| |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7603 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7604 |
files := self currentSelectedObjects. |
11108 | 7605 |
files notEmpty ifTrue:[ |
7606 |
name1 := files first asFilename. |
|
7607 |
name1 asFilename isDirectory ifFalse:[ |
|
7608 |
name1 := name1 directory |
|
7609 |
]. |
|
7610 |
]. |
|
7611 |
||
7612 |
(files size == 2) ifTrue:[ |
|
7613 |
name2 := files second. |
|
7614 |
] ifFalse:[ |
|
7615 |
(files size ~= 1) ifTrue:[ |
|
7616 |
Dialog warn:(resources string:'Please select one or two directories.'). |
|
7617 |
^ self. |
|
7618 |
]. |
|
7619 |
name2 := Dialog |
|
7620 |
requestDirectoryName:(resources |
|
7621 |
string:'Recursive compare "%1" with folder:' |
|
7622 |
with:name1 asFilename baseName) |
|
7623 |
default:(LastFileDiffDirectory ? self currentDirectory). |
|
7624 |
name2 isEmptyOrNil ifTrue:[^ self]. |
|
7625 |
LastFileDiffDirectory := name2. |
|
7626 |
]. |
|
7627 |
name2 := name2 asFilename. |
|
7628 |
||
7629 |
name2 asFilename isDirectory ifFalse:[ |
|
7630 |
name2 := name2 directory |
|
7631 |
]. |
|
7632 |
||
7633 |
self |
|
7634 |
applicationNamed:#FileApplicationNoteBook |
|
7635 |
ifPresentDo:[:appl | ^ appl openCompareDirectory:name1 with:name2]. |
|
9496
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7636 |
|
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7637 |
"Created: / 20-05-2010 / 15:01:17 / cg" |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7638 |
! |
0cfc347edb59
added: #openDirectoryDiffView
Claus Gittinger <cg@exept.de>
parents:
9493
diff
changeset
|
7639 |
|
3892 | 7640 |
openEditor |
7641 |
self openTool:EditTextView |
|
7642 |
! |
|
7643 |
||
4957 | 7644 |
openGV |
7645 |
self openOSCommandWithFiles:'gv' |
|
7646 |
! |
|
7647 |
||
3892 | 7648 |
openHTMLReader |
7649 |
||
7650 |
self openTool:HTMLDocumentView ignoreDirectories:false |
|
7651 |
! |
|
7652 |
||
7653 |
openImageEditor |
|
6292 | 7654 |
[ |
7655 |
self loadImageThenDo:[:img | img edit] |
|
7656 |
] fork |
|
3892 | 7657 |
! |
7658 |
||
7659 |
openImageInspector |
|
6292 | 7660 |
[ |
7661 |
self loadImageThenDo:[:img | img inspect] |
|
7662 |
] fork |
|
3892 | 7663 |
! |
7664 |
||
7665 |
openImagePreview |
|
5778 | 7666 |
[ |
7667 |
self |
|
6292 | 7668 |
loadImageThenDo: |
5778 | 7669 |
[:img | |
7670 |
|i top viewer| |
|
7671 |
||
7672 |
top := StandardSystemView new. |
|
7673 |
||
7674 |
viewer := ImageView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
7675 |
i := img. |
|
7676 |
top extent:200@200. |
|
7677 |
top label:(img fileName asFilename directory baseName , Filename separator , img fileName asFilename baseName). |
|
7678 |
top openAndWait. |
|
7679 |
||
7680 |
(i width > 200 or:[i height > 200]) ifTrue:[ |
|
7681 |
i := i magnifiedPreservingRatioTo:200@200. |
|
7682 |
]. |
|
7683 |
viewer image:i. |
|
7684 |
]. |
|
3892 | 7685 |
] fork |
7686 |
! |
|
7687 |
||
7688 |
openMP3Player |
|
7689 |
|file| |
|
7690 |
||
3982 | 7691 |
file := self currentSelectedFiles. |
3892 | 7692 |
(file isEmpty) ifTrue:[ |
4414 | 7693 |
^ self. |
3892 | 7694 |
]. |
7695 |
file := file first. |
|
7696 |
(MP3PlayerApplication ? SaugFix::MP3PlayerApplication) playSong:file. |
|
7697 |
! |
|
7698 |
||
4957 | 7699 |
openOSCommandWithFiles:command |
7700 |
|files fileNames| |
|
7701 |
||
7702 |
files := self currentSelectedFiles. |
|
7703 |
(files isEmpty) ifTrue:[ |
|
7704 |
^ self. |
|
7705 |
]. |
|
7706 |
||
7707 |
fileNames := files collect:[:each | |
|
7708 |
'"' , each asFilename pathName , '"' |
|
7709 |
]. |
|
7710 |
||
7711 |
[ |
|
7712 |
OperatingSystem |
|
4959 | 7713 |
executeCommand:command , ' ' , fileNames asStringCollection asString |
7714 |
inDirectory:(files first asFilename directory). |
|
4957 | 7715 |
] fork |
7716 |
! |
|
7717 |
||
4820 | 7718 |
openPDFViewer |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7719 |
|files fileNames cmd arg| |
4820 | 7720 |
|
7721 |
files := self currentSelectedFiles. |
|
7722 |
(files isEmpty) ifTrue:[ |
|
7723 |
^ self. |
|
7724 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7725 |
cmd := MIMETypes defaultCommandForMimeType:'application/pdf'. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7726 |
cmd isNil ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7727 |
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
|
7728 |
^ self. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7729 |
]. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7730 |
|
4820 | 7731 |
fileNames := |
7732 |
files |
|
7733 |
collect: |
|
7734 |
[:each | |
|
7735 |
'"' , each asFilename pathName , '"' |
|
7736 |
]. |
|
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7737 |
arg := fileNames asStringCollection asStringWith:' '. |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7738 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7739 |
(cmd includesString:'"%1"') ifTrue:[ |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7740 |
cmd := cmd copyReplaceString:'"%1"' withString:'%1' |
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7741 |
]. |
4820 | 7742 |
|
4950 | 7743 |
[ |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7744 |
OperatingSystem executeCommand:(cmd bindWith:arg). |
4950 | 7745 |
] fork |
5836
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7746 |
|
922c94b683a1
ask MIMETypes for pdf-command
Claus Gittinger <cg@exept.de>
parents:
5832
diff
changeset
|
7747 |
"Modified: / 12-05-2004 / 12:31:20 / cg" |
4820 | 7748 |
! |
7749 |
||
4958 | 7750 |
openRP |
7751 |
self openOSCommandWithFiles:'realplay' |
|
7752 |
! |
|
7753 |
||
8426 | 7754 |
openResourceFileEditor |
7755 |
||
7756 |
self |
|
7757 |
openTool: Tools::InternationalLanguageTranslationEditor |
|
7758 |
with: #openOnFile: |
|
7759 |
! |
|
7760 |
||
3892 | 7761 |
openSlideShow |
5880 | 7762 |
|dir| |
7763 |
||
7764 |
dir := self theSingleSelectedDirectoryOrNil. |
|
7765 |
dir isNil ifTrue:[^ self]. |
|
7766 |
||
3892 | 7767 |
CodingExamples_GUI::SlideShow openIn:dir. |
7768 |
! |
|
7769 |
||
7770 |
openSnapshotImageBrowser |
|
4491 | 7771 |
"Sorry, for now, only the old browser can handle snapShotImages." |
7772 |
||
3892 | 7773 |
^ self openTool:SystemBrowser with:#openOnSnapShotImage: ignoreDirectories:true |
7774 |
! |
|
7775 |
||
7776 |
openTerminal |
|
5880 | 7777 |
|dir| |
7778 |
||
7779 |
dir := self theSingleSelectedDirectoryOrHomeDir. |
|
3892 | 7780 |
|
5300 | 7781 |
TerminalApplication notNil ifTrue:[ |
7782 |
TerminalApplication openIn:dir |
|
7783 |
] ifFalse:[ |
|
7784 |
VT100TerminalView openShellIn:dir. |
|
7785 |
]. |
|
3892 | 7786 |
! |
7787 |
||
7788 |
openTool:aToolClass |
|
7789 |
"open a tool on the selected file(s)" |
|
7790 |
||
7791 |
^ self openTool:aToolClass ignoreDirectories:true |
|
7792 |
! |
|
7793 |
||
7794 |
openTool:aToolClass ignoreDirectories:ignoreDirs |
|
7795 |
"open a tool on the selected file(s)" |
|
7796 |
||
7797 |
^ self |
|
4414 | 7798 |
openTool:aToolClass |
7799 |
with:#openOn: |
|
7800 |
ignoreDirectories:ignoreDirs |
|
3892 | 7801 |
! |
7802 |
||
8426 | 7803 |
openTool:aToolClass with:aSelector |
7804 |
"open a tool on the selected file(s)" |
|
7805 |
||
7806 |
^ self openTool:aToolClass with:aSelector ignoreDirectories:true |
|
7807 |
! |
|
7808 |
||
3892 | 7809 |
openTool:aToolClass with:aSelector ignoreDirectories:ignoreDirs |
7810 |
"open a tool on the selected file(s)" |
|
7811 |
||
8832 | 7812 |
|tool| |
3892 | 7813 |
|
7814 |
aToolClass isNil ifTrue:[ |
|
4414 | 7815 |
Dialog warn:'Sorry, that tool seems to be not available'. |
7816 |
^ nil. |
|
3892 | 7817 |
]. |
8832 | 7818 |
self forEachSelectedFileIgnoringDirectories:ignoreDirs do:[:path | |
7819 |
tool := aToolClass perform:aSelector with:path. |
|
3892 | 7820 |
]. |
7821 |
^ tool |
|
8832 | 7822 |
! |
7823 |
||
7824 |
openWebBrowser |
|
9343
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7825 |
self |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7826 |
forEachSelectedFileIgnoringDirectories:true |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7827 |
do:[:path | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7828 |
Error |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7829 |
handle:[:ex | |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7830 |
Dialog warn:'Shell execution failed: ',ex description |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7831 |
] do:[ |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7832 |
OperatingSystem openApplicationForDocument:path operation:#open. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7833 |
^ self. |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7834 |
] |
895543baebfe
added: #doOpenWithShellCommand
Claus Gittinger <cg@exept.de>
parents:
9338
diff
changeset
|
7835 |
]. |
3892 | 7836 |
! |
7837 |
||
6022 | 7838 |
openWorkspace |
7839 |
self |
|
7840 |
openTool:WorkspaceApplication |
|
7841 |
with:#openOnFile: |
|
7842 |
ignoreDirectories:true |
|
7843 |
! |
|
7844 |
||
4950 | 7845 |
openXV |
4957 | 7846 |
self openOSCommandWithFiles:'xv' |
4950 | 7847 |
! |
7848 |
||
3892 | 7849 |
openZipTool |
5880 | 7850 |
|zipTool| |
3892 | 7851 |
|
7852 |
(zipTool := self openTool:ZipTool) notNil ifTrue:[ |
|
5880 | 7853 |
zipTool initialExtractDirectory:(self theSingleSelectedDirectoryOrHomeDir). |
3892 | 7854 |
]. |
7855 |
! |
|
7856 |
||
7857 |
readAbbrevFile |
|
7858 |
"read the abbrev file and install classes found there as autoloaded classes" |
|
7859 |
||
5880 | 7860 |
|directories| |
3892 | 7861 |
|
3982 | 7862 |
directories := self currentSelectedDirectories. |
3892 | 7863 |
directories isEmpty ifTrue:[^ self]. |
7864 |
||
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7865 |
self withActivityIndicationDo:[ |
5880 | 7866 |
directories do:[:eachDir | |
7867 |
Smalltalk installAutoloadedClassesFrom:(eachDir construct:'abbrev.stc'). |
|
7868 |
] |
|
5828 | 7869 |
] |
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7870 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
7871 |
"Modified: / 25-07-2006 / 09:07:43 / cg" |
3892 | 7872 |
! |
7873 |
||
6460 | 7874 |
readAndShowResources |
7875 |
self withActivityIndicationDo:[ |
|
7876 |
| selectedFiles| |
|
7877 |
||
7878 |
selectedFiles:= self currentSelectedFiles. |
|
7879 |
selectedFiles do:[:fileName | |
|
7880 |
resources := ResourcePack fromFile:fileName. |
|
7881 |
resources inspect. |
|
7882 |
]. |
|
7883 |
] |
|
7884 |
! |
|
7885 |
||
3892 | 7886 |
singleFileFileIn:fileName lazy:lazy |
7887 |
"fileIn the selected file(s)" |
|
7888 |
||
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7889 |
|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
|
7890 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7891 |
fileName isRegularFile ifFalse:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7892 |
^ self. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7893 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7894 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7895 |
[ |
4345 | 7896 |
(ObjectFileLoader notNil |
5491 | 7897 |
and:[ObjectFileLoader hasValidBinaryExtension:fileName]) ifTrue:[ |
4345 | 7898 |
AbortOperationRequest catch:[ |
7899 |
|p| |
|
7900 |
||
7901 |
"/ |
|
7902 |
"/ look if already loaded ... then unload first |
|
7903 |
"/ |
|
7904 |
p := fileName pathName. |
|
7905 |
(ObjectFileLoader loadedObjectFiles includes:p) ifTrue:[ |
|
7906 |
(Dialog confirm:(resources |
|
7907 |
string:'%1 is already loaded; load anyway ?' |
|
7908 |
with:p)) ifFalse:[ |
|
7909 |
^ self |
|
7910 |
]. |
|
7911 |
notifyString := 'unloading old ' , p , ' ...'. |
|
7912 |
Transcript showCR:notifyString. |
|
4523 | 7913 |
self notify:notifyString. |
4345 | 7914 |
ObjectFileLoader unloadObjectFile:p. |
7915 |
]. |
|
7916 |
||
7917 |
notifyString := 'loading ' , p , ' ...'. |
|
7918 |
Transcript showCR:notifyString. |
|
4523 | 7919 |
self notify:notifyString. |
12426 | 7920 |
(ObjectFileLoader loadObjectFile:p) isNil ifTrue:[ |
7921 |
notifyString := 'Error: could not load ' , p. |
|
7922 |
Transcript showCR:notifyString. |
|
7923 |
self notify:notifyString. |
|
7924 |
] ifFalse:[ |
|
7925 |
Class addInfoRecord:('fileIn ' , fileName asFilename pathName) |
|
7926 |
]. |
|
4345 | 7927 |
] |
7928 |
] ifFalse:[ ((fileName hasSuffix:'cls') |
|
7929 |
and:[((fileName mimeTypeOfContents ? '') startsWith:'application/x-smalltalk-source') not ]) ifTrue:[ |
|
7930 |
"/ loading a binary class file |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
7931 |
aStream := fileName readStreamOrNil. |
4345 | 7932 |
aStream notNil ifTrue:[ |
7933 |
aStream fileInBinary. |
|
7934 |
] |
|
7935 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7936 |
((fileName hasSuffix:'class') or:[(fileName hasSuffix:'cla')]) ifTrue:[ |
4345 | 7937 |
"/ loading a java class file |
7938 |
JavaClassReader notNil ifTrue:[ |
|
5491 | 7939 |
JavaClassReader loadFile:fileName |
4345 | 7940 |
] |
7941 |
] ifFalse:[ (fileName hasSuffix:'sif') ifTrue:[ |
|
7942 |
"/ loading a sif (smalltalk interchange format) file |
|
7943 |
SmalltalkInterchangeSTXFileInManager autoload. |
|
7944 |
SmalltalkInterchangeFileManager newForFileIn |
|
7945 |
fileName: fileName pathName; |
|
7946 |
fileIn. |
|
7947 |
] ifFalse:[ (fileName hasSuffix:'pcl') ifTrue:[ |
|
7948 |
Parcel isNil ifTrue:[ |
|
7949 |
Dialog warn:'Parcel support not loaded.' |
|
7950 |
] ifFalse:[ |
|
7951 |
Parcel loadParcelFrom: fileName pathName |
|
7952 |
] |
|
7953 |
] ifFalse:[ |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7954 |
"/ ask programming languages... |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7955 |
lang := ProgrammingLanguage allDetect:[:l | l canReadSourceFile:fileName] ifNone:nil. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7956 |
(lang notNil and:[lang ~= SmalltalkLanguage]) ifTrue:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7957 |
lang fileIn:fileName. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7958 |
] ifFalse:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7959 |
"/ loading a regular (chunk) or xml source file |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7960 |
Error handle:[:ex | |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7961 |
self errorNotify:'Error on file in: ', ex description. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7962 |
] do:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7963 |
aStream := fileName readStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7964 |
[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7965 |
Class withoutUpdatingChangesDo:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7966 |
wasLazy := Compiler compileLazy:lazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7967 |
Smalltalk fileInStream:aStream. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7968 |
]. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7969 |
Class addInfoRecord:('fileIn ' , fileName asString) |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7970 |
] ensure:[ |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7971 |
Compiler compileLazy:wasLazy. |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7972 |
aStream close |
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7973 |
] |
4345 | 7974 |
] |
7975 |
] |
|
9299
3c234ab3fae2
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
9296
diff
changeset
|
7976 |
]]] |
4345 | 7977 |
]] |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7978 |
] 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
|
7979 |
|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
|
7980 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7981 |
isRedef := false. |
12684 | 7982 |
sig := ex creator. |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7983 |
(dontAskSignals notNil and:[dontAskSignals includesKey:sig]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7984 |
action := #continue |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
7985 |
] ifFalse:[ |
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7986 |
(sig == NoHandlerError and:[ex parameter rejected]) ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7987 |
ex reject |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7988 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7989 |
sig == Class methodRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7990 |
msg := 'trying to overwrite method:\\ ' , ex oldMethod whoString , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7991 |
, ex oldPackage , ''' with method from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7992 |
label := 'Method redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7993 |
redefKind := 'method'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7994 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7995 |
] ifFalse:[sig == Class classRedefinitionNotification ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7996 |
msg := 'trying to redefine class: ' , ex oldClass name allBold , '\\in package ''' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7997 |
, ex oldPackage , ''' with new definition from package ''' , ex newPackage , ''''. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7998 |
label := 'Class redefinition in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
7999 |
redefKind := 'class'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8000 |
isRedef := true. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8001 |
] ifFalse:[sig == HaltInterrupt ifTrue:[ |sender| |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8002 |
label := msg := 'Breakpoint/Halt in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8003 |
sender := ex suspendedContext. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8004 |
msg := msg , '\\in ' , sender receiver class name , '>>' , sender sender selector |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8005 |
] ifFalse:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8006 |
label := 'Error in fileIn'. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8007 |
msg := 'error in fileIn: %1' |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8008 |
]]]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8009 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8010 |
msg := msg bindWith:ex description. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8011 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8012 |
labels := #('Cancel' 'Skip' 'Debug' 'Compare Sources'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8013 |
values := #(abort skip debug compareSources). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8014 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8015 |
isRedef ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8016 |
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
|
8017 |
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
|
8018 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8019 |
labels := labels , #('Keep Package' ). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8020 |
values := values , #(keep). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8021 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8022 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8023 |
labels := labels , #( 'Continue' 'ContinueForAll'). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8024 |
values := values , #( continue continueForAll). |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8025 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8026 |
AbortAllOperationWantedQuery query ifTrue:[ |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8027 |
labels := #('Cancel All') , labels. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8028 |
values := #(cancelAll) , values. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8029 |
]. |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8030 |
|
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8031 |
action := Dialog |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8032 |
choose:(msg withCRs) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8033 |
label:label |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8034 |
image:(WarningBox iconBitmap) |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8035 |
labels:labels |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8036 |
values:values |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8037 |
default:#continue |
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8038 |
onCancel:#abort. |
6281
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8039 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8040 |
|
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8041 |
action == #continueForAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8042 |
dontAskSignals isNil ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8043 |
dontAskSignals := IdentityDictionary new. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8044 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8045 |
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
|
8046 |
action := #continue. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8047 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8048 |
|
8887
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8049 |
(action == #compareSources) ifTrue:[ |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8050 |
DiffCodeView |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8051 |
openOn:(ex oldMethod source) label:'Old Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8052 |
and:(ex newMethod source) label:'New Source' |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8053 |
title:ex description. |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8054 |
ex resignalAs:ex |
f9ab42af84ff
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
8882
diff
changeset
|
8055 |
]. |
8082
40a926dc460d
On class/method redefinition allow the user to select both #keep and #continue
Stefan Vogel <sv@exept.de>
parents:
8068
diff
changeset
|
8056 |
(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
|
8057 |
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
|
8058 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8059 |
action == #abort ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8060 |
AbortOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8061 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8062 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8063 |
action == #cancelAll ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8064 |
AbortAllOperationRequest raise. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8065 |
ex return |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8066 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8067 |
action == #skip ifTrue:[ |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8068 |
ex proceedWith:nil |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8069 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8070 |
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
|
8071 |
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
|
8072 |
withMessage:ex description |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8073 |
mayProceed:true. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8074 |
ex proceedWith:nil. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8075 |
]. |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8076 |
ex reject |
e8e47b1b290f
Do not pop up dialogs on PackageRedefinitions when doing a fileIn
Stefan Vogel <sv@exept.de>
parents:
6265
diff
changeset
|
8077 |
] |
7040 | 8078 |
|
10887
f2a55c7f0ed6
changed: #singleFileFileIn:lazy:
Claus Gittinger <cg@exept.de>
parents:
10775
diff
changeset
|
8079 |
"Modified: / 22-11-2011 / 13:52:17 / cg" |
4531 | 8080 |
! |
8081 |
||
4558 | 8082 |
splitFile:infile intoPiecesOfSize:kiloBytes |
8083 |
|bytesPerSplit splitIndex bufferSize buffer n |
|
8084 |
inStream outFile outStream remaining remainingInThisOutfile| |
|
8085 |
||
8086 |
bufferSize := 32*1024. |
|
8087 |
||
8088 |
inStream := infile readStream. |
|
8089 |
||
8090 |
bytesPerSplit := kiloBytes * 1024. |
|
8091 |
||
8092 |
remaining := infile fileSize. |
|
8093 |
splitIndex := 1. |
|
8094 |
[remaining > 0] whileTrue:[ |
|
8095 |
outFile := infile pathName , '_' , (splitIndex printString leftPaddedTo:3 with:$0). |
|
8096 |
outStream := outFile asFilename writeStream. |
|
8097 |
remainingInThisOutfile := remaining min:bytesPerSplit. |
|
8098 |
[remainingInThisOutfile > 0] whileTrue:[ |
|
8099 |
buffer := ByteArray new:bufferSize. |
|
8100 |
n := inStream |
|
8101 |
nextBytes:(bufferSize min:remainingInThisOutfile) |
|
8102 |
into:buffer |
|
8103 |
startingAt:1. |
|
8104 |
outStream nextPutBytes:n from:buffer startingAt:1. |
|
8105 |
remainingInThisOutfile := remainingInThisOutfile - n. |
|
8106 |
remaining := remaining - n. |
|
8107 |
]. |
|
8108 |
outStream close. |
|
8109 |
splitIndex := splitIndex + 1. |
|
8110 |
]. |
|
8111 |
inStream close. |
|
8112 |
! |
|
8113 |
||
8114 |
splitSelectedFiles |
|
6264 | 8115 |
|selectedFiles numFiles msg sizeString kiloBytes| |
4558 | 8116 |
|
12871 | 8117 |
selectedFiles := self currentSelectedFiles. |
4558 | 8118 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8119 |
||
6265 | 8120 |
msg := (numFiles > 1) |
8121 |
ifTrue:'Split each of the %1 files into pieces of size (in kB):' |
|
8122 |
ifFalse:'Split %2 into pieces of size (in kB):'. |
|
4558 | 8123 |
|
6352 | 8124 |
sizeString := Dialog request:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName). |
6264 | 8125 |
sizeString isEmptyOrNil ifTrue:[^ self]. |
8126 |
kiloBytes := Integer readFrom:sizeString onError:nil. |
|
4558 | 8127 |
kiloBytes isNil ifTrue:[^ self]. |
8128 |
||
8129 |
selectedFiles do:[:fileName | |
|
8130 |
self notify:('Splitting:', fileName baseName). |
|
8131 |
fileName isDirectory ifFalse:[ |
|
8132 |
self splitFile:fileName intoPiecesOfSize:kiloBytes. |
|
8133 |
] |
|
8134 |
]. |
|
6190 | 8135 |
self notify:nil. |
6265 | 8136 |
|
7560 | 8137 |
"Modified: / 04-12-2006 / 13:15:26 / cg" |
4558 | 8138 |
! |
8139 |
||
4531 | 8140 |
truncateSelectedFilesToZeroSize |
4554 | 8141 |
|selectedFiles numFiles msg| |
4531 | 8142 |
|
7560 | 8143 |
selectedFiles := self currentSelectedObjects. |
4554 | 8144 |
(numFiles := selectedFiles size) == 0 ifTrue:[^ self]. |
8145 |
||
4930 | 8146 |
msg := 'Really truncate file ''%2'' to zero length ?\\WARNING: contents of file is lost !!\This cannot be undone.'. |
4554 | 8147 |
numFiles > 1 ifTrue:[ |
4930 | 8148 |
msg := 'Really truncate %1 files to zero length ?\\WARNING: contents of files is lost !!\This cannot be undone.'. |
4554 | 8149 |
]. |
4531 | 8150 |
|
8151 |
(Dialog |
|
6352 | 8152 |
confirm:(resources stringWithCRs:msg with:numFiles with:selectedFiles first baseName allBold) |
4531 | 8153 |
initialAnswer:false |
8154 |
) ifFalse:[ |
|
8155 |
^ self |
|
8156 |
]. |
|
8157 |
||
8158 |
selectedFiles do:[:fileName | |
|
8159 |
|s| |
|
8160 |
||
8161 |
self notify:('Truncating:', fileName baseName). |
|
8162 |
fileName isDirectory ifFalse:[ |
|
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8163 |
[ |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8164 |
s := fileName writeStream. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8165 |
s close. |
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8166 |
] on:FileStream openErrorSignal do:[:ex| |
4531 | 8167 |
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
|
8168 |
]. |
4531 | 8169 |
] |
8170 |
]. |
|
6190 | 8171 |
self notify:nil. |
7560 | 8172 |
|
8173 |
"Modified: / 04-12-2006 / 13:15:28 / cg" |
|
3892 | 8174 |
! ! |
8175 |
||
4849 | 8176 |
!AbstractFileBrowser methodsFor:'menu queries-cvs'! |
3892 | 8177 |
|
8178 |
canCvsAddAndCommit |
|
8179 |
||
3982 | 8180 |
|selectedFiles| |
8181 |
||
8182 |
selectedFiles := self currentSelectedFiles. |
|
8183 |
^ (selectedFiles notEmpty and:[self currentFilesAreInSameDirectory]). |
|
3892 | 8184 |
! |
8185 |
||
8186 |
canRemoveCVSContainer |
|
5356
d08261ab1567
care for nonexisting bookmarks file in open
Claus Gittinger <cg@exept.de>
parents:
5334
diff
changeset
|
8187 |
^ self currentSelectedFiles |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8188 |
contains:[:fileName| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8189 |
|dirOfFile cvsDir| |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8190 |
|
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8191 |
dirOfFile := self getDirWithoutFileName:fileName. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8192 |
cvsDir := dirOfFile construct:'CVS'. |
5318 | 8193 |
cvsDir isDirectory |
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8194 |
]. |
3892 | 8195 |
! ! |
8196 |
||
4849 | 8197 |
!AbstractFileBrowser methodsFor:'menu queries-tools'! |
3892 | 8198 |
|
6521 | 8199 |
anySTFilesOrDirectoriesPresent |
8200 |
^ self anyDirectoriesOrFilesPresentWithSuffix:'st' |
|
8201 |
! |
|
8202 |
||
3892 | 8203 |
anySTFilesPresent |
8204 |
^ self anyFilesPresentWithSuffix:'st' |
|
8205 |
! |
|
8206 |
||
8207 |
canCreateNewProject |
|
8208 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
12811 | 8209 |
^ self currentSelectedFiles contains:[:fileName| |
8210 |
| suffix| |
|
8211 |
suffix := fileName suffix asLowercase. |
|
8212 |
(suffix = 'prj' or:[suffix = 'st']) |
|
8213 |
] |
|
3892 | 8214 |
! |
8215 |
||
8216 |
canDoTerminal |
|
8217 |
||
8218 |
^ OperatingSystem isUNIXlike |
|
8219 |
or:[OperatingSystem isMSWINDOWSlike] |
|
8220 |
! |
|
8221 |
||
8222 |
canDoTerminalAndSystemIsDOS |
|
8223 |
||
8224 |
^ self canDoTerminal and:[OperatingSystem isMSWINDOWSlike] |
|
8225 |
! |
|
8226 |
||
8227 |
canDoTerminalAndSystemIsUnix |
|
8228 |
||
8229 |
^ self canDoTerminal and:[OperatingSystem isUNIXlike] |
|
8230 |
! |
|
8231 |
||
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8232 |
canGenerateSignatureFiles |
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8233 |
"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
|
8234 |
|
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8235 |
Expecco::KeyFileGenerator isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8236 |
Expecco::KeyFile isNil ifTrue:[ ^ false ]. |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8237 |
|
8645
00e4d07c6d6d
Generate signed expecco patch files
Stefan Vogel <sv@exept.de>
parents:
8641
diff
changeset
|
8238 |
^ self currentSelectedFiles notEmptyOrNil |
8640
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8239 |
! |
fe2bc358dec4
added generateSignatureFile to tools-menu
Claus Gittinger <cg@exept.de>
parents:
8617
diff
changeset
|
8240 |
|
12811 | 8241 |
canOpenMonticelloBrowser |
8242 |
^ self currentSelectedFiles |
|
8243 |
contains:[:fileName| |
|
8244 |
fileName suffix asLowercase = 'mcz' |
|
8245 |
] |
|
8246 |
! |
|
8247 |
||
3892 | 8248 |
canReadAbbrevFile |
8249 |
||
5960 | 8250 |
|currentDirectory| |
3892 | 8251 |
|
8252 |
self currentFilesAreInSameDirectory ifFalse:[^ false]. |
|
5960 | 8253 |
currentDirectory := self currentDirectory. |
8254 |
^ currentDirectory notNil |
|
8255 |
and:[ (currentDirectory construct:'abbrev.stc') exists ] |
|
3892 | 8256 |
! |
8257 |
||
8258 |
canRemoveFromSourcePath |
|
8259 |
||
8260 |
^ false |
|
8261 |
! |
|
8262 |
||
8263 |
hasASN1 |
|
8264 |
^ [ OSI::ASN1Parser notNil |
|
4414 | 8265 |
and:[OSI::ASN1Parser isLoaded]] |
3892 | 8266 |
|
8267 |
! |
|
8268 |
||
8269 |
hasASN1AndSelection |
|
8270 |
^ [ self hasSelection value |
|
4414 | 8271 |
and:[self currentSelectedFiles size > 0 |
8272 |
and:[OSI::ASN1Parser notNil |
|
8273 |
and:[OSI::ASN1Parser isLoaded]]]] |
|
3892 | 8274 |
! |
8275 |
||
8276 |
hasCBrowser |
|
8277 |
^ [ CBrowser::Browser notNil ] |
|
8278 |
! |
|
8279 |
||
8280 |
hasJava |
|
8281 |
||
8282 |
^ [ JavaClassReader notNil |
|
4414 | 8283 |
and:[JavaClassReader isLoaded]] |
3892 | 8284 |
! |
8285 |
||
8286 |
hasJavaAndSelection |
|
8287 |
||
12871 | 8288 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 8289 |
and:[JavaClassReader notNil |
8290 |
and:[JavaClassReader isLoaded]]] |
|
3892 | 8291 |
! |
8292 |
||
8293 |
hasMP3Player |
|
8294 |
||
8295 |
^ [ MP3PlayerApplication notNil |
|
4414 | 8296 |
or:[SaugFix::MP3PlayerApplication notNil ]] |
3892 | 8297 |
! |
8298 |
||
8299 |
hasMP3PlayerAndSelection |
|
8300 |
||
12871 | 8301 |
^ [ self currentSelectedFiles notEmptyOrNil |
4414 | 8302 |
and:[ self hasMP3Player value]] |
3892 | 8303 |
! |
8304 |
||
8426 | 8305 |
hasResourceFileSelected |
12871 | 8306 |
^ (self currentSelectedFiles) |
8307 |
contains:[:fn | |
|
12811 | 8308 |
fn suffix asLowercase = 'rs' |
8309 |
]. |
|
8426 | 8310 |
! |
8311 |
||
3892 | 8312 |
hasSlideShow |
8313 |
||
8314 |
^ [CodingExamples_GUI::SlideShow notNil] |
|
8315 |
! |
|
8316 |
||
8317 |
hasSnapshotSelection |
|
8318 |
||
8319 |
^ [ |
|
4414 | 8320 |
| files | |
8426 | 8321 |
|
4414 | 8322 |
files := self currentSelectedFiles. |
8323 |
((files size == 1) |
|
8324 |
and:[ files first hasSuffix:'img' ]) |
|
3892 | 8325 |
] |
8326 |
! |
|
8327 |
||
7869 | 8328 |
hasXml |
9206 | 8329 |
^ [ XML::XMLParser notNil ] |
7869 | 8330 |
! |
8331 |
||
8332 |
hasXmlFileSelected |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8333 |
"/ 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
|
8334 |
"/ then handle the error when it ever fails during xml-parsing. |
7869 | 8335 |
|
8426 | 8336 |
^ [ |
8337 |
|sel fileName| |
|
7869 | 8338 |
|
8339 |
sel := self currentSelectedFiles. |
|
8340 |
sel size == 1 ifTrue:[ |
|
8341 |
fileName := sel first. |
|
8342 |
fileName notNil ifTrue:[ |
|
8611
3d979ab577b7
xml-inspector always enabled.
Claus Gittinger <cg@exept.de>
parents:
8601
diff
changeset
|
8343 |
#('xml' 'vdx') includes:fileName suffix asLowercase |
7869 | 8344 |
] ifFalse:[ |
8345 |
false |
|
8346 |
] |
|
8347 |
] ifFalse:[ |
|
8348 |
false |
|
8349 |
] |
|
8350 |
] |
|
8351 |
! |
|
8352 |
||
3892 | 8353 |
hasZipFileSelected |
9764
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8354 |
|sel fileName suff| |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8355 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8356 |
sel := self currentSelectedFiles. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8357 |
sel size == 1 ifFalse:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8358 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8359 |
fileName := sel first. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8360 |
fileName isNil ifTrue:[^ false]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8361 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8362 |
suff := fileName suffix asLowercase. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8363 |
(suff = 'zip' or:[suff = 'jar']) ifTrue:[^ true]. |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8364 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8365 |
^ fileName mimeTypeOfContents = 'application/x-zip-compressed' |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8366 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8367 |
"Modified: / 14-02-2011 / 17:17:03 / cg" |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8368 |
! |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8369 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8370 |
hasZipFileSelectedHolder |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8371 |
^ [ self hasZipFileSelected ] |
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8372 |
|
47b9c33465a1
added: #hasZipFileSelectedHolder
Claus Gittinger <cg@exept.de>
parents:
9752
diff
changeset
|
8373 |
"Created: / 14-02-2011 / 17:16:08 / cg" |
3892 | 8374 |
! |
8375 |
||
8376 |
javaSupportLoaded |
|
8377 |
||
8378 |
^ false |
|
8379 |
! ! |
|
8380 |
||
3906 | 8381 |
!AbstractFileBrowser methodsFor:'presentation'! |
8382 |
||
8383 |
getModeString:modeBits |
|
8384 |
"convert file-mode bits into a more user-friendly string. |
|
8385 |
This is wrong here - should be moved into OperatingSystem." |
|
8386 |
||
8387 |
^ self getModeString:modeBits |
|
4414 | 8388 |
with:#( 'owner:' $r $w $x |
8389 |
' group:' $r $w $x |
|
8390 |
' others:' $r $w $x ) |
|
3906 | 8391 |
! |
8392 |
||
8393 |
getModeString:modeBits with:texts |
|
8394 |
"convert file-mode bits into a more user-friendly string. |
|
8395 |
This is wrong here - should be moved into OperatingSystem." |
|
8396 |
||
8397 |
|bits modeString| |
|
8398 |
||
8399 |
bits := modeBits bitAnd:8r777. |
|
8400 |
modeString := ''. |
|
8401 |
||
8402 |
#( nil 8r400 8r200 8r100 nil 8r040 8r020 8r010 nil 8r004 8r002 8r001 ) |
|
8403 |
with: texts do:[:bitMask :access | |
|
4414 | 8404 |
|ch| |
8405 |
||
8406 |
bitMask isNil ifTrue:[ |
|
8407 |
modeString := modeString , access |
|
8408 |
] ifFalse:[ |
|
8409 |
(bits bitAnd:bitMask) == 0 ifTrue:[ |
|
8410 |
ch := $- |
|
8411 |
] ifFalse:[ |
|
8412 |
ch := access |
|
8413 |
]. |
|
8414 |
modeString := modeString copyWith:ch |
|
8415 |
] |
|
3906 | 8416 |
]. |
8417 |
^ modeString |
|
8418 |
! ! |
|
8419 |
||
5880 | 8420 |
!AbstractFileBrowser methodsFor:'private'! |
8421 |
||
8422 |
theSingleSelectedDirectoryOrHomeDir |
|
8423 |
|dir| |
|
8424 |
||
5888 | 8425 |
dir := self theSingleSelectedDirectoryOrNil. |
5880 | 8426 |
dir isNil ifTrue:[ dir := Filename homeDirectory]. |
8427 |
^ dir. |
|
8428 |
! |
|
8429 |
||
8430 |
theSingleSelectedDirectoryOrNil |
|
8431 |
|dirs| |
|
8432 |
||
8433 |
dirs := self currentSelectedDirectories. |
|
8434 |
dirs size ~= 1 ifTrue:[ ^ nil]. |
|
8435 |
^ dirs anElement. |
|
8436 |
! ! |
|
8437 |
||
3892 | 8438 |
!AbstractFileBrowser methodsFor:'queries'! |
8439 |
||
8256 | 8440 |
cBrowserLoaded |
8441 |
^ CBrowser::Browser notNil |
|
8442 |
! |
|
8443 |
||
10747
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8444 |
cBrowserMenuItemVisible |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8445 |
^ self cBrowserLoaded or:[ OperatingSystem getLoginName = 'cg' ] |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8446 |
|
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8447 |
"Created: / 04-10-2011 / 13:40:38 / cg" |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8448 |
! |
aa57b76e8318
added: #cBrowserMenuItemVisible
Claus Gittinger <cg@exept.de>
parents:
10678
diff
changeset
|
8449 |
|
5334
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8450 |
getAllFilesAsStrings |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8451 |
"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
|
8452 |
|
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8453 |
^ self subclassResponsibility |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8454 |
! |
637f49d94b1b
move file(s) operation added
Claus Gittinger <cg@exept.de>
parents:
5318
diff
changeset
|
8455 |
|
3906 | 8456 |
getFileInfoStringForFirstSelectedFile:longInfo |
8457 |
"get stat info on selected file - return a string which can be |
|
8458 |
shown in a box" |
|
8459 |
||
5973
0baf6c6b685f
#linkInfo now returns the info also for files that are not a symlink
Stefan Vogel <sv@exept.de>
parents:
5971
diff
changeset
|
8460 |
|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
|
8461 |
sizeString fileSize tAccess tModification buffer| |
3906 | 8462 |
|
7560 | 8463 |
selFiles := self currentSelectedObjects. |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8464 |
selFiles size ~~ 1 ifTrue:[ ^ nil]. |
3906 | 8465 |
filename := selFiles first. |
8466 |
||
8364 | 8467 |
info := filename linkInfo. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8468 |
info isNil ifTrue:[ |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8469 |
^ 'Cannot get fileInfo'. |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8470 |
^ nil |
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8471 |
]. |
8364 | 8472 |
|
5755
5e8165d55605
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
5753
diff
changeset
|
8473 |
buffer := Text writeStream. |
4765 | 8474 |
|
8475 |
buffer |
|
8476 |
nextPutAll:'filename: '; |
|
8477 |
nextPutLine:filename asString. |
|
8478 |
||
8364 | 8479 |
OperatingSystem isMSDOSlike ifTrue: [ |
8480 |
(info alternativeName notNil |
|
8481 |
and:[ info alternativeName ~= info fullName ]) ifTrue:[ |
|
8482 |
buffer nextPutAll:'shortname: '. |
|
8483 |
buffer nextPutLine:info alternativeName. |
|
8484 |
] |
|
8485 |
]. |
|
8486 |
||
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8487 |
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
|
8488 |
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
|
8489 |
filename exists ifFalse:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8490 |
buffer nextPutAll:'broken '. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8491 |
]. |
4765 | 8492 |
buffer |
8493 |
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
|
8494 |
nextPutLine:(info path ? '???'). |
3906 | 8495 |
] 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
|
8496 |
(longInfo and:[info isRegular]) ifTrue:[ |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8497 |
fileOutput := filename fileType. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8498 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8499 |
|
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8500 |
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
|
8501 |
s := info type asString |
5360
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8502 |
] ifFalse:[ |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8503 |
s := 'regular (' , fileOutput , ')' |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8504 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8505 |
buffer nextPutLine:s. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8506 |
]. |
1f2f874c8c9a
avoid blocking on mounted directories;
Claus Gittinger <cg@exept.de>
parents:
5356
diff
changeset
|
8507 |
|
4707
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8508 |
fileSize := info fileSize. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8509 |
sizeString := 'size: ', fileSize printString. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8510 |
longInfo ifTrue:[ |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8511 |
fileSize > 1024 ifTrue:[ |
8172 | 8512 |
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
|
8513 |
]. |
e0a527ba0898
show Kb & Mb based on 1024 bytes per kilo
Claus Gittinger <cg@exept.de>
parents:
4692
diff
changeset
|
8514 |
]. |
4765 | 8515 |
buffer nextPutLine:sizeString. |
3906 | 8516 |
|
8517 |
modeBits := info mode. |
|
8518 |
modeString := self getModeString:modeBits. |
|
4765 | 8519 |
|
8520 |
buffer nextPutAll:'access: '; nextPutAll:modeString. |
|
3906 | 8521 |
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
|
8522 |
buffer nextPutAll:' ('; nextPutAll:(modeBits printStringRadix:8); nextPut:$). |
3906 | 8523 |
]. |
4765 | 8524 |
buffer |
8525 |
cr; |
|
8526 |
nextPutAll:'owner: '; |
|
8527 |
nextPutLine:(OperatingSystem getUserNameFromID:(info uid)). |
|
8528 |
||
3906 | 8529 |
longInfo ifTrue:[ |
4765 | 8530 |
buffer |
8531 |
nextPutAll:'group: '; |
|
8532 |
nextPutLine:(OperatingSystem getGroupNameFromID:(info gid)). |
|
8533 |
||
8534 |
tAccess := info accessTime. |
|
8535 |
buffer |
|
8536 |
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
|
8537 |
nextPutAll:tAccess asDate printString; |
4765 | 8538 |
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
|
8539 |
nextPutLine:tAccess asTime printString. |
4765 | 8540 |
|
8541 |
tModification := info modificationTime. |
|
8542 |
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
|
8543 |
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
|
8544 |
nextPutAll:tModification asDate printString; |
4765 | 8545 |
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
|
8546 |
nextPutLine:tModification asTime printString. |
3906 | 8547 |
]. |
4765 | 8548 |
^ buffer contents |
7560 | 8549 |
|
7633
0a85c590f98f
ignore nil-return from get link name (for broken links)
Claus Gittinger <cg@exept.de>
parents:
7585
diff
changeset
|
8550 |
"Modified: / 07-02-2007 / 10:38:14 / cg" |
3906 | 8551 |
! |
8552 |
||
8510 | 8553 |
hasImageColorHistogram |
8554 |
^ ImageColorHistogram notNil |
|
8555 |
! |
|
8556 |
||
10258 | 8557 |
hasSubversionSupport |
11156
11c0b4cbc836
Use Configurable includesFeature:#Feature instead of direct send of #hasFeature
vrany
parents:
11149
diff
changeset
|
8558 |
^ ConfigurableFeatures includesFeature: #SubversionSupport |
10258 | 8559 |
|
8560 |
"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
|
8561 |
"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
|
8562 |
"Modified: / 19-01-2012 / 10:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10258 | 8563 |
! |
8564 |
||
3892 | 8565 |
initialCommandFor:fileName into:aBox |
8566 |
"set a useful initial command for execute box." |
|
8567 |
||
4496
513e99a8621b
defaultCommandPerMIME moved to MIMETypes
Claus Gittinger <cg@exept.de>
parents:
4491
diff
changeset
|
8568 |
self class initialCommandFor:fileName in:Filename currentDirectory intoBox:aBox |
3892 | 8569 |
! |
8570 |
||
8571 |
isAbstractFileBrowser |
|
8572 |
||
8573 |
^ true |
|
8574 |
! |
|
8575 |
||
8576 |
systemIsDOS |
|
8577 |
||
8578 |
^ OperatingSystem isMSDOSlike |
|
8579 |
! |
|
8580 |
||
12473 | 8581 |
systemIsOSX |
8582 |
||
8583 |
^ OperatingSystem isOSXlike |
|
8584 |
! |
|
8585 |
||
3892 | 8586 |
systemIsUnix |
8587 |
^ OperatingSystem isUNIXlike |
|
8588 |
! ! |
|
8589 |
||
8590 |
!AbstractFileBrowser methodsFor:'queries-file'! |
|
8591 |
||
8592 |
allItemsOfCurrentDirectory |
|
5009 | 8593 |
self |
4774 | 8594 |
applicationNamed:#DirectoryContentsBrowser |
5009 | 8595 |
ifPresentDo:[:app | ^ app allItemsOfCurrentDirectory]. |
8596 |
||
8597 |
^ nil |
|
3892 | 8598 |
! |
8599 |
||
8600 |
anyFilesPresentWithSuffix:suffix |
|
6725 | 8601 |
self currentSelectedDirectories do:[:dir| |
4636
08b2b63e3107
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
4629
diff
changeset
|
8602 |
[ |
5810
4661bf4c3bbf
openErrorSignal arg: always a string
Claus Gittinger <cg@exept.de>
parents:
5789
diff
changeset
|
8603 |
(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
|
8604 |
] on:FileStream openErrorSignal do:[:ex|]. |
3892 | 8605 |
]. |
8606 |
^ false. |
|
8607 |
! |
|
8608 |
||
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8609 |
commonPrefixOfSelectedFiles |
4773 | 8610 |
|selFiles stringCol firstPre| |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8611 |
|
7560 | 8612 |
selFiles := self currentSelectedObjects. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8613 |
selFiles isEmpty ifTrue:[^ nil]. |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8614 |
|
4772 | 8615 |
stringCol := selFiles collect:[:file | file asString]. |
4773 | 8616 |
firstPre := stringCol at:1. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8617 |
stringCol from:2 do:[:el| |
4773 | 8618 |
firstPre := firstPre commonPrefixWith:el. |
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8619 |
]. |
4773 | 8620 |
^ firstPre asFilename |
7560 | 8621 |
|
8622 |
"Modified: / 04-12-2006 / 13:14:25 / cg" |
|
4771
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8623 |
! |
9290fdb65a5d
#getCommonForCurrentFiles renamed to #commonPrefixOfSelectedFiles
Claus Gittinger <cg@exept.de>
parents:
4769
diff
changeset
|
8624 |
|
12481 | 8625 |
compressTabsOnSave |
8626 |
"if true, compress leading spaces (multiples of 8) with a tab character |
|
8627 |
when saving. |
|
8628 |
Default is true" |
|
8629 |
||
8630 |
^ true |
|
8631 |
! |
|
8632 |
||
3892 | 8633 |
currentFilesAreInSameDirectory |
8634 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8635 |
^ self parentDirectoriesOfCurrentFiles size < 2 |
3892 | 8636 |
! |
8637 |
||
8638 |
currentFilesHasDirectories |
|
8639 |
||
6725 | 8640 |
^ self currentSelectedDirectories notEmpty. |
3892 | 8641 |
! |
8642 |
||
3982 | 8643 |
directoriesForFiles:aFileCol |
11743 | 8644 |
^ aFileCol collect:[:file| self getDirWithoutFileName:file] as:Set. |
3982 | 8645 |
! |
8646 |
||
3892 | 8647 |
fileListIsEmpty |
5009 | 8648 |
self |
8649 |
applicationNamed:#DirectoryContentsBrowser |
|
8650 |
ifPresentDo:[:appl | ^ appl fileListIsEmpty]. |
|
8651 |
||
8652 |
^ nil. |
|
3892 | 8653 |
! |
8654 |
||
8655 |
fileListIsNotEmpty |
|
8656 |
||
8657 |
^ self fileListIsEmpty not. |
|
8658 |
! |
|
8659 |
||
8660 |
fileName:aFilename1 startsWith:aFilename2 |
|
6284 | 8661 |
" check if aFilename2 is a prefix of aFilename1" |
3892 | 8662 |
|
8663 |
| file1 file2 | |
|
8664 |
||
6284 | 8665 |
(aFilename2 isNil or:[aFilename1 isNil]) ifTrue:[ ^ false]. |
3892 | 8666 |
file1 := aFilename1 asFilename. |
8667 |
file2 := aFilename2 asFilename. |
|
6284 | 8668 |
|
3892 | 8669 |
file2 isRootDirectory ifTrue:[ ^ true]. |
6284 | 8670 |
|
3892 | 8671 |
((file1 isDirectory) |
8672 |
and:[(file2 isDirectory) |
|
8673 |
and:[file1 directory = file2 directory]]) ifTrue:[ |
|
4414 | 8674 |
^ file1 baseName = file2 baseName |
3892 | 8675 |
]. |
3982 | 8676 |
^ (file1 pathName) startsWith:(file2 pathName) |
3892 | 8677 |
! |
8678 |
||
8679 |
getAllFilesAsStringCollection |
|
5009 | 8680 |
self |
8681 |
applicationNamed:#DirectoryContentsBrowser |
|
8682 |
ifPresentDo:[:appl | ^ appl getAllFilesAsStringCollection]. |
|
8683 |
||
8684 |
^ nil |
|
3892 | 8685 |
! |
8686 |
||
8687 |
getBestDirectory |
|
8688 |
||
8689 |
|selFiles stringCol firstPre| |
|
8690 |
||
6725 | 8691 |
selFiles := self currentSelectedDirectories. |
3892 | 8692 |
selFiles isEmpty ifTrue:[^ nil]. |
8693 |
selFiles size == 1 ifTrue:[^ selFiles first]. |
|
4486 | 8694 |
stringCol := (selFiles collect:[:file| file asString]) asOrderedCollection. |
3892 | 8695 |
firstPre := stringCol at:1. |
8696 |
stringCol from:2 do:[:el| |
|
4414 | 8697 |
firstPre := firstPre commonPrefixWith:el. |
3892 | 8698 |
]. |
8699 |
(firstPre endsWith:(OperatingSystem fileSeparator)) ifTrue:[ |
|
4414 | 8700 |
firstPre removeLast. |
3892 | 8701 |
]. |
8702 |
^ firstPre asFilename |
|
8703 |
! |
|
8704 |
||
8705 |
getDirWithoutFileName:aFileName |
|
8706 |
||
8707 |
| dir | |
|
8708 |
aFileName isNil ifTrue:[ |
|
4414 | 8709 |
^ aFileName. |
3892 | 8710 |
]. |
8711 |
dir := aFileName asFilename. |
|
8712 |
dir isDirectory ifFalse:[ |
|
4414 | 8713 |
dir := dir directory. |
3892 | 8714 |
]. |
8715 |
^ dir. |
|
8716 |
! |
|
8717 |
||
8718 |
getInfoItem |
|
8719 |
"get filename of a description-file (.dir.info, README etc.); |
|
8720 |
This file is automatically shown when a directory is enterred. |
|
8721 |
You can add more names below if you like." |
|
8722 |
||
5880 | 8723 |
|dir| |
8724 |
||
8725 |
dir := self theSingleSelectedDirectoryOrNil. |
|
8726 |
dir isNil ifTrue:[ ^ nil]. |
|
3892 | 8727 |
|
8728 |
#( |
|
8729 |
'.dir.info' |
|
8730 |
'README' |
|
8731 |
'ReadMe' |
|
8732 |
'Readme' |
|
8733 |
'readme' |
|
8734 |
'read.me' |
|
8735 |
'Read.me' |
|
8736 |
'READ.ME' |
|
8737 |
'README.TXT' |
|
8738 |
'readme.txt' |
|
8739 |
'Readme.txt' |
|
8740 |
'Info.txt' |
|
8741 |
'info.txt' |
|
8742 |
'INFO.TXT' |
|
8743 |
) do:[:f | |
|
5883 | 8744 |
|n| |
4414 | 8745 |
|
5880 | 8746 |
n := dir construct:f. |
4414 | 8747 |
(n isReadable and:[n isDirectory not]) ifTrue:[ |
8748 |
^ DirectoryContentsBrowser itemClass fileName:n |
|
8749 |
] |
|
3892 | 8750 |
]. |
8751 |
^ nil |
|
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8752 |
! |
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8753 |
|
12497 | 8754 |
hasPackageDirectorySelected |
8755 |
|dir| |
|
8756 |
||
8757 |
dir := self currentDirectory. |
|
8758 |
^ dir notNil |
|
8759 |
and:[ dir exists |
|
8760 |
and:[ (dir / 'abbrev.stc') exists ]] |
|
8761 |
! |
|
8762 |
||
4881
e6fc72aac6e6
multiple select allowed in DirectoryTreeBrowser some changes in DirectoryContentsBrowser
penk
parents:
4880
diff
changeset
|
8763 |
parentDirectoriesOfCurrentFiles |
11743 | 8764 |
^ self currentSelectedObjects |
8765 |
collect:[:file | file directory] as:Set |
|
7560 | 8766 |
|
8767 |
"Modified: / 04-12-2006 / 13:15:21 / cg" |
|
6521 | 8768 |
! |
8769 |
||
8770 |
recursiveAnyFilesPresentWithSuffix:suffix |
|
6652 | 8771 |
^ true. "/ the code below is too slow for a menu enabling operation |
8772 |
||
8773 |
"/ |directories| |
|
8774 |
"/ |
|
8775 |
"/ directories := self currentDirectories value. |
|
8776 |
"/ directories do:[:dir| |
|
8777 |
"/ [ |
|
8778 |
"/ dir recursiveDirectoryContentsDo:[:f | |
|
8779 |
"/ (f asFilename suffix = suffix) ifTrue:[ ^ true] |
|
8780 |
"/ ] |
|
8781 |
"/ ] on:FileStream openErrorSignal do:[:ex|]. |
|
8782 |
"/ ]. |
|
8783 |
"/ ^ false. |
|
6586 | 8784 |
! |
8785 |
||
8786 |
recursiveAnySTFilesPresent |
|
8787 |
^ self recursiveAnyFilesPresentWithSuffix:'st' |
|
3982 | 8788 |
! ! |
8789 |
||
8790 |
!AbstractFileBrowser methodsFor:'selection'! |
|
8791 |
||
8792 |
currentSelectedDirectories |
|
6725 | 8793 |
^ self currentDirectoriesValue. |
3982 | 8794 |
! |
8795 |
||
8796 |
currentSelectedFiles |
|
12824 | 8797 |
^ self currentSelectedObjects reject:[:file | file isDirectory]. |
7560 | 8798 |
|
8799 |
"Modified: / 04-12-2006 / 13:14:39 / cg" |
|
3982 | 8800 |
! |
8801 |
||
6460 | 8802 |
currentSelectedObjects |
8803 |
^ self currentFileNameHolder value |
|
8804 |
! |
|
8805 |
||
3982 | 8806 |
firstSelectedFile |
7560 | 8807 |
^ self currentSelectedObjects |
12102 | 8808 |
detect:[:file | (file ? '') asFilename isDirectory not] |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8809 |
ifNone:[]. |
7560 | 8810 |
|
8811 |
"Modified: / 04-12-2006 / 13:14:50 / cg" |
|
4414 | 8812 |
! |
8813 |
||
9490 | 8814 |
hasOnlyDirectoriesSelected |
8815 |
^ self currentSelectedObjects conform:[:file | file isDirectory]. |
|
8816 |
||
8817 |
"Created: / 20-05-2010 / 10:45:03 / cg" |
|
8818 |
! |
|
8819 |
||
4414 | 8820 |
hasOnlyFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8821 |
|
7560 | 8822 |
^ self currentSelectedObjects conform:[:file | file isDirectory not]. |
8823 |
||
8824 |
"Modified: / 04-12-2006 / 13:15:01 / cg" |
|
4414 | 8825 |
! |
8826 |
||
9490 | 8827 |
hasTwoDirectoriesSelected |
8828 |
||
8829 |
^ self currentSelectedObjects size == 2 |
|
8830 |
and:[self hasOnlyDirectoriesSelected] |
|
8831 |
||
8832 |
"Created: / 20-05-2010 / 10:45:18 / cg" |
|
8833 |
! |
|
8834 |
||
4414 | 8835 |
hasTwoFilesSelected |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8836 |
|
7560 | 8837 |
^ self currentSelectedObjects size == 2 |
5374
c654db6e8c37
Save bookmarks - as documented - in home directory
Stefan Vogel <sv@exept.de>
parents:
5366
diff
changeset
|
8838 |
and:[self hasOnlyFilesSelected] |
7560 | 8839 |
|
8840 |
"Modified: / 04-12-2006 / 13:15:04 / cg" |
|
3892 | 8841 |
! ! |
8842 |
||
3964 | 8843 |
!AbstractFileBrowser methodsFor:'sorting'! |
8844 |
||
3989 | 8845 |
currentSortOrder |
4027 | 8846 |
^ self aspectFor:#currentSortOrder ifAbsent:[ Dictionary new asValue ]. |
3989 | 8847 |
! |
8848 |
||
8849 |
sortBlockHolder |
|
8850 |
^ self aspectFor:#sortBlockHolder ifAbsent:[ |
|
5383 | 8851 |
(FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8852 |
selector:#fileName |
|
8853 |
sortCaseless:self sortCaseless value |
|
8854 |
sortReverse:false) asValue. |
|
3989 | 8855 |
]. |
8856 |
! |
|
8857 |
||
8858 |
sortBlockProperty |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8859 |
|v| |
4027 | 8860 |
|
6785
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8861 |
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
|
8862 |
v addDependent:self. |
cac8107d889c
clear reverseSort flag, when sort-order is changed via menu.
Claus Gittinger <cg@exept.de>
parents:
6767
diff
changeset
|
8863 |
^ v. |
3989 | 8864 |
! |
8865 |
||
8866 |
sortCaseless |
|
4201 | 8867 |
" aspect for sort caseless " |
3989 | 8868 |
|
8869 |
^ self aspectFor:#sortCaseless ifAbsent:[ |
|
9393 | 8870 |
(Filename isCaseSensitive not) asValue. |
8871 |
] |
|
3989 | 8872 |
! |
8873 |
||
4074 | 8874 |
sortDirectoriesBeforeFiles |
8875 |
||
4201 | 8876 |
" aspect for sort directories always before files" |
4074 | 8877 |
^ self aspectFor:#sortDirectoriesBeforeFiles ifAbsent:[ true asValue ]. |
8878 |
! |
|
8879 |
||
3989 | 8880 |
sortFileListsBy:instanceName |
8881 |
||
8882 |
self sortFileListsBy:instanceName withReverse:true |
|
8883 |
! |
|
8884 |
||
8885 |
sortFileListsBy:instanceName withReverse:aBoolean |
|
8994
b14c9dd8a662
comment/format in: #sortFileListsBy:withReverse:
Claus Gittinger <cg@exept.de>
parents:
8950
diff
changeset
|
8886 |
| aSymbol sortCaselessLocal currentSortOrder sorter isReverse| |
3964 | 8887 |
|
8888 |
aSymbol := instanceName asSymbol. |
|
4027 | 8889 |
self sortBlockProperty setValue:instanceName asSymbol. |
4151 | 8890 |
sortCaselessLocal := self sortCaseless value. |
4027 | 8891 |
currentSortOrder := self currentSortOrder value. |
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8892 |
currentSortOrder isEmptyOrNil ifTrue:[ |
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8893 |
self currentSortOrder value:(currentSortOrder := Dictionary new). |
4343 | 8894 |
currentSortOrder at:#column put:aSymbol. |
8895 |
currentSortOrder at:#reverse put:false. |
|
8896 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
3964 | 8897 |
] ifFalse:[ |
4343 | 8898 |
(currentSortOrder at:#sortCaseless) ~= sortCaselessLocal ifTrue:[ |
8899 |
"/ sort caseless changed |
|
8900 |
currentSortOrder at:#sortCaseless put:sortCaselessLocal. |
|
8901 |
] ifFalse:[ |
|
8902 |
(currentSortOrder at:#column) = aSymbol ifTrue:[ |
|
8903 |
"/ same column like before - change sort order ifReverse is true |
|
8904 |
aBoolean ifTrue:[ |
|
8905 |
isReverse := currentSortOrder at:#reverse. |
|
8906 |
currentSortOrder at:#reverse put:(isReverse not). |
|
8907 |
]. |
|
8908 |
] ifFalse:[ |
|
8909 |
"/ another column - remark column |
|
8910 |
currentSortOrder at:#column put:aSymbol. |
|
8911 |
] |
|
8912 |
] |
|
3964 | 8913 |
]. |
4027 | 8914 |
self currentSortOrder changed. |
9111
4566dd920e09
changes for better FileDialog
Claus Gittinger <cg@exept.de>
parents:
9108
diff
changeset
|
8915 |
|
5383 | 8916 |
sorter := FileSorter directoriesBeforeFiles:(self sortDirectoriesBeforeFiles value and:[self viewDirsInContentsBrowser value]) |
8917 |
selector:instanceName |
|
8918 |
sortCaseless:sortCaselessLocal |
|
8919 |
sortReverse:(currentSortOrder at:#reverse). |
|
8920 |
self sortBlockHolder value:sorter. |
|
7841
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8921 |
|
ea9a45f1cd5e
oops - repair bad currentSorter
Claus Gittinger <cg@exept.de>
parents:
7829
diff
changeset
|
8922 |
"Modified: / 18-09-2007 / 09:42:47 / cg" |
3964 | 8923 |
! ! |
8924 |
||
3892 | 8925 |
!AbstractFileBrowser methodsFor:'startup & release'! |
8926 |
||
8927 |
makeDependent |
|
4074 | 8928 |
self filterModel addDependent:self. |
4004 | 8929 |
self currentFileNameHolder addDependent:self. |
4074 | 8930 |
self sortDirectoriesBeforeFiles addDependent:self. |
4004 | 8931 |
self sortCaseless addDependent:self. |
4011 | 8932 |
self showHiddenFiles addDependent:self. |
4368
ec625478fad7
remark root and selection for every change in classvar
penk
parents:
4367
diff
changeset
|
8933 |
self rootHolder addDependent:self. |
3892 | 8934 |
! |
8935 |
||
8936 |
masterApplication:anApplication |
|
8937 |
||
8938 |
masterApplication isNil ifTrue:[ |
|
4414 | 8939 |
(anApplication notNil and:[anApplication askFor:#isAbstractFileBrowser]) ifTrue:[ |
8940 |
aspects := anApplication aspects |
|
8941 |
] ifFalse:[ |
|
8942 |
aspects isNil ifTrue:[ |
|
8943 |
aspects := IdentityDictionary new. |
|
8944 |
aspects at:#applications put:(IdentityDictionary new). |
|
8945 |
] |
|
8946 |
]. |
|
8947 |
self applications at:(self className) put:self. |
|
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8948 |
"/ self makeDependent. |
3892 | 8949 |
]. |
3952 | 8950 |
^ super masterApplication:anApplication. |
3892 | 8951 |
! |
8952 |
||
4800
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8953 |
postBuildWith:aBuilder |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8954 |
self makeDependent. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8955 |
super postBuildWith:aBuilder. |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8956 |
! |
56854b83f710
subAppAspects - to be continued
Claus Gittinger <cg@exept.de>
parents:
4789
diff
changeset
|
8957 |
|
3892 | 8958 |
postOpenWith:aBuilder |
8959 |
||
8960 |
super postOpenWith:aBuilder. |
|
6829
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8961 |
self windowGroup showWaitCursorWhenBusyForMillis:100. |
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8962 |
|
3bcad14c59fc
wait-cursor -> activity indication
Claus Gittinger <cg@exept.de>
parents:
6785
diff
changeset
|
8963 |
"Modified: / 25-07-2006 / 09:12:45 / cg" |
3892 | 8964 |
! ! |
8965 |
||
8966 |
!AbstractFileBrowser::Clipboard methodsFor:'accessing'! |
|
8967 |
||
8968 |
files |
|
8969 |
"return the value of the instance variable 'files' (automatically generated)" |
|
8970 |
||
8971 |
^ files |
|
8972 |
! |
|
8973 |
||
8974 |
files:something |
|
8975 |
"set the value of the instance variable 'files' (automatically generated)" |
|
8976 |
||
8977 |
files := something. |
|
8978 |
! |
|
8979 |
||
8980 |
method |
|
8981 |
"return the value of the instance variable 'method' (automatically generated)" |
|
8982 |
||
8983 |
^ method |
|
8984 |
! |
|
8985 |
||
8986 |
method:something |
|
8987 |
"set the value of the instance variable 'method' (automatically generated)" |
|
8988 |
||
8989 |
method := something. |
|
8990 |
! ! |
|
8991 |
||
8992 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'accessing'! |
|
8993 |
||
8994 |
locked |
|
8995 |
"return the value of the instance variable 'locked' (automatically generated)" |
|
8996 |
||
8997 |
locked isNil ifTrue:[ |
|
4414 | 8998 |
locked := false. |
3892 | 8999 |
]. |
9000 |
^ locked |
|
9001 |
! ! |
|
9002 |
||
9003 |
!AbstractFileBrowser::CodeExecutionLock methodsFor:'actions'! |
|
9004 |
||
9005 |
doIfUnLocked:aBlock |
|
9006 |
||
9007 |
self locked ifFalse:[ |
|
4414 | 9008 |
aBlock value. |
3892 | 9009 |
]. |
9010 |
! |
|
9011 |
||
9012 |
doLocked:aBlock |
|
9013 |
||
9014 |
locked := true. |
|
4004 | 9015 |
aBlock ensure:[ |
4414 | 9016 |
locked := false. |
4004 | 9017 |
] |
3892 | 9018 |
! ! |
9019 |
||
3952 | 9020 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'defaults'! |
9021 |
||
6369 | 9022 |
defaultHistorySize |
9023 |
^ 50 |
|
3892 | 9024 |
! ! |
9025 |
||
6371 | 9026 |
!AbstractFileBrowser::DirectoryHistory class methodsFor:'instance creation'! |
4032 | 9027 |
|
9028 |
new |
|
6371 | 9029 |
^ (super new) initializeHistory. |
6369 | 9030 |
! ! |
9031 |
||
9032 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'accessing'! |
|
9033 |
||
9034 |
historySize |
|
9035 |
historySize isNil ifTrue:[^ self class defaultHistorySize]. |
|
9036 |
^ historySize |
|
9037 |
! |
|
9038 |
||
9039 |
historySize:aNumber |
|
9040 |
historySize := aNumber |
|
4032 | 9041 |
! ! |
9042 |
||
3892 | 9043 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'actions'! |
9044 |
||
3952 | 9045 |
addToHistory:aPath |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9046 |
| item pathToAdd | |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9047 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9048 |
pathToAdd := aPath. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9049 |
(pathToAdd endsWith:(Filename separator)) ifTrue:[ |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9050 |
pathToAdd asFilename isRootDirectory ifFalse:[ |
12707
6e9276c4fc95
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12684
diff
changeset
|
9051 |
pathToAdd := pathToAdd copyButLast:(Filename separator asString size). |
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9052 |
] |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9053 |
]. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9054 |
|
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9055 |
item := self getItemFor:pathToAdd. |
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9056 |
self backForwardListAdd:pathToAdd. |
3952 | 9057 |
item isNil ifTrue:[ |
4347 | 9058 |
" not already in history" |
6369 | 9059 |
self size >= self historySize ifTrue:[ |
4347 | 9060 |
self removeLast. |
9061 |
]. |
|
7566
3e92cf7a6706
ignore trailing file-separator in history.
Claus Gittinger <cg@exept.de>
parents:
7565
diff
changeset
|
9062 |
item := DirectoryHistoryItem path:pathToAdd. |
3952 | 9063 |
] ifFalse:[ |
4347 | 9064 |
"already been there before; move the entry to |
9065 |
the beginning, so it will fall out later." |
|
9066 |
self remove:item. |
|
10381
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9067 |
]. |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9068 |
self addFirst:item |
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9069 |
|
ad4b61b0b2fd
duplicate code in if refactored
Claus Gittinger <cg@exept.de>
parents:
10306
diff
changeset
|
9070 |
"Modified: / 24-07-2011 / 07:12:54 / cg" |
3952 | 9071 |
! |
9072 |
||
4347 | 9073 |
backForwardListAdd:aPath |
9074 |
|pathIndex| |
|
9075 |
||
9076 |
pathIndex := backForwardList indexOf:aPath. |
|
9077 |
pathIndex == 0 ifTrue:[ |
|
9078 |
" a new path comes in remove forward paths " |
|
9079 |
(backForwardList size) > backForwardIndex ifTrue:[ |
|
9080 |
backForwardList removeFromIndex:(backForwardIndex + 1) toIndex:(backForwardList size). |
|
9081 |
]. |
|
9082 |
] ifFalse:[ |
|
9083 |
backForwardList remove:aPath. |
|
9084 |
pathIndex <= backForwardIndex ifTrue:[ |
|
9085 |
backForwardIndex := backForwardIndex - 1. |
|
9086 |
] |
|
4022 | 9087 |
]. |
4347 | 9088 |
backForwardList add:aPath afterIndex:backForwardIndex. |
9089 |
backForwardIndex := backForwardIndex + 1. |
|
6369 | 9090 |
backForwardIndex > self historySize ifTrue:[ |
4347 | 9091 |
backForwardList removeFirst. |
9092 |
backForwardIndex := backForwardIndex - 1. |
|
3892 | 9093 |
]. |
4347 | 9094 |
! |
9095 |
||
9096 |
goBackward |
|
4288 | 9097 |
"return the first path of the backward list; |
9098 |
remove it from the back list and add it ti the forward list." |
|
4022 | 9099 |
|
4347 | 9100 |
|retPath| |
9101 |
||
9102 |
self canBackward ifTrue:[ |
|
9103 |
retPath := backForwardList at:(backForwardIndex - 1). |
|
9104 |
backForwardIndex := backForwardIndex - 1. |
|
4288 | 9105 |
]. |
4022 | 9106 |
^ retPath. |
9107 |
! |
|
9108 |
||
9109 |
goForward |
|
4288 | 9110 |
"return the first path of the forward list; |
9111 |
remove it from the list." |
|
4022 | 9112 |
|
4347 | 9113 |
|retPath| |
9114 |
||
9115 |
self canForward ifTrue:[ |
|
9116 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9117 |
backForwardIndex := backForwardIndex + 1. |
|
4288 | 9118 |
]. |
4022 | 9119 |
^ retPath. |
9120 |
! |
|
9121 |
||
9122 |
resetForwardBackward |
|
9123 |
||
4347 | 9124 |
self initialize |
4022 | 9125 |
! |
9126 |
||
9127 |
setPosition:aPosition for:aPath |
|
9128 |
||
9129 |
self do:[:item| |
|
4414 | 9130 |
item path = aPath ifTrue:[ |
9131 |
item position:aPosition. |
|
9132 |
] |
|
4022 | 9133 |
]. |
3892 | 9134 |
! ! |
9135 |
||
4870 | 9136 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'initialization'! |
4032 | 9137 |
|
6371 | 9138 |
initializeHistory |
4032 | 9139 |
|
4347 | 9140 |
backForwardList := OrderedCollection new. |
9141 |
self reverseDo:[:el| |
|
9142 |
backForwardList add:el path. |
|
9143 |
]. |
|
9144 |
backForwardIndex := backForwardList size. |
|
4032 | 9145 |
! ! |
9146 |
||
3892 | 9147 |
!AbstractFileBrowser::DirectoryHistory methodsFor:'queries'! |
9148 |
||
4288 | 9149 |
canBackward |
4347 | 9150 |
|
9151 |
^ backForwardIndex > 1 |
|
4288 | 9152 |
! |
9153 |
||
3892 | 9154 |
canForward |
4347 | 9155 |
|
9156 |
^ (backForwardList size >= (backForwardIndex + 1)) |
|
9157 |
! |
|
9158 |
||
9159 |
getBackCollection |
|
9160 |
||
9161 |
| backCol | |
|
9162 |
||
9163 |
backCol := OrderedCollection new. |
|
9164 |
self canBackward ifTrue:[ |
|
9165 |
| tmpCol | |
|
9166 |
tmpCol := backForwardList copyTo:backForwardIndex - 1. |
|
9167 |
tmpCol reverseDo:[ :el| |
|
9168 |
backCol add:el. |
|
9169 |
] |
|
9170 |
]. |
|
9171 |
^ backCol |
|
3952 | 9172 |
! |
9173 |
||
9174 |
getForwardCollection |
|
9175 |
||
4347 | 9176 |
| forwCol | |
9177 |
||
9178 |
forwCol := OrderedCollection new. |
|
9179 |
self canForward ifTrue:[ |
|
9180 |
forwCol := backForwardList copyFrom:(backForwardIndex + 1) |
|
9181 |
]. |
|
9182 |
^ forwCol |
|
3952 | 9183 |
! |
9184 |
||
9185 |
getItemFor:aPath |
|
6627 | 9186 |
^ self detect:[:item| item path = aPath] ifNone:nil. |
9187 |
"/ self do:[:item| item path = aPath ifTrue:[^ item]]. |
|
9188 |
"/ ^ nil. |
|
3952 | 9189 |
! |
9190 |
||
9191 |
getPositionFor:aPath |
|
9192 |
||
9193 |
|item| |
|
9194 |
||
9195 |
item := self getItemFor:aPath. |
|
9196 |
||
9197 |
item notNil ifTrue:[ |
|
4414 | 9198 |
^ item position. |
3952 | 9199 |
]. |
9200 |
^ nil |
|
9201 |
! |
|
9202 |
||
9203 |
includesPath:aPath |
|
6627 | 9204 |
^ self contains:[:item | item path = aPath]. |
9205 |
||
9206 |
"/ self do:[:item| item path = aPath ifTrue:[^ true]]. |
|
9207 |
"/ ^ false. |
|
4347 | 9208 |
! |
9209 |
||
9210 |
nextBackwardItem |
|
9211 |
"return the first path of the backward list" |
|
9212 |
||
9213 |
|retPath| |
|
9214 |
||
9215 |
self canBackward ifTrue:[ |
|
9216 |
retPath := backForwardList at:backForwardIndex. |
|
9217 |
]. |
|
9218 |
^ retPath. |
|
9219 |
! |
|
9220 |
||
9221 |
nextForwardItem |
|
9222 |
"return the first path of the forward list" |
|
9223 |
||
9224 |
|retPath| |
|
9225 |
||
9226 |
self canForward ifTrue:[ |
|
9227 |
retPath := backForwardList at:backForwardIndex + 1. |
|
9228 |
]. |
|
9229 |
^ retPath. |
|
3952 | 9230 |
! ! |
9231 |
||
9232 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem class methodsFor:'instance creation'! |
|
9233 |
||
9234 |
path:aPath |
|
9235 |
||
9236 |
^ self new path:aPath |
|
9237 |
! ! |
|
9238 |
||
9239 |
!AbstractFileBrowser::DirectoryHistory::DirectoryHistoryItem methodsFor:'accessing'! |
|
9240 |
||
6433 | 9241 |
asFilename |
9242 |
^ path asFilename |
|
9243 |
! |
|
9244 |
||
3952 | 9245 |
path |
9246 |
"return the value of the instance variable 'path' (automatically generated)" |
|
9247 |
||
9248 |
^ path |
|
9249 |
! |
|
9250 |
||
9251 |
path:something |
|
9252 |
"set the value of the instance variable 'path' (automatically generated)" |
|
9253 |
||
9254 |
path := something. |
|
9255 |
! |
|
9256 |
||
9257 |
position |
|
9258 |
"return the value of the instance variable 'position' (automatically generated)" |
|
9259 |
||
9260 |
^ position |
|
9261 |
! |
|
9262 |
||
9263 |
position:something |
|
9264 |
"set the value of the instance variable 'position' (automatically generated)" |
|
9265 |
||
9266 |
position := something. |
|
9267 |
! |
|
9268 |
||
9269 |
printString |
|
9270 |
||
9271 |
^ self path asString |
|
3892 | 9272 |
! ! |
9273 |
||
9274 |
!AbstractFileBrowser::SaveAspectItem class methodsFor:'instance creation'! |
|
9275 |
||
9276 |
withValue:aValue isHolder:aBoolean |
|
9277 |
||
9278 |
| instance | |
|
9279 |
||
9280 |
instance := self basicNew. |
|
9281 |
instance value:aValue. |
|
9282 |
instance isHolder:aBoolean. |
|
9283 |
^ instance |
|
9284 |
! ! |
|
9285 |
||
9286 |
!AbstractFileBrowser::SaveAspectItem methodsFor:'accessing'! |
|
9287 |
||
9288 |
isHolder |
|
9289 |
"return the value of the instance variable 'isHolder' (automatically generated)" |
|
9290 |
||
9291 |
^ isHolder |
|
9292 |
! |
|
9293 |
||
9294 |
isHolder:something |
|
9295 |
"set the value of the instance variable 'isHolder' (automatically generated)" |
|
9296 |
||
9297 |
isHolder := something. |
|
9298 |
! |
|
9299 |
||
9300 |
value |
|
9301 |
"return the value of the instance variable 'value' (automatically generated)" |
|
9302 |
||
9303 |
^ value |
|
9304 |
! |
|
9305 |
||
9306 |
value:something |
|
9307 |
"set the value of the instance variable 'value' (automatically generated)" |
|
9308 |
||
9309 |
value := something. |
|
9310 |
! ! |
|
9311 |
||
9312 |
!AbstractFileBrowser class methodsFor:'documentation'! |
|
9313 |
||
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9314 |
version |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
9315 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.528 2013-06-07 09:58:31 cg Exp $' |
10305
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9316 |
! |
58cfe23bd6cd
changed: #fileFindDuplicateFile
Claus Gittinger <cg@exept.de>
parents:
10304
diff
changeset
|
9317 |
|
8832 | 9318 |
version_CVS |
12874
f08360e7ac62
oops - startup did not enable directoryUp
Claus Gittinger <cg@exept.de>
parents:
12871
diff
changeset
|
9319 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileBrowser.st,v 1.528 2013-06-07 09:58:31 cg Exp $' |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
9320 |
! |
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
9321 |
|
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
9322 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
9323 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
9324 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
9325 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
9326 |
|
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
9327 |
version_SVN |
12315 | 9328 |
^ '$Id: AbstractFileBrowser.st 8084 2013-01-14 12:06:02Z vranyj1 $' |
3892 | 9329 |
! ! |
12094 | 9330 |