author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 19418 | baa308d1ad87 |
child 19502 | 329089e25915 |
permissions | -rw-r--r-- |
13818 | 1 |
" |
2 |
COPYRIGHT (c) 2006 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 |
" |
|
11105 | 12 |
"{ Package: 'stx:libtool' }" |
13 |
||
15245
824d31e08f0f
class: DirectoryDifferenceViewApplication
Claus Gittinger <cg@exept.de>
parents:
14500
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
824d31e08f0f
class: DirectoryDifferenceViewApplication
Claus Gittinger <cg@exept.de>
parents:
14500
diff
changeset
|
15 |
|
11105 | 16 |
AbstractFileFinderApplicationComponent subclass:#DirectoryDifferenceViewApplication |
17 |
instanceVariableNames:'directory1Holder directory2Holder directory1 directory2 |
|
18 |
filesOnlyInDirectory1 filesOnlyInDirectory2 |
|
19 |
filesWhichAreDifferent directoriesOnlyInDirectory1 |
|
11121 | 20 |
directoriesOnlyInDirectory2 namePatternHolder |
18978 | 21 |
excludedNamePatternHolder excludedDirectoryNamePatternHolder |
22 |
ignoreCaseInNameHolder ignoreCaseInExcludedNameHolder |
|
23 |
ignoreCaseInExcludedDirectoryNameHolder |
|
24 |
ignoreCaseInDirectoryNameHolder filesSkippedCount |
|
18980 | 25 |
directoriesSkippedCount unfilteredFilesList filteredFilesList |
26 |
hasResultListHolder itemsFoundQueue showWhatHolder' |
|
11105 | 27 |
classVariableNames:'' |
28 |
poolDictionaries:'' |
|
29 |
category:'Interface-Tools-File' |
|
30 |
! |
|
31 |
||
13818 | 32 |
!DirectoryDifferenceViewApplication class methodsFor:'documentation'! |
33 |
||
34 |
copyright |
|
35 |
" |
|
36 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
37 |
All Rights Reserved |
|
38 |
||
39 |
This software is furnished under a license and may be used |
|
40 |
only in accordance with the terms of that license and with the |
|
41 |
inclusion of the above copyright notice. This software may not |
|
42 |
be provided or otherwise made available to, or used by, any |
|
43 |
other person. No title to or ownership of the software is |
|
44 |
hereby transferred. |
|
45 |
" |
|
18978 | 46 |
! |
47 |
||
48 |
documentation |
|
49 |
" |
|
50 |
documentation to be added. |
|
51 |
||
52 |
class: |
|
53 |
<a short class summary here, describing what instances represent> |
|
54 |
||
55 |
responsibilities: |
|
56 |
<describing what my main role is> |
|
57 |
||
58 |
collaborators: |
|
59 |
<describing with whom and how I talk to> |
|
60 |
||
61 |
API: |
|
62 |
<public api and main messages> |
|
63 |
||
64 |
example: |
|
65 |
<a one-line examples on how to use - can also be in a separate example method> |
|
66 |
||
67 |
implementation: |
|
68 |
<implementation points> |
|
69 |
||
70 |
[author:] |
|
71 |
exept MBP |
|
72 |
||
73 |
[instance variables:] |
|
74 |
||
75 |
[class variables:] |
|
76 |
||
77 |
[see also:] |
|
78 |
||
79 |
" |
|
80 |
! |
|
81 |
||
82 |
examples |
|
83 |
" |
|
84 |
Notice that everything between [exBegin] and [exEnd] is extracted by the html-doc generator |
|
85 |
to create nicely formatted and clickable executable examples in the generated html-doc. |
|
86 |
(see the browser's class-documentation menu items for more) |
|
87 |
||
88 |
opening the application: |
|
89 |
[exBegin] |
|
90 |
DirectoryDifferenceViewApplication open |
|
91 |
[exEnd] |
|
92 |
||
93 |
opening the application on some model: |
|
94 |
[exBegin] |
|
95 |
DirectoryDifferenceViewApplication openOn:aModel |
|
96 |
[exEnd] |
|
97 |
" |
|
13818 | 98 |
! ! |
11105 | 99 |
|
11121 | 100 |
!DirectoryDifferenceViewApplication class methodsFor:'help specs'! |
101 |
||
17912 | 102 |
helpSpec |
11121 | 103 |
"This resource specification was automatically generated |
104 |
by the UIHelpTool of ST/X." |
|
105 |
||
106 |
"Do not manually edit this!! If it is corrupted, |
|
107 |
the UIHelpTool may not be able to read the specification." |
|
108 |
||
109 |
" |
|
18978 | 110 |
UIHelpTool openOnClass:DirectoryDifferenceViewApplication |
11121 | 111 |
" |
112 |
||
113 |
<resource: #help> |
|
114 |
||
17912 | 115 |
^ super helpSpec addPairsFrom:#( |
11121 | 116 |
|
18978 | 117 |
#excludedDirectoryNamePattern |
118 |
'Directory name(s) to skip.\Can be matchPatterns, separated by ";"' |
|
11121 | 119 |
|
120 |
#excludedNamePattern |
|
18978 | 121 |
'File name(s) to skip.\Can be matchPatterns, separated by ";"' |
122 |
||
123 |
#ignoreCaseInExcludedDirectoryName |
|
124 |
'Ignore case in directory name exclude pattern(s)' |
|
125 |
||
126 |
#ignoreCaseInExcludedName |
|
127 |
'Ignore case in file name exclude pattern(s)' |
|
128 |
||
129 |
#ignoreCaseInName |
|
130 |
'Ignore case in file name pattern(s)' |
|
131 |
||
132 |
#namePattern |
|
133 |
'Filename(s) to search for.\Can be matchPatterns, separated by ";".\(eg. "*.c ; *.h" searches for C and header files. So does "*.[ch]")' |
|
11121 | 134 |
|
135 |
#searchDirectory1 |
|
136 |
'The first folder, to be compared against folder2' |
|
137 |
||
138 |
#searchDirectory2 |
|
139 |
'The second folder, to be compared against folder1' |
|
140 |
||
18980 | 141 |
#showAll |
142 |
'Show all differences in the result list' |
|
143 |
||
144 |
#showDifferent |
|
145 |
'Show only files in the result list\which are present in both, but different' |
|
146 |
||
147 |
#showOnlyIn1 |
|
148 |
'Show only files in the result list\which are present in the first directory,\but missing in the second' |
|
149 |
||
150 |
#showOnlyIn2 |
|
151 |
'Show only files in the result list\which are present in the second directory,\but missing in the first' |
|
152 |
||
11121 | 153 |
) |
154 |
! ! |
|
155 |
||
18980 | 156 |
!DirectoryDifferenceViewApplication class methodsFor:'image specs'! |
157 |
||
158 |
leftOnlyIcon |
|
159 |
"This resource specification was automatically generated |
|
160 |
by the ImageEditor of ST/X." |
|
161 |
||
162 |
"Do not manually edit this!! If it is corrupted, |
|
163 |
the ImageEditor may not be able to read the specification." |
|
164 |
||
165 |
" |
|
166 |
self leftOnlyIcon inspect |
|
167 |
ImageEditor openOnClass:self andSelector:#leftOnlyIcon |
|
168 |
Icon flushCachedIcons |
|
169 |
" |
|
170 |
||
171 |
<resource: #image> |
|
172 |
||
173 |
^Icon |
|
174 |
constantNamed:'DirectoryDifferenceViewApplication class leftOnlyIcon' |
|
175 |
ifAbsentPut:[(Depth8Image width:24 height:24) bits:(ByteArray fromPackedString:' |
|
176 |
X6M#X6M#X6M#X6M#X&I"X&I"X&I"X&I"X6M#X6M#X6M#X6M#VE!!"X&I"X&I"X&I"X6M#X6M#X6M#X6MXA ]"X&I"X&I"X&I"X6M#X6M#X6M#X0(KC@5"X&I" |
|
177 |
X&I"X&I"X6M#X6M#X6M#A <PDP5"X&I"X&I"X&I"X6M#X6M#X1LSEADUE 5"X&I"X&I"X&I"X6M#X6M#D1LXE!!$ZD@5"X&I"X&I"X&I"X6M#X6MXA10]G!!<Z |
|
178 |
H@4MCP4MCP4MHRI"X6M#X0(#G"@$IRXZI2 (JATUEQTUBB%"X6M#A"(HER,%G20-K"<0LSD2L3P5M 5"X6L7NB 9G1<&KB4DAC(;OC0=O#=@PP5"X3\>P$L/ |
|
179 |
F!!(ZKPPDN#-DOA-EQ$\?R@5"X3]IR"XZKR4-A@P:N1 <O$-LST8TK 5"X6L!!S1H.ACD1L#(;Q@TCQ$YLQ48TT@5"X6M#TUH,P3(:N#P[T5QTUUYWQ$1WLP5" |
|
180 |
X6M#X5!!YL10;QDTCK3D1LSD1L#H;MB%"X6M#X6MXD38/U@MWL 4MCP4MCP4MJRM"X6M#X6M#VALON UFF@5"X&I"X&I"X&I"X6M#X6M#X5 SV30>W@5"X&I" |
|
181 |
X&I"X&I"X6M#X6M#X6MXTU5FU 5"X&I"X&I"X&I"X6M#X6M#X6M#X5!!_X@5"X&I"X&I"X&I"X6M#X6M#X6M#X6MXXP5"X&I"X&I"X&I"X6M#X6M#X6M#X6M# |
|
182 |
VE5"X&I"X&I"X&I"X6M#X6M#X6M#X6M#X&I"X&I"X&I"X&I"') |
|
183 |
colorMapFromArray:#[251 251 251 249 249 249 234 234 234 210 210 210 224 224 224 213 213 213 184 184 184 176 176 176 238 238 238 245 245 245 200 200 200 187 187 187 240 240 240 171 171 171 233 233 233 198 198 198 246 246 246 249 249 249 236 236 236 174 174 174 207 207 207 241 241 241 247 247 247 226 226 226 219 219 219 237 237 237 227 227 227 216 216 216 231 231 231 247 247 247 234 234 234 229 229 229 245 245 245 178 178 178 188 188 188 185 185 185 232 232 232 231 231 231 228 228 228 244 244 244 242 242 242 175 175 175 193 193 193 232 232 232 228 228 228 225 225 225 229 229 229 227 227 227 226 226 226 223 223 223 221 221 221 220 220 220 219 219 219 223 223 223 237 237 237 179 179 179 200 200 200 236 236 236 221 221 221 220 220 220 217 217 217 214 214 214 213 213 213 210 210 210 215 215 215 235 235 235 239 239 239 230 230 230 218 218 218 212 212 212 208 208 208 202 202 202 230 230 230 211 211 211 238 238 238 209 209 209 205 205 205 204 204 204 201 201 201 197 197 197 225 225 225 183 183 183 187 187 187 217 217 217 214 214 214 212 212 212 211 211 211 209 209 209 196 196 196 180 180 180 248 248 248 186 186 186 215 215 215 180 180 180 240 240 240 174 174 174 196 196 196 172 172 172 255 0 0 0 255 0] |
|
184 |
mask:((ImageMask width:24 height:24) bits:(ByteArray fromPackedString:'????????????????????????????????????????????????????????????????????????????????????????????????'); yourself); yourself] |
|
185 |
! |
|
186 |
||
187 |
rightOnlyIcon |
|
188 |
"This resource specification was automatically generated |
|
189 |
by the ImageEditor of ST/X." |
|
190 |
||
191 |
"Do not manually edit this!! If it is corrupted, |
|
192 |
the ImageEditor may not be able to read the specification." |
|
193 |
||
194 |
" |
|
195 |
self rightOnlyIcon inspect |
|
196 |
ImageEditor openOnClass:self andSelector:#rightOnlyIcon |
|
197 |
Icon flushCachedIcons |
|
198 |
" |
|
199 |
||
200 |
<resource: #image> |
|
201 |
||
202 |
^Icon |
|
203 |
constantNamed:'DirectoryDifferenceViewApplication class rightOnlyIcon' |
|
204 |
ifAbsentPut:[(Depth8Image width:24 height:24) bits:(ByteArray fromPackedString:' |
|
205 |
X&I"X&I"X&I"X&I"X6M#X6M#X6M#X6M#X&I"X&I"X&I"X%5XX6M#X6M#X6M#X6M#X&I"X&I"X&I"X 5!!VFM#X6M#X6M#X6M#X&I"X&I"X&I"X 5 W5!!#X6M# |
|
206 |
X6M#X6M#X&I"X&I"X&I"X 5VQ%5QVFM#X6M#X6M#X&I"X&I"X&I"X 5\O#1[D5!!#X6M#X6M#X&I"X&I"X&I"X 4XQ T:C1MXX6M#X6M#X"L)CP4MCP4MCP42 |
|
207 |
U0MTK38SVFM#X6M#X"$4N3H2LSD1LSD/@4UDN103VU!!#X6M#X 41U41FU5YUUEQSF3P:N#)CKEIQX6M#X 5PED9GSDYF@0UDN3(2LSDDK!!IOHVM#X 4.ED9M |
|
208 |
SD,>OA ;N PDKR4-F"YJRS]#X 5HO4]FQQ,<QC,:A@P-F!!(ZK4MBO#]#X 5APC<>OS0<N3(DAB4,I!!<_NR 8M6M#X 46MSP3L#D1LB<.KR0_IR,UBB(FX6M# |
|
209 |
X"$HEQTUEQT(JB ''F"X%IB@^H0)#X6M#X"H!!CP4MCP4MCP4 F!!<^GQ0GVFM#X6M#X&I"X&I"X&I"X 4PF!!$VFALSX6M#X6M#X&I"X&I"X&I"X 4VEQDTD1M# |
|
210 |
X6M#X6M#X&I"X&I"X&I"X 4QD@<FX6M#X6M#X6M#X&I"X&I"X&I"X 4LB0)#X6M#X6M#X6M#X&I"X&I"X&I"X \FVFM#X6M#X6M#X6M#X&I"X&I"X&I"X%!!X |
|
211 |
X6M#X6M#X6M#X6M#X&I"X&I"X&I"X&I"X6M#X6M#X6M#X6M#') |
|
212 |
colorMapFromArray:#[251 251 251 249 249 249 234 234 234 210 210 210 224 224 224 213 213 213 184 184 184 176 176 176 238 238 238 245 245 245 200 200 200 187 187 187 240 240 240 171 171 171 233 233 233 198 198 198 246 246 246 249 249 249 236 236 236 174 174 174 207 207 207 241 241 241 247 247 247 226 226 226 219 219 219 237 237 237 227 227 227 216 216 216 231 231 231 247 247 247 234 234 234 229 229 229 245 245 245 178 178 178 188 188 188 185 185 185 232 232 232 231 231 231 228 228 228 244 244 244 242 242 242 175 175 175 193 193 193 232 232 232 228 228 228 225 225 225 229 229 229 227 227 227 226 226 226 223 223 223 221 221 221 220 220 220 219 219 219 223 223 223 237 237 237 179 179 179 200 200 200 236 236 236 221 221 221 220 220 220 217 217 217 214 214 214 213 213 213 210 210 210 215 215 215 235 235 235 239 239 239 230 230 230 218 218 218 212 212 212 208 208 208 202 202 202 230 230 230 211 211 211 238 238 238 209 209 209 205 205 205 204 204 204 201 201 201 197 197 197 225 225 225 183 183 183 187 187 187 217 217 217 214 214 214 212 212 212 211 211 211 209 209 209 196 196 196 180 180 180 248 248 248 186 186 186 215 215 215 180 180 180 240 240 240 174 174 174 196 196 196 172 172 172 255 0 0 0 255 0] |
|
213 |
mask:((ImageMask width:24 height:24) bits:(ByteArray fromPackedString:'????????????????????????????????????????????????????????????????????????????????????????????????'); yourself); yourself] |
|
214 |
! ! |
|
215 |
||
11105 | 216 |
!DirectoryDifferenceViewApplication class methodsFor:'interface specs'! |
217 |
||
218 |
windowSpec |
|
219 |
"This resource specification was automatically generated |
|
220 |
by the UIPainter of ST/X." |
|
221 |
||
222 |
"Do not manually edit this!! If it is corrupted, |
|
223 |
the UIPainter may not be able to read the specification." |
|
224 |
||
225 |
" |
|
226 |
UIPainter new openOnClass:DirectoryDifferenceViewApplication andSelector:#windowSpec |
|
227 |
DirectoryDifferenceViewApplication new openInterface:#windowSpec |
|
228 |
DirectoryDifferenceViewApplication open |
|
229 |
" |
|
230 |
||
231 |
<resource: #canvas> |
|
232 |
||
233 |
^ |
|
18978 | 234 |
#(FullSpec |
235 |
name: windowSpec |
|
18980 | 236 |
uuid: '01d49d90-bac4-11e9-a284-10ddb1cc5928' |
18978 | 237 |
window: |
238 |
(WindowSpec |
|
239 |
label: 'Directory Diff' |
|
240 |
name: 'Directory Diff' |
|
241 |
uuid: '09a5b9c0-baa9-11e9-a284-10ddb1cc5928' |
|
242 |
min: (Point 377 131) |
|
243 |
bounds: (Rectangle 0 0 758 512) |
|
244 |
) |
|
245 |
component: |
|
246 |
(SpecCollection |
|
247 |
collection: ( |
|
248 |
(MenuPanelSpec |
|
18980 | 249 |
name: 'SearchToolBar' |
18978 | 250 |
layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
251 |
uuid: '09a5bd8a-baa9-11e9-a284-10ddb1cc5928' |
|
252 |
level: 0 |
|
253 |
menu: searchMenu |
|
254 |
textDefault: true |
|
255 |
) |
|
256 |
(ProgressIndicatorSpec |
|
257 |
name: 'ProgressIndicator1' |
|
258 |
layout: (LayoutFrame 125 0 11 0 231 0 21 0) |
|
259 |
uuid: '09a5c06e-baa9-11e9-a284-10ddb1cc5928' |
|
260 |
visibilityChannel: enableStop |
|
261 |
backgroundColor: (Color 0.0 67.0 67.0) |
|
262 |
showPercentage: false |
|
263 |
isActivityIndicator: true |
|
264 |
) |
|
265 |
(ViewSpec |
|
266 |
name: 'Box1' |
|
267 |
layout: (LayoutFrame 0 0.0 32 0 0 1.0 154 0) |
|
268 |
uuid: '09a5c2d0-baa9-11e9-a284-10ddb1cc5928' |
|
269 |
component: |
|
270 |
(SpecCollection |
|
271 |
collection: ( |
|
272 |
(LabelSpec |
|
273 |
label: 'Directory1:' |
|
274 |
name: 'DirectoryLabel' |
|
275 |
layout: (LayoutFrame 2 0 7 0 154 0 24 0) |
|
276 |
activeHelpKey: searchDirectory1 |
|
277 |
uuid: '09a5c42e-baa9-11e9-a284-10ddb1cc5928' |
|
278 |
translateLabel: true |
|
279 |
adjust: right |
|
280 |
) |
|
281 |
(FilenameInputFieldSpec |
|
282 |
name: 'DirectoryEntryField' |
|
283 |
layout: (LayoutFrame 156 0 4 0 0 1 24 0) |
|
284 |
activeHelpKey: searchDirectory1 |
|
285 |
uuid: '09a5c67c-baa9-11e9-a284-10ddb1cc5928' |
|
286 |
model: directory1Holder |
|
287 |
immediateAccept: true |
|
288 |
acceptOnPointerLeave: false |
|
289 |
) |
|
290 |
(LabelSpec |
|
291 |
label: 'Directory2:' |
|
292 |
name: 'Label2' |
|
293 |
layout: (LayoutFrame 2 0 31 0 154 0 48 0) |
|
294 |
activeHelpKey: searchDirectory2 |
|
295 |
uuid: '09a5ca00-baa9-11e9-a284-10ddb1cc5928' |
|
296 |
translateLabel: true |
|
297 |
adjust: right |
|
298 |
) |
|
299 |
(FilenameInputFieldSpec |
|
300 |
name: 'FilenameEntryField1' |
|
301 |
layout: (LayoutFrame 156 0 28 0 0 1 48 0) |
|
302 |
activeHelpKey: searchDirectory2 |
|
303 |
uuid: '09a5cb40-baa9-11e9-a284-10ddb1cc5928' |
|
304 |
model: directory2Holder |
|
305 |
immediateAccept: true |
|
306 |
acceptOnPointerLeave: false |
|
307 |
) |
|
308 |
(LabelSpec |
|
309 |
label: 'Compare Files Named:' |
|
310 |
name: 'FileNameLabel' |
|
311 |
layout: (LayoutFrame 2 0 55 0 154 0 72 0) |
|
312 |
activeHelpKey: namePattern |
|
313 |
uuid: '09a5ccda-baa9-11e9-a284-10ddb1cc5928' |
|
314 |
translateLabel: true |
|
315 |
adjust: right |
|
316 |
) |
|
317 |
(InputFieldSpec |
|
318 |
name: 'FileNameEntryField' |
|
319 |
layout: (LayoutFrame 156 0 52 0 -180 1 72 0) |
|
320 |
activeHelpKey: namePattern |
|
321 |
uuid: '09a5cdf2-baa9-11e9-a284-10ddb1cc5928' |
|
322 |
tabable: true |
|
323 |
model: namePatternHolder |
|
324 |
immediateAccept: true |
|
325 |
acceptOnLeave: false |
|
326 |
acceptOnPointerLeave: false |
|
327 |
) |
|
328 |
(CheckBoxSpec |
|
329 |
label: 'Ignore Case' |
|
330 |
name: 'IgnoreCaseInNameCheckBox' |
|
331 |
layout: (LayoutFrame -169 1 53 0 -4 1 76 0) |
|
332 |
activeHelpKey: ignoreCaseInName |
|
333 |
uuid: '09a5cfb4-baa9-11e9-a284-10ddb1cc5928' |
|
334 |
tabable: true |
|
335 |
model: ignoreCaseInNameHolder |
|
336 |
translateLabel: true |
|
337 |
) |
|
338 |
(LabelSpec |
|
339 |
label: 'But Not Named:' |
|
340 |
name: 'Label1' |
|
341 |
layout: (LayoutFrame 2 0 79 0 190 0 96 0) |
|
342 |
activeHelpKey: excludedNamePattern |
|
343 |
uuid: '09a5d16c-baa9-11e9-a284-10ddb1cc5928' |
|
344 |
translateLabel: true |
|
345 |
adjust: right |
|
346 |
) |
|
347 |
(InputFieldSpec |
|
348 |
name: 'EntryField1' |
|
349 |
layout: (LayoutFrame 190 0 76 0 -180 1 96 0) |
|
350 |
activeHelpKey: excludedNamePattern |
|
351 |
uuid: '09a5d284-baa9-11e9-a284-10ddb1cc5928' |
|
352 |
tabable: true |
|
353 |
model: excludedNamePatternHolder |
|
354 |
immediateAccept: true |
|
355 |
acceptOnLeave: false |
|
356 |
acceptOnPointerLeave: false |
|
357 |
) |
|
358 |
(CheckBoxSpec |
|
359 |
label: 'Ignore Case' |
|
360 |
name: 'CheckBox1' |
|
361 |
layout: (LayoutFrame -169 1 77 0 -4 1 100 0) |
|
362 |
activeHelpKey: ignoreCaseInExcludedName |
|
363 |
uuid: '09a5d414-baa9-11e9-a284-10ddb1cc5928' |
|
364 |
tabable: true |
|
365 |
model: ignoreCaseInExcludedNameHolder |
|
366 |
translateLabel: true |
|
367 |
) |
|
368 |
(LabelSpec |
|
369 |
label: 'Ignore Folders Named:' |
|
370 |
name: 'Label3' |
|
371 |
layout: (LayoutFrame 2 0 103 0 190 0 120 0) |
|
372 |
activeHelpKey: excludedDirectoryNamePattern |
|
373 |
uuid: '09a5d518-baa9-11e9-a284-10ddb1cc5928' |
|
374 |
translateLabel: true |
|
375 |
adjust: right |
|
376 |
) |
|
377 |
(InputFieldSpec |
|
378 |
name: 'EntryField2' |
|
379 |
layout: (LayoutFrame 190 0 100 0 -180 1 120 0) |
|
380 |
activeHelpKey: excludedDirectoryNamePattern |
|
381 |
uuid: '09a5d63a-baa9-11e9-a284-10ddb1cc5928' |
|
382 |
tabable: true |
|
383 |
model: excludedDirectoryNamePatternHolder |
|
384 |
immediateAccept: true |
|
385 |
acceptOnLeave: false |
|
386 |
acceptOnPointerLeave: false |
|
387 |
) |
|
388 |
(CheckBoxSpec |
|
389 |
label: 'Ignore Case' |
|
390 |
name: 'CheckBox2' |
|
391 |
layout: (LayoutFrame -169 1 101 0 -4 1 124 0) |
|
392 |
activeHelpKey: ignoreCaseInExcludedDirectoryName |
|
393 |
uuid: '09a5d7d4-baa9-11e9-a284-10ddb1cc5928' |
|
394 |
tabable: true |
|
395 |
model: ignoreCaseInExcludedDirectoryNameHolder |
|
396 |
translateLabel: true |
|
397 |
) |
|
11105 | 398 |
) |
399 |
) |
|
18978 | 400 |
) |
401 |
(VariableVerticalPanelSpec |
|
402 |
name: 'VariableVerticalPanel1' |
|
18980 | 403 |
layout: (LayoutFrame 0 0.0 154 0 0 1.0 0 1) |
18978 | 404 |
uuid: '09a5d914-baa9-11e9-a284-10ddb1cc5928' |
405 |
component: |
|
406 |
(SpecCollection |
|
407 |
collection: ( |
|
408 |
(DataSetSpec |
|
409 |
name: 'Table1' |
|
410 |
uuid: '09a5daa4-baa9-11e9-a284-10ddb1cc5928' |
|
411 |
model: selectionHolder |
|
412 |
hasHorizontalScrollBar: true |
|
413 |
hasVerticalScrollBar: true |
|
414 |
dataList: matchedFilesList |
|
18985 | 415 |
doubleClickSelector: fileListDoubleClick: |
18978 | 416 |
columnHolder: searchResultTable |
417 |
valueChangeSelector: fileSelected: |
|
418 |
multipleSelectOk: true |
|
18985 | 419 |
useIndex: true |
18978 | 420 |
) |
421 |
(ArbitraryComponentSpec |
|
422 |
name: 'DiffTextView' |
|
423 |
uuid: '09a5deaa-baa9-11e9-a284-10ddb1cc5928' |
|
424 |
hasHorizontalScrollBar: true |
|
425 |
hasVerticalScrollBar: true |
|
426 |
component: DiffTextView |
|
427 |
) |
|
11105 | 428 |
) |
429 |
) |
|
18978 | 430 |
handles: (Any 0.5 1.0) |
431 |
) |
|
11105 | 432 |
) |
433 |
) |
|
18978 | 434 |
) |
11105 | 435 |
! ! |
436 |
||
11123 | 437 |
!DirectoryDifferenceViewApplication class methodsFor:'menu specs'! |
438 |
||
439 |
searchMenu |
|
440 |
"This resource specification was automatically generated |
|
441 |
by the MenuEditor of ST/X." |
|
442 |
||
443 |
"Do not manually edit this!! If it is corrupted, |
|
444 |
the MenuEditor may not be able to read the specification." |
|
445 |
||
446 |
||
447 |
" |
|
448 |
MenuEditor new openOnClass:FindFileApplication andSelector:#searchMenu |
|
449 |
(Menu new fromLiteralArrayEncoding:(FindFileApplication searchMenu)) startUp |
|
450 |
" |
|
451 |
||
452 |
<resource: #menu> |
|
453 |
||
454 |
^ |
|
455 |
#(Menu |
|
456 |
( |
|
457 |
(MenuItem |
|
458 |
label: 'Search' |
|
459 |
itemValue: doSearch |
|
460 |
translateLabel: true |
|
461 |
isButton: true |
|
462 |
labelImage: (ResourceRetriever ToolbarIconLibrary searchFileIcon) |
|
463 |
) |
|
464 |
(MenuItem |
|
465 |
enabled: enableStop |
|
466 |
label: 'Stop' |
|
467 |
itemValue: stop |
|
468 |
translateLabel: true |
|
469 |
isButton: true |
|
470 |
isVisible: enableStop |
|
19418 | 471 |
labelImage: (ResourceRetriever ToolbarIconLibrary stop22x22Icon) |
11123 | 472 |
) |
473 |
(MenuItem |
|
474 |
label: 'Close' |
|
475 |
itemValue: doClose |
|
476 |
translateLabel: true |
|
477 |
isButton: true |
|
478 |
startGroup: right |
|
479 |
isVisible: false |
|
480 |
labelImage: (ResourceRetriever ToolbarIconLibrary removeTabIcon) |
|
481 |
) |
|
18980 | 482 |
(MenuItem |
483 |
activeHelpKey: showOnlyIn1 |
|
484 |
label: 'Only in 1)' |
|
485 |
indication: showOnlyIn1Holder |
|
486 |
labelImage: (ResourceRetriever DirectoryDifferenceViewApplication leftOnlyIcon) |
|
487 |
isButton: true |
|
488 |
isVisible: hasResultListHolder |
|
489 |
) |
|
490 |
(MenuItem |
|
491 |
activeHelpKey: showOnlyIn2 |
|
492 |
label: 'Only in 2)' |
|
493 |
indication: showOnlyIn2Holder |
|
494 |
labelImage: (ResourceRetriever DirectoryDifferenceViewApplication rightOnlyIcon) |
|
495 |
isButton: true |
|
496 |
isVisible: hasResultListHolder |
|
497 |
) |
|
498 |
(MenuItem |
|
499 |
activeHelpKey: showDifferent |
|
500 |
label: 'Different Only' |
|
501 |
indication: showDifferentOnlyHolder |
|
502 |
labelImage: (ResourceRetriever ToolbarIconLibrary diff22x22Icon2) |
|
503 |
isButton: true |
|
504 |
isVisible: hasResultListHolder |
|
505 |
) |
|
506 |
(MenuItem |
|
507 |
activeHelpKey: showAll |
|
508 |
label: 'Show All' |
|
509 |
indication: showAllHolder |
|
510 |
isButton: true |
|
511 |
isVisible: hasResultListHolder |
|
512 |
) |
|
11123 | 513 |
) |
514 |
nil |
|
515 |
nil |
|
516 |
) |
|
517 |
! ! |
|
518 |
||
11105 | 519 |
!DirectoryDifferenceViewApplication class methodsFor:'tableColumns specs'! |
520 |
||
521 |
searchResultTable |
|
522 |
"This resource specification was automatically generated |
|
523 |
by the DataSetBuilder of ST/X." |
|
524 |
||
525 |
"Do not manually edit this!! If it is corrupted, |
|
526 |
the DataSetBuilder may not be able to read the specification." |
|
527 |
||
528 |
" |
|
529 |
DataSetBuilder new openOnClass:DirectoryDifferenceViewApplication andSelector:#searchResultTable |
|
530 |
" |
|
531 |
||
532 |
<resource: #tableColumns> |
|
533 |
||
534 |
^#( |
|
535 |
(DataSetColumnSpec |
|
536 |
label: 'Filename' |
|
537 |
id: 'FileName' |
|
538 |
labelButtonType: Button |
|
18985 | 539 |
height: heightOfFirstRow |
11105 | 540 |
model: at: |
541 |
menuFromApplication: false |
|
542 |
writeSelector: at:put: |
|
18985 | 543 |
canSelect: false |
11105 | 544 |
showRowSeparator: false |
545 |
showColSeparator: false |
|
18985 | 546 |
) |
11105 | 547 |
(DataSetColumnSpec |
548 |
label: 'Diff' |
|
549 |
id: 'Diff' |
|
550 |
labelButtonType: Button |
|
18985 | 551 |
height: heightOfFirstRow |
11105 | 552 |
model: at: |
553 |
menuFromApplication: false |
|
554 |
writeSelector: at:put: |
|
18985 | 555 |
canSelect: false |
11105 | 556 |
showRowSeparator: false |
557 |
showColSeparator: false |
|
558 |
) |
|
18985 | 559 |
) |
11105 | 560 |
! ! |
561 |
||
562 |
!DirectoryDifferenceViewApplication methodsFor:'accessing'! |
|
563 |
||
564 |
directory1:directory1Arg directory2:directory2Arg |
|
565 |
self directory1Holder value:directory1Arg. |
|
566 |
self directory2Holder value:directory2Arg. |
|
567 |
||
568 |
"/ self namePatternHolder value:newPattern. |
|
569 |
self enableStop value:false. |
|
570 |
self enableSearch value:true. |
|
571 |
^ true. |
|
572 |
||
573 |
"Modified: / 12-01-2012 / 01:36:54 / cg" |
|
574 |
! |
|
575 |
||
576 |
directory1Holder |
|
577 |
directory1Holder isNil ifTrue:[ |
|
578 |
directory1Holder := nil asValue |
|
579 |
]. |
|
580 |
^ directory1Holder |
|
581 |
||
582 |
"Created: / 12-01-2012 / 01:37:31 / cg" |
|
583 |
! |
|
584 |
||
585 |
directory2Holder |
|
586 |
directory2Holder isNil ifTrue:[ |
|
587 |
directory2Holder := nil asValue |
|
588 |
]. |
|
589 |
^ directory2Holder |
|
590 |
||
591 |
"Created: / 12-01-2012 / 01:37:41 / cg" |
|
592 |
! ! |
|
593 |
||
11116 | 594 |
!DirectoryDifferenceViewApplication methodsFor:'actions'! |
595 |
||
18985 | 596 |
fileListDoubleClick:indexOrIndexCollection |
597 |
|idx file fn1 fn2| |
|
598 |
||
599 |
idx := (indexOrIndexCollection isInteger) |
|
600 |
ifTrue:[indexOrIndexCollection] |
|
601 |
ifFalse:[indexOrIndexCollection first]. |
|
602 |
file := (self shownList at:idx) first. |
|
603 |
||
604 |
fn1 := self directory1Holder value asFilename construct:file. |
|
605 |
fn2 := self directory2Holder value asFilename construct:file. |
|
606 |
(fn1 exists and:[fn1 isRegularFile]) ifTrue:[ |
|
607 |
self fileDoubleClick:fn1 |
|
608 |
]. |
|
609 |
(fn2 exists and:[fn2 isRegularFile]) ifTrue:[ |
|
610 |
self fileDoubleClick:fn2 |
|
611 |
]. |
|
612 |
! |
|
613 |
||
11116 | 614 |
fileSelected:entries |
615 |
|entry file fn1 fn2 text1 text2 differ| |
|
616 |
||
617 |
entries isEmptyOrNil ifTrue:[^ self]. |
|
618 |
||
619 |
entry := self shownList at:entries first. |
|
620 |
file := entry first. |
|
621 |
||
622 |
fn1 := self directory1Holder value asFilename construct:file. |
|
623 |
fn2 := self directory2Holder value asFilename construct:file. |
|
15245
824d31e08f0f
class: DirectoryDifferenceViewApplication
Claus Gittinger <cg@exept.de>
parents:
14500
diff
changeset
|
624 |
(fn1 exists and:[fn1 isRegularFile]) ifTrue:[ |
14500
dac4006a72c5
class: DirectoryDifferenceViewApplication
Claus Gittinger <cg@exept.de>
parents:
13818
diff
changeset
|
625 |
text1 := fn1 contentsAsString. |
11116 | 626 |
]. |
15245
824d31e08f0f
class: DirectoryDifferenceViewApplication
Claus Gittinger <cg@exept.de>
parents:
14500
diff
changeset
|
627 |
(fn2 exists and:[fn2 isRegularFile]) ifTrue:[ |
14500
dac4006a72c5
class: DirectoryDifferenceViewApplication
Claus Gittinger <cg@exept.de>
parents:
13818
diff
changeset
|
628 |
text2 := fn2 contentsAsString. |
11116 | 629 |
]. |
630 |
differ := builder componentAt:'DiffTextView'. |
|
631 |
differ text1:(text1 ? '') text2:(text2 ? ''). |
|
632 |
||
633 |
"Created: / 12-01-2012 / 03:21:52 / cg" |
|
18980 | 634 |
! |
635 |
||
636 |
shouldShow:aListItem |
|
637 |
|showingWhat| |
|
638 |
||
639 |
showingWhat := self showWhatHolder value. |
|
640 |
showingWhat == #all ifTrue:[^ true]. |
|
641 |
||
642 |
"/ showing filtered |
|
643 |
^ (aListItem at:3) == showingWhat |
|
644 |
! |
|
645 |
||
646 |
shownFilesChanged |
|
647 |
|showingWhat| |
|
648 |
||
649 |
showingWhat := self showWhatHolder value. |
|
650 |
showingWhat == #all ifTrue:[ |
|
651 |
self matchedFilesList contents:unfilteredFilesList. |
|
652 |
"/ self shownListHolder valueHolder:unfilteredFilesList. |
|
18985 | 653 |
self shownListHolder valueHolder:unfilteredFilesList. |
18980 | 654 |
^ self. |
655 |
]. |
|
656 |
||
657 |
"/ showing filtered |
|
658 |
||
659 |
filteredFilesList contents:(unfilteredFilesList select:[:entry | (entry at:3) == showingWhat]). |
|
660 |
self matchedFilesList contents:filteredFilesList. |
|
18985 | 661 |
self shownListHolder valueHolder:filteredFilesList. |
11116 | 662 |
! ! |
663 |
||
11121 | 664 |
!DirectoryDifferenceViewApplication methodsFor:'aspects'! |
665 |
||
18978 | 666 |
excludedDirectoryNamePatternHolder |
667 |
excludedDirectoryNamePatternHolder isNil ifTrue:[ |
|
668 |
excludedDirectoryNamePatternHolder := '' asValue. |
|
669 |
]. |
|
670 |
^ excludedDirectoryNamePatternHolder. |
|
671 |
||
672 |
"Created: / 13-01-2012 / 14:42:47 / cg" |
|
673 |
! |
|
674 |
||
11121 | 675 |
excludedNamePatternHolder |
676 |
excludedNamePatternHolder isNil ifTrue:[ |
|
677 |
excludedNamePatternHolder := '' asValue. |
|
678 |
]. |
|
679 |
^ excludedNamePatternHolder. |
|
680 |
||
681 |
"Created: / 13-01-2012 / 14:42:47 / cg" |
|
682 |
! |
|
683 |
||
18980 | 684 |
filteredFilesList |
685 |
filteredFilesList isNil ifTrue:[ |
|
686 |
filteredFilesList := List new. |
|
687 |
]. |
|
688 |
^ filteredFilesList. |
|
689 |
! |
|
690 |
||
691 |
hasResultListHolder |
|
692 |
hasResultListHolder isNil ifTrue:[ |
|
693 |
hasResultListHolder := BlockValue |
|
694 |
with:[:l | l value notEmptyOrNil] |
|
695 |
argument:(self unfilteredFilesList) |
|
696 |
]. |
|
697 |
^ hasResultListHolder |
|
698 |
! |
|
699 |
||
18978 | 700 |
ignoreCaseInDirectoryNameHolder |
701 |
||
702 |
ignoreCaseInDirectoryNameHolder isNil ifTrue:[ |
|
703 |
ignoreCaseInDirectoryNameHolder := true asValue. |
|
704 |
]. |
|
705 |
^ ignoreCaseInDirectoryNameHolder. |
|
706 |
||
707 |
"Created: / 13-01-2012 / 14:37:28 / cg" |
|
708 |
! |
|
709 |
||
710 |
ignoreCaseInExcludedDirectoryNameHolder |
|
711 |
||
712 |
ignoreCaseInExcludedDirectoryNameHolder isNil ifTrue:[ |
|
713 |
ignoreCaseInExcludedDirectoryNameHolder := true asValue. |
|
714 |
]. |
|
715 |
^ ignoreCaseInExcludedDirectoryNameHolder. |
|
716 |
||
717 |
"Created: / 13-01-2012 / 14:37:28 / cg" |
|
718 |
! |
|
719 |
||
720 |
ignoreCaseInExcludedNameHolder |
|
721 |
||
722 |
ignoreCaseInExcludedNameHolder isNil ifTrue:[ |
|
723 |
ignoreCaseInExcludedNameHolder := true asValue. |
|
724 |
]. |
|
725 |
^ ignoreCaseInExcludedNameHolder. |
|
726 |
||
727 |
"Created: / 13-01-2012 / 14:37:28 / cg" |
|
728 |
! |
|
729 |
||
730 |
ignoreCaseInNameHolder |
|
731 |
||
732 |
ignoreCaseInNameHolder isNil ifTrue:[ |
|
733 |
ignoreCaseInNameHolder := true asValue. |
|
734 |
]. |
|
735 |
^ ignoreCaseInNameHolder. |
|
736 |
||
737 |
"Created: / 13-01-2012 / 14:37:28 / cg" |
|
738 |
! |
|
739 |
||
11121 | 740 |
namePatternHolder |
741 |
||
742 |
namePatternHolder isNil ifTrue:[ |
|
743 |
namePatternHolder := '*' asValue. |
|
744 |
]. |
|
745 |
^ namePatternHolder. |
|
746 |
||
747 |
"Created: / 13-01-2012 / 14:37:28 / cg" |
|
18980 | 748 |
! |
749 |
||
750 |
showAllHolder |
|
751 |
^ (PluggableAdaptor on:(self showWhatHolder)) selectValue:#all |
|
752 |
! |
|
753 |
||
754 |
showDifferentOnlyHolder |
|
755 |
^ (PluggableAdaptor on:(self showWhatHolder)) selectValue:#different |
|
756 |
! |
|
757 |
||
758 |
showOnlyIn1Holder |
|
759 |
^ (PluggableAdaptor on:(self showWhatHolder)) selectValue:#onlyIn1 |
|
760 |
! |
|
761 |
||
762 |
showOnlyIn2Holder |
|
763 |
^ (PluggableAdaptor on:(self showWhatHolder)) selectValue:#onlyIn2 |
|
764 |
! |
|
765 |
||
766 |
showWhatHolder |
|
767 |
showWhatHolder isNil ifTrue:[ |
|
768 |
showWhatHolder := #all asValue. |
|
769 |
showWhatHolder onChangeSend:#shownFilesChanged to:self |
|
770 |
]. |
|
771 |
^ showWhatHolder |
|
772 |
! |
|
773 |
||
774 |
unfilteredFilesList |
|
775 |
unfilteredFilesList isNil ifTrue:[ |
|
776 |
unfilteredFilesList := List new. |
|
777 |
]. |
|
778 |
^ unfilteredFilesList. |
|
11121 | 779 |
! ! |
780 |
||
11105 | 781 |
!DirectoryDifferenceViewApplication methodsFor:'comparing'! |
782 |
||
783 |
doSearch |
|
18978 | 784 |
|dir1 dir2 |
785 |
namePattern excludedNamePattern excludedDirectoryNamePattern |
|
786 |
ignoreCaseInName ignoreCaseInExcludeName ignoreCaseInExcludeDirectoryName |
|
787 |
fileExcludeFilterOrNil directoryExcludeFilterOrNil checkDir| |
|
11105 | 788 |
|
789 |
filesOnlyInDirectory1 := OrderedCollection new. |
|
790 |
filesOnlyInDirectory2 := OrderedCollection new. |
|
791 |
directoriesOnlyInDirectory1 := OrderedCollection new. |
|
792 |
directoriesOnlyInDirectory2 := OrderedCollection new. |
|
793 |
filesWhichAreDifferent := OrderedCollection new. |
|
794 |
||
18978 | 795 |
filesSkippedCount := directoriesSkippedCount := 0. |
796 |
||
11105 | 797 |
dir1 := self directory1Holder value. |
798 |
dir1 isNil ifTrue:[^ self]. |
|
799 |
||
800 |
dir2 := self directory2Holder value. |
|
801 |
dir2 isNil ifTrue:[^ self]. |
|
802 |
||
803 |
dir1 := dir1 asFilename. |
|
804 |
dir2 := dir2 asFilename. |
|
805 |
||
11123 | 806 |
dir1 pathName = dir2 pathName ifTrue:[ |
807 |
self notify:('Same folder.' allBold). |
|
808 |
^ self. |
|
809 |
]. |
|
810 |
||
11121 | 811 |
namePattern := self namePatternHolder value. |
11123 | 812 |
namePattern notEmptyOrNil ifTrue:[ |
18978 | 813 |
namePattern := namePattern withoutSeparators. |
814 |
(namePattern isEmptyOrNil or:[namePattern = '*']) ifTrue:[ |
|
815 |
namePattern := nil |
|
816 |
] |
|
11123 | 817 |
]. |
18978 | 818 |
|
819 |
ignoreCaseInName := self ignoreCaseInNameHolder value. |
|
820 |
ignoreCaseInExcludeName := self ignoreCaseInExcludedNameHolder value. |
|
821 |
ignoreCaseInExcludeDirectoryName := self ignoreCaseInExcludedDirectoryNameHolder value. |
|
822 |
||
11121 | 823 |
excludedNamePattern := self excludedNamePatternHolder value. |
11123 | 824 |
excludedNamePattern notEmptyOrNil ifTrue:[ |
18978 | 825 |
excludedNamePattern := excludedNamePattern withoutSeparators. |
826 |
excludedNamePattern notEmptyOrNil ifTrue:[ |
|
827 |
fileExcludeFilterOrNil := |
|
828 |
ignoreCaseInExcludeName |
|
829 |
ifTrue:[ [:baseName | (excludedNamePattern compoundMatch:baseName caseSensitive:false) not ] ] |
|
830 |
ifFalse:[ [:baseName | (excludedNamePattern compoundMatch:baseName caseSensitive:true) not ] ]. |
|
831 |
]. |
|
11123 | 832 |
]. |
18978 | 833 |
|
834 |
excludedDirectoryNamePattern := self excludedDirectoryNamePatternHolder value. |
|
835 |
excludedDirectoryNamePattern notEmptyOrNil ifTrue:[ |
|
836 |
excludedDirectoryNamePattern := excludedDirectoryNamePattern withoutSeparators. |
|
837 |
excludedDirectoryNamePattern notEmptyOrNil ifTrue:[ |
|
838 |
checkDir := |
|
839 |
ignoreCaseInExcludeDirectoryName |
|
840 |
ifTrue:[ [:dir | (excludedDirectoryNamePattern compoundMatch:(dir baseName) caseSensitive:false) not ] ] |
|
841 |
ifFalse:[ [:dir | (excludedDirectoryNamePattern compoundMatch:(dir baseName) caseSensitive:true) not ] ]. |
|
842 |
directoryExcludeFilterOrNil := |
|
843 |
[:fn | |
|
844 |
(checkDir value:fn) ifFalse:[ |
|
845 |
directoriesSkippedCount := directoriesSkippedCount + 1. |
|
846 |
false. |
|
847 |
] ifTrue:[ |
|
848 |
true |
|
849 |
] |
|
850 |
]. |
|
851 |
]. |
|
852 |
]. |
|
853 |
||
18980 | 854 |
self unfilteredFilesList removeAll. |
855 |
self filteredFilesList removeAll. |
|
856 |
self shownFilesChanged. "/ to set the filtered list |
|
857 |
||
11564 | 858 |
self windowGroup repairDamage. |
11121 | 859 |
|
18980 | 860 |
itemsFoundQueue := SharedQueue new. |
861 |
||
11105 | 862 |
self |
863 |
startSearchTask:[ |
|
864 |
self changeInformationTo:'Directory Diff - searching ' toTab:true. |
|
865 |
||
18978 | 866 |
dir1 |
867 |
recursiveDirectoryContentsDo:[:relFn1 | |
|
18980 | 868 |
|fn1 fn2 fn1BaseName newListItem| |
11105 | 869 |
|
18978 | 870 |
fn1 := dir1 construct:relFn1. |
871 |
fn1BaseName := fn1 baseName. |
|
18980 | 872 |
newListItem := nil. |
18978 | 873 |
(namePattern isNil or:[namePattern compoundMatch:fn1BaseName caseSensitive:ignoreCaseInName not]) ifTrue:[ |
18980 | 874 |
(fileExcludeFilterOrNil isNil or:[(fileExcludeFilterOrNil value:fn1BaseName) not]) ifTrue:[ |
18978 | 875 |
fn2 := dir2 construct:relFn1. |
876 |
fn1 isDirectory ifTrue:[ |
|
877 |
self notify:('Comparing %1...' bindWith:relFn1 asString allBold). |
|
878 |
fn2 exists ifFalse:[ |
|
879 |
directoriesOnlyInDirectory1 add:fn1. |
|
18980 | 880 |
newListItem := { relFn1 . 'Directory only in directory1' . #onlyIn1}. |
11121 | 881 |
]. |
882 |
] ifFalse:[ |
|
18978 | 883 |
fn2 exists ifTrue:[ |
884 |
filesSearchedCount := filesSearchedCount + 1. |
|
885 |
(fn1 sameContentsAs:fn2) ifFalse:[ |
|
886 |
filesWhichAreDifferent add:fn1. |
|
18980 | 887 |
newListItem := { relFn1 . 'Different' . #different }. |
18978 | 888 |
]. |
889 |
] ifFalse:[ |
|
890 |
filesOnlyInDirectory1 add:fn1. |
|
18980 | 891 |
newListItem := { relFn1 . 'File only in directory1' . #onlyIn1}. |
18978 | 892 |
]. |
11121 | 893 |
]. |
18980 | 894 |
newListItem notNil ifTrue:[ |
895 |
unfilteredFilesList add:newListItem. |
|
896 |
itemsFoundQueue add:newListItem. |
|
897 |
self enqueueMessage:#updateList for:self arguments:#(). |
|
898 |
]. |
|
18978 | 899 |
] ifFalse:[ |
900 |
filesSkippedCount := filesSkippedCount + 1. |
|
901 |
] |
|
11121 | 902 |
] |
903 |
] |
|
18978 | 904 |
filterForVisitingDirectories:directoryExcludeFilterOrNil. |
905 |
||
906 |
dir2 |
|
907 |
recursiveDirectoryContentsDo:[:relFn2 | |
|
18980 | 908 |
|fn1 fn2 fn2BaseName newListItem| |
11105 | 909 |
|
18978 | 910 |
fn2 := dir2 construct:relFn2. |
911 |
fn2BaseName := fn2 baseName. |
|
912 |
(namePattern isNil or:[namePattern compoundMatch:fn2BaseName caseSensitive:ignoreCaseInName not]) ifTrue:[ |
|
18980 | 913 |
(fileExcludeFilterOrNil isNil or:[(fileExcludeFilterOrNil value:fn2BaseName) not]) ifTrue:[ |
18978 | 914 |
fn1 := dir1 construct:relFn2. |
915 |
fn1 exists ifFalse:[ |
|
18980 | 916 |
fn2 isDirectory ifTrue:[ |
917 |
directoriesOnlyInDirectory2 add:fn2. |
|
918 |
newListItem := { relFn2 . 'Directory only in directory2' . #onlyIn2}. |
|
18978 | 919 |
] ifFalse:[ |
920 |
filesOnlyInDirectory2 add:fn2. |
|
18980 | 921 |
newListItem := { relFn2 . 'File only in directory2' . #onlyIn2}. |
922 |
]. |
|
923 |
newListItem notNil ifTrue:[ |
|
924 |
unfilteredFilesList add:newListItem. |
|
925 |
itemsFoundQueue add:newListItem. |
|
926 |
self enqueueMessage:#updateList for:self arguments:#(). |
|
927 |
]. |
|
18978 | 928 |
]. |
11121 | 929 |
]. |
18978 | 930 |
] ifFalse:[ |
931 |
filesSkippedCount := filesSkippedCount + 1. |
|
932 |
] |
|
11121 | 933 |
] |
18978 | 934 |
filterForVisitingDirectories:directoryExcludeFilterOrNil. |
935 |
||
936 |
Transcript showCR:'--- search summary ------'. |
|
937 |
directoriesSkippedCount ~~ 0 ifTrue:[ |
|
938 |
Transcript showCR:'%1 directories skipped' with:directoriesSkippedCount. |
|
939 |
]. |
|
940 |
filesSkippedCount ~~ 0 ifTrue:[ |
|
941 |
Transcript showCR:'%1 files skipped' with:filesSkippedCount. |
|
11105 | 942 |
]. |
943 |
filesOnlyInDirectory1 notEmpty ifTrue:[ |
|
18594 | 944 |
Transcript showCR:'%1 files only in directory1' with:filesOnlyInDirectory1 size. |
11105 | 945 |
]. |
946 |
filesOnlyInDirectory2 notEmpty ifTrue:[ |
|
18594 | 947 |
Transcript showCR:'%1 files only in directory2' with:filesOnlyInDirectory2 size. |
11105 | 948 |
]. |
949 |
directoriesOnlyInDirectory1 notEmpty ifTrue:[ |
|
18594 | 950 |
Transcript showCR:'%1 directories only in directory1' with:directoriesOnlyInDirectory1 size. |
11105 | 951 |
]. |
952 |
directoriesOnlyInDirectory2 notEmpty ifTrue:[ |
|
18594 | 953 |
Transcript showCR:'%1 directories only in directory2' with:directoriesOnlyInDirectory2 size. |
11105 | 954 |
]. |
955 |
filesWhichAreDifferent notEmpty ifTrue:[ |
|
18594 | 956 |
Transcript showCR:'%1 files are different' with:filesWhichAreDifferent size. |
11105 | 957 |
] |
958 |
] |
|
959 |
name:'Directory Diff'. |
|
960 |
||
961 |
"Created: / 12-01-2012 / 01:07:20 / cg" |
|
18594 | 962 |
"Modified: / 15-02-2019 / 09:42:51 / Claus Gittinger" |
18978 | 963 |
! |
964 |
||
965 |
generateResultStringForTimeElapsed:timeDuration |
|
966 |
"at the end of a search, generate a nice informative summary string. |
|
967 |
Redefined to generate a different message." |
|
968 |
||
969 |
|timeMillis timeString nIn1 nIn2 nDifferent| |
|
970 |
||
971 |
timeMillis := timeDuration asMilliseconds. |
|
972 |
timeString := timeDuration printStringForApproximation. |
|
973 |
||
974 |
nIn1 := filesOnlyInDirectory1 size. |
|
18980 | 975 |
nIn2 := filesOnlyInDirectory2 size. |
18978 | 976 |
nDifferent := filesWhichAreDifferent size. |
977 |
||
978 |
^ resources |
|
18980 | 979 |
string:('different:%1, only in 1: %2, only in 2: %3 (%4 files visited; %6 files/s).') |
18978 | 980 |
with:nDifferent |
981 |
with:nIn1 |
|
982 |
with:nIn2 |
|
983 |
with:filesSearchedCount |
|
984 |
with:(UnitConverter fileSizeSIStringFor:(bytesSearchedCount * 1000 / (timeMillis max:1))) |
|
985 |
with:((filesSearchedCount * 1000 / (timeMillis max:1)) asFixedPoint:1). |
|
18980 | 986 |
! |
987 |
||
988 |
updateList |
|
989 |
|next| |
|
990 |
||
991 |
[(next := itemsFoundQueue nextOrNil) notNil] whileTrue:[ |
|
992 |
(self shouldShow:next) ifTrue:[ |
|
993 |
filteredFilesList add:next. |
|
994 |
self matchedFilesList add:next |
|
995 |
] |
|
996 |
]. |
|
997 |
self windowGroup repairDamage. |
|
11105 | 998 |
! ! |
999 |
||
1000 |
!DirectoryDifferenceViewApplication methodsFor:'startup & release'! |
|
1001 |
||
1002 |
postOpenWith:aBuilder |
|
1003 |
super postOpenWith:aBuilder. |
|
1004 |
self doSearch |
|
1005 |
||
1006 |
"Created: / 12-01-2012 / 01:41:18 / cg" |
|
1007 |
! ! |
|
1008 |
||
1009 |
!DirectoryDifferenceViewApplication class methodsFor:'documentation'! |
|
1010 |
||
1011 |
version |
|
17708 | 1012 |
^ '$Header$' |
11105 | 1013 |
! |
1014 |
||
1015 |
version_CVS |
|
17708 | 1016 |
^ '$Header$' |
11105 | 1017 |
! ! |
13818 | 1018 |