author | Claus Gittinger <cg@exept.de> |
Wed, 19 Jun 2002 14:13:21 +0200 | |
changeset 3673 | 47f43ef77e5b |
parent 3554 | 1ef7694bd41a |
child 3785 | 741890c870a4 |
permissions | -rw-r--r-- |
30 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 3 |
All Rights Reserved |
30 | 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 |
" |
|
12 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
13 |
"{ Package: 'stx:libtool' }" |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
14 |
|
30 | 15 |
ChangesBrowser subclass:#ChangeSetBrowser |
1470 | 16 |
instanceVariableNames:'changeSet originalChangeSet' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Browsers' |
|
30 | 20 |
! |
21 |
||
22 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
45 | 27 |
All Rights Reserved |
30 | 28 |
|
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
like a changesBrowser, but manipulates the per-project change-lists. |
|
41 |
" |
|
42 |
! ! |
|
43 |
||
44 |
!ChangeSetBrowser class methodsFor:'instance creation'! |
|
45 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
46 |
open |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
47 |
"create a changes browser on the current change set" |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
48 |
|
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
49 |
^ ((self new label:'ChangeSet Browser') changeSet:ChangeSet current) open |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
50 |
! |
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
51 |
|
40 | 52 |
openOn:aChangeSet |
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
53 |
"create a changes browser on a change set" |
30 | 54 |
|
45 | 55 |
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open |
30 | 56 |
! ! |
57 |
||
1470 | 58 |
!ChangeSetBrowser class methodsFor:'defaults'! |
59 |
||
60 |
defaultLabel |
|
61 |
^ 'ChangeSet Browser' |
|
62 |
||
63 |
"Created: / 6.2.1998 / 13:25:47 / cg" |
|
64 |
! ! |
|
65 |
||
3203 | 66 |
!ChangeSetBrowser class methodsFor:'menu specs'! |
67 |
||
68 |
menuSpec |
|
69 |
"This resource specification was automatically generated |
|
70 |
by the MenuEditor of ST/X." |
|
71 |
||
72 |
"Do not manually edit this!! If it is corrupted, |
|
73 |
the MenuEditor may not be able to read the specification." |
|
74 |
||
75 |
" |
|
76 |
MenuEditor new openOnClass:ChangeSetBrowser andSelector:#menuSpec |
|
77 |
(Menu new fromLiteralArrayEncoding:(ChangeSetBrowser menuSpec)) startUp |
|
78 |
" |
|
79 |
||
80 |
<resource: #menu> |
|
81 |
||
82 |
^ |
|
83 |
#(#Menu |
|
84 |
#( |
|
85 |
#(#MenuItem |
|
86 |
#label: 'File' |
|
87 |
#translateLabel: true |
|
88 |
#submenu: |
|
89 |
#(#Menu |
|
90 |
#( |
|
91 |
#(#MenuItem |
|
92 |
#label: 'Compress' |
|
93 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
94 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 95 |
#value: #doCompress |
96 |
) |
|
97 |
#(#MenuItem |
|
98 |
#label: 'Compress for Class' |
|
99 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
100 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 101 |
#value: #doCompressClass |
102 |
#enabled: #hasSelection |
|
103 |
) |
|
104 |
#(#MenuItem |
|
105 |
#label: 'Compare and Compress' |
|
106 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
107 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 108 |
#value: #doCompareAndCompress |
109 |
) |
|
110 |
#(#MenuItem |
|
111 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
112 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 113 |
) |
114 |
#(#MenuItem |
|
115 |
#label: 'Fileout && Delete all Changes for Class' |
|
116 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
117 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 118 |
#value: #doFileoutAndDeleteClassAll |
119 |
#enabled: #hasSelection |
|
120 |
) |
|
121 |
#(#MenuItem |
|
122 |
#label: 'CheckIn && Delete all Changes for Class' |
|
123 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
124 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 125 |
#value: #doCheckinAndDeleteClassAll |
126 |
#enabled: #hasSelection |
|
127 |
) |
|
128 |
#(#MenuItem |
|
129 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
130 |
#isVisible: #notEditingClassSourceAndNotReadOnly |
3203 | 131 |
) |
132 |
#(#MenuItem |
|
133 |
#label: 'Save in...' |
|
134 |
#translateLabel: true |
|
135 |
#value: #doSave |
|
136 |
#enabled: #hasSelection |
|
137 |
) |
|
138 |
#(#MenuItem |
|
139 |
#label: 'Save to End in...' |
|
140 |
#translateLabel: true |
|
141 |
#value: #doSaveRest |
|
142 |
#enabled: #hasSelection |
|
143 |
) |
|
144 |
#(#MenuItem |
|
145 |
#label: 'Save for Class to End in...' |
|
146 |
#translateLabel: true |
|
147 |
#value: #doSaveClassRest |
|
148 |
#enabled: #hasSelection |
|
149 |
) |
|
150 |
#(#MenuItem |
|
151 |
#label: 'Save All for Class in...' |
|
152 |
#translateLabel: true |
|
153 |
#value: #doSaveClassAll |
|
154 |
#enabled: #hasSelection |
|
155 |
) |
|
156 |
#(#MenuItem |
|
157 |
#label: '-' |
|
158 |
) |
|
159 |
#(#MenuItem |
|
160 |
#label: 'Saveback ChangeSet' |
|
161 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
162 |
#isVisible: #notReadOnly |
3203 | 163 |
#value: #doSaveBack |
164 |
) |
|
165 |
#(#MenuItem |
|
3554 | 166 |
#label: '-' |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
167 |
#isVisible: #notReadOnly |
3203 | 168 |
) |
169 |
#(#MenuItem |
|
170 |
#label: 'Update' |
|
171 |
#translateLabel: true |
|
3554 | 172 |
#isVisible: #notReadOnly |
3203 | 173 |
#value: #doUpdate |
174 |
) |
|
175 |
#(#MenuItem |
|
176 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
177 |
#isVisible: #notReadOnly |
3203 | 178 |
) |
179 |
#(#MenuItem |
|
180 |
#label: 'Exit' |
|
181 |
#translateLabel: true |
|
182 |
#value: #menuExit |
|
183 |
) |
|
184 |
) |
|
185 |
nil |
|
186 |
nil |
|
187 |
) |
|
188 |
) |
|
189 |
#(#MenuItem |
|
3554 | 190 |
#label: 'Change' |
191 |
#translateLabel: true |
|
192 |
#submenu: |
|
193 |
#(#Menu |
|
194 |
#( |
|
195 |
#(#MenuItem |
|
196 |
#label: 'Apply' |
|
197 |
#translateLabel: true |
|
198 |
#value: #doApply |
|
199 |
#enabled: #hasSelection |
|
200 |
) |
|
201 |
#(#MenuItem |
|
202 |
#label: 'Apply to End' |
|
203 |
#translateLabel: true |
|
204 |
#value: #doApplyRest |
|
205 |
#enabled: #hasSelection |
|
206 |
) |
|
207 |
#(#MenuItem |
|
208 |
#label: 'Apply for Class to End' |
|
209 |
#translateLabel: true |
|
210 |
#value: #doApplyClassRest |
|
211 |
#enabled: #hasSelection |
|
212 |
) |
|
213 |
#(#MenuItem |
|
214 |
#label: 'Apply All' |
|
215 |
#translateLabel: true |
|
216 |
#value: #doApplyAll |
|
217 |
#enabled: #hasNoSelection |
|
218 |
) |
|
219 |
#(#MenuItem |
|
220 |
#label: '-' |
|
221 |
) |
|
222 |
#(#MenuItem |
|
223 |
#label: 'Delete' |
|
224 |
#translateLabel: true |
|
225 |
#isVisible: #notReadOnly |
|
226 |
#value: #doDelete |
|
227 |
#enabled: #hasSelection |
|
228 |
) |
|
229 |
#(#MenuItem |
|
230 |
#label: 'Delete to End' |
|
231 |
#translateLabel: true |
|
232 |
#isVisible: #notReadOnly |
|
233 |
#value: #doDeleteRest |
|
234 |
#enabled: #hasSelection |
|
235 |
) |
|
236 |
#(#MenuItem |
|
237 |
#label: 'Delete for Class to End' |
|
238 |
#translateLabel: true |
|
239 |
#isVisible: #notReadOnly |
|
240 |
#value: #doDeleteClassRest |
|
241 |
#enabled: #hasSelection |
|
242 |
) |
|
243 |
#(#MenuItem |
|
244 |
#label: 'Delete for Class from Begin' |
|
245 |
#translateLabel: true |
|
246 |
#isVisible: #notReadOnly |
|
247 |
#value: #doDeleteClassFromBeginning |
|
248 |
#enabled: #hasSelection |
|
249 |
) |
|
250 |
#(#MenuItem |
|
251 |
#label: 'Delete All for Class' |
|
252 |
#translateLabel: true |
|
253 |
#isVisible: #notReadOnly |
|
254 |
#value: #doDeleteClassAll |
|
255 |
#enabled: #hasSelection |
|
256 |
) |
|
257 |
#(#MenuItem |
|
258 |
#label: 'Delete All for Class && its Private Classes' |
|
259 |
#translateLabel: true |
|
260 |
#isVisible: #notReadOnly |
|
261 |
#value: #doDeleteClassAndPrivateClassesAll |
|
262 |
#enabled: #hasSelection |
|
263 |
) |
|
264 |
#(#MenuItem |
|
265 |
#label: '-' |
|
266 |
#isVisible: #notReadOnly |
|
267 |
) |
|
268 |
#(#MenuItem |
|
269 |
#label: 'Compare with Current' |
|
270 |
#translateLabel: true |
|
271 |
#value: #doCompare |
|
272 |
#enabled: #hasSelection |
|
273 |
) |
|
274 |
#(#MenuItem |
|
275 |
#label: 'Browse' |
|
276 |
#translateLabel: true |
|
277 |
#value: #doBrowse |
|
278 |
#enabled: #hasSelection |
|
279 |
) |
|
280 |
#(#MenuItem |
|
281 |
#label: '-' |
|
282 |
) |
|
283 |
#(#MenuItem |
|
284 |
#label: 'Make Change a Patch' |
|
285 |
#translateLabel: true |
|
286 |
#value: #doMakePatch |
|
287 |
#enabled: #hasSelection |
|
288 |
) |
|
289 |
) |
|
290 |
nil |
|
291 |
nil |
|
292 |
) |
|
293 |
) |
|
294 |
#(#MenuItem |
|
3203 | 295 |
#label: 'Search' |
296 |
#translateLabel: true |
|
297 |
#submenu: |
|
298 |
#(#Menu |
|
299 |
#( |
|
300 |
#(#MenuItem |
|
301 |
#label: 'Class...' |
|
302 |
#translateLabel: true |
|
303 |
#value: #findClass |
|
304 |
) |
|
305 |
#(#MenuItem |
|
306 |
#label: 'Previous for Class' |
|
307 |
#translateLabel: true |
|
308 |
#value: #findPreviousForClass |
|
309 |
#enabled: #hasSelection |
|
310 |
) |
|
311 |
#(#MenuItem |
|
312 |
#label: 'Next for Class' |
|
313 |
#translateLabel: true |
|
314 |
#value: #findNextForClass |
|
315 |
#enabled: #hasSelection |
|
316 |
) |
|
317 |
#(#MenuItem |
|
318 |
#label: '-' |
|
319 |
) |
|
320 |
#(#MenuItem |
|
321 |
#label: 'Selector...' |
|
322 |
#translateLabel: true |
|
323 |
#value: #findSelector |
|
324 |
) |
|
325 |
#(#MenuItem |
|
326 |
#label: 'Previous for Selector' |
|
327 |
#translateLabel: true |
|
328 |
#value: #findPreviousForSelector |
|
329 |
#enabled: #hasSelection |
|
330 |
) |
|
331 |
#(#MenuItem |
|
332 |
#label: 'Next for Selector' |
|
333 |
#translateLabel: true |
|
334 |
#value: #findNextForSelector |
|
335 |
#enabled: #hasSelection |
|
336 |
) |
|
337 |
#(#MenuItem |
|
338 |
#label: '-' |
|
339 |
) |
|
340 |
#(#MenuItem |
|
341 |
#label: 'String...' |
|
342 |
#translateLabel: true |
|
343 |
#value: #findString |
|
344 |
) |
|
345 |
#(#MenuItem |
|
346 |
#label: 'Previous with String' |
|
347 |
#translateLabel: true |
|
348 |
#value: #findPreviousForString |
|
349 |
#enabled: #hasSelection |
|
350 |
) |
|
351 |
#(#MenuItem |
|
352 |
#label: 'Next with String' |
|
353 |
#translateLabel: true |
|
354 |
#value: #findNextForString |
|
355 |
#enabled: #hasSelection |
|
356 |
) |
|
357 |
#(#MenuItem |
|
358 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
359 |
#isVisible: #notReadOnly |
3203 | 360 |
) |
361 |
#(#MenuItem |
|
362 |
#label: 'Previous Snapshot' |
|
363 |
#translateLabel: true |
|
3554 | 364 |
#isVisible: #notReadOnly |
3203 | 365 |
#value: #findPreviousSnapshot |
366 |
#enabled: #hasSelection |
|
367 |
) |
|
368 |
#(#MenuItem |
|
369 |
#label: 'Next Snapshot' |
|
370 |
#translateLabel: true |
|
3554 | 371 |
#isVisible: #notReadOnly |
3203 | 372 |
#value: #findNextSnapshot |
373 |
#enabled: #hasSelection |
|
374 |
) |
|
375 |
) |
|
376 |
nil |
|
377 |
nil |
|
378 |
) |
|
379 |
) |
|
380 |
#(#MenuItem |
|
3554 | 381 |
#label: 'Browse' |
3203 | 382 |
#translateLabel: true |
383 |
#submenu: |
|
384 |
#(#Menu |
|
385 |
#( |
|
386 |
#(#MenuItem |
|
3554 | 387 |
#label: 'Class' |
3203 | 388 |
#translateLabel: true |
3554 | 389 |
#value: #doBrowse |
390 |
#enabled: #hasSingleSelection |
|
3203 | 391 |
) |
392 |
#(#MenuItem |
|
393 |
#label: '-' |
|
394 |
) |
|
395 |
#(#MenuItem |
|
3554 | 396 |
#label: 'Senders...' |
3203 | 397 |
#translateLabel: true |
3554 | 398 |
#value: #doBrowseSenders |
3203 | 399 |
) |
400 |
#(#MenuItem |
|
3554 | 401 |
#label: 'Implementors...' |
3203 | 402 |
#translateLabel: true |
3554 | 403 |
#value: #doBrowseImplementors |
3203 | 404 |
) |
405 |
) |
|
406 |
nil |
|
407 |
nil |
|
408 |
) |
|
409 |
) |
|
410 |
#(#MenuItem |
|
411 |
#label: 'Settings' |
|
412 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
413 |
#isVisible: #notReadOnly |
3203 | 414 |
#submenu: |
415 |
#(#Menu |
|
416 |
#( |
|
417 |
#(#MenuItem |
|
418 |
#label: 'Auto Compare' |
|
419 |
#translateLabel: true |
|
3554 | 420 |
#isVisible: #notReadOnly |
3203 | 421 |
#indication: #autoCompare |
422 |
) |
|
423 |
#(#MenuItem |
|
424 |
#label: 'Auto Update' |
|
425 |
#translateLabel: true |
|
3554 | 426 |
#isVisible: #notReadOnly |
3203 | 427 |
#indication: #autoUpdate |
428 |
) |
|
429 |
#(#MenuItem |
|
430 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
431 |
#isVisible: #notReadOnly |
3203 | 432 |
) |
433 |
#(#MenuItem |
|
434 |
#label: 'Apply in Original NameSpace' |
|
435 |
#translateLabel: true |
|
3554 | 436 |
#isVisible: #notReadOnly |
3203 | 437 |
#indication: #applyInOriginalNameSpace |
438 |
) |
|
439 |
) |
|
440 |
nil |
|
441 |
nil |
|
442 |
) |
|
443 |
) |
|
444 |
#(#MenuItem |
|
445 |
#label: 'Help' |
|
446 |
#translateLabel: true |
|
447 |
#startGroup: #right |
|
448 |
#submenu: |
|
449 |
#(#Menu |
|
450 |
#( |
|
451 |
#(#MenuItem |
|
452 |
#label: 'ChangesBrowser Documentation' |
|
453 |
#translateLabel: true |
|
454 |
#value: #openHTMLDocument: |
|
455 |
#argument: 'tools/cbrowser/TOP.html' |
|
456 |
) |
|
3205 | 457 |
#(#MenuItem |
458 |
#label: '-' |
|
459 |
) |
|
460 |
#(#MenuItem |
|
461 |
#label: 'About ChangesBrowser...' |
|
462 |
#translateLabel: true |
|
463 |
#value: #openAboutThisApplication |
|
464 |
) |
|
3203 | 465 |
) |
466 |
nil |
|
467 |
nil |
|
468 |
) |
|
469 |
) |
|
470 |
) |
|
471 |
nil |
|
472 |
nil |
|
473 |
) |
|
474 |
! ! |
|
475 |
||
30 | 476 |
!ChangeSetBrowser methodsFor:'initialize / release'! |
477 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
478 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
479 |
|action| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
480 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
481 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
482 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
483 |
action := OptionBox |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
484 |
request:(resources at:'The modified changeSet has not been saved.\\Update the changeSet before closing ?') withCRs |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
485 |
label:'ChangesBrowser' |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
486 |
form:(WarningBox iconBitmap) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
487 |
buttonLabels:(resources array:#('Cancel' 'Don''t Update' 'Update')) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
488 |
values:#(#abort #ignore #save) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
489 |
default:#save |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
490 |
onCancel:#abort. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
491 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
492 |
action == #abort ifTrue:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
493 |
action == #save ifTrue:[ |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
494 |
self saveBackChanges |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
495 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
496 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
497 |
|
224 | 498 |
changeListMenu |
3203 | 499 |
<resource: #programMenu > |
500 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
501 |
|items m| |
30 | 502 |
|
3203 | 503 |
items := #( |
504 |
('Apply' doApply) |
|
505 |
('Apply to End' doApplyRest) |
|
506 |
('Apply All changes' doApplyAll) |
|
507 |
('-' ) |
|
508 |
('Delete' doDelete) |
|
509 |
('Delete to End' doDeleteRest) |
|
510 |
('Delete for Class to End' doDeleteClassRest) |
|
511 |
('Delete All for Class' doDeleteClassAll) |
|
512 |
('-' ) |
|
513 |
"/ ('compress' doCompress) |
|
514 |
('Compare with Current' doCompare) |
|
515 |
('-' ) |
|
516 |
('Make Change a Patch' doMakePatch) |
|
517 |
"/ ('update sourcefile from change' doMakePermanent) |
|
518 |
('-' ) |
|
519 |
('Saveback ChangeSet' doSaveBack) |
|
520 |
('-' ) |
|
521 |
('Update' doUpdate) |
|
522 |
). |
|
224 | 523 |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
524 |
m := PopUpMenu |
3203 | 525 |
itemList:items |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
526 |
resources:resources. |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
527 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
528 |
readOnly == true ifTrue:[ |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
529 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
530 |
doDeleteClassAndPrivateClassesAll doCompress |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
531 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
532 |
doWriteBack doSaveBack doUpdate |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
533 |
doApplyAll doApplyRest) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
534 |
]. |
3228 | 535 |
|
536 |
self hasSelection ifTrue:[ |
|
537 |
m disable:#doApplyAll |
|
538 |
]. |
|
539 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
540 |
^ m |
224 | 541 |
|
542 |
"Created: 3.12.1995 / 18:06:35 / cg" |
|
543 |
"Modified: 3.12.1995 / 18:13:06 / cg" |
|
30 | 544 |
! ! |
545 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
546 |
!ChangeSetBrowser methodsFor:'private'! |
1474 | 547 |
|
548 |
applyChange:changeNr |
|
549 |
"fileIn a change" |
|
550 |
||
551 |
|nm applyAction| |
|
552 |
||
553 |
nm := self classNameOfChange:changeNr. |
|
554 |
nm notNil ifTrue:[ |
|
555 |
|cls| |
|
556 |
||
557 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
|
558 |
cls notNil ifTrue:[ |
|
559 |
cls isLoaded ifFalse:[ |
|
560 |
cls autoload |
|
561 |
] |
|
562 |
] |
|
563 |
]. |
|
564 |
||
565 |
changeNrProcessed := changeNr. |
|
566 |
||
567 |
applyAction := [ |
|
568 |
|sig| |
|
569 |
||
570 |
(skipSignal notNil) ifTrue:[ |
|
571 |
sig := skipSignal |
|
572 |
] ifFalse:[ |
|
573 |
sig := Object abortSignal |
|
574 |
]. |
|
575 |
sig catch:[ |
|
3276 | 576 |
(changeSet at:changeNr) apply. |
1474 | 577 |
]. |
578 |
changeNrProcessed := nil. |
|
579 |
]. |
|
580 |
||
581 |
"/ |
|
582 |
"/ if I am showing the changes file, dont update it |
|
583 |
"/ |
|
584 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
|
585 |
Class withoutUpdatingChangesDo:applyAction |
|
586 |
] ifFalse:[ |
|
587 |
applyAction value |
|
588 |
]. |
|
589 |
||
590 |
"Created: / 7.2.1998 / 19:32:35 / cg" |
|
591 |
"Modified: / 7.2.1998 / 19:35:11 / cg" |
|
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
592 |
! |
30 | 593 |
|
1470 | 594 |
changeIsFollowupMethodChange:changeNr |
595 |
^ false |
|
596 |
||
597 |
"Created: / 6.2.1998 / 13:04:59 / cg" |
|
1474 | 598 |
"Modified: / 7.2.1998 / 19:28:52 / cg" |
1470 | 599 |
! |
600 |
||
30 | 601 |
changeSet:aChangeSet |
602 |
originalChangeSet := aChangeSet. |
|
603 |
changeSet := OrderedCollection new. |
|
106 | 604 |
originalChangeSet notNil ifTrue:[ |
605 |
originalChangeSet do:[:aChange | |
|
606 |
changeSet add:aChange |
|
607 |
]. |
|
30 | 608 |
]. |
609 |
! |
|
610 |
||
222 | 611 |
checkIfFileHasChanged |
612 |
Processor removeTimedBlock:checkBlock. |
|
613 |
changeSet size ~= originalChangeSet size ifTrue:[ |
|
614 |
self newLabel:'(outdated)'. |
|
3203 | 615 |
autoUpdate value ifTrue:[ |
222 | 616 |
self doUpdate |
617 |
] |
|
618 |
] ifFalse:[ |
|
619 |
self newLabel:'' |
|
620 |
]. |
|
621 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
622 |
||
623 |
"Created: 3.12.1995 / 13:52:30 / cg" |
|
624 |
"Modified: 3.12.1995 / 14:15:06 / cg" |
|
625 |
! |
|
626 |
||
1470 | 627 |
fullClassNameOfChange:nr |
628 |
^ (changeSet at:nr) className |
|
629 |
||
630 |
"Created: / 6.2.1998 / 13:02:25 / cg" |
|
631 |
"Modified: / 6.2.1998 / 13:07:02 / cg" |
|
632 |
! |
|
633 |
||
3203 | 634 |
isChangeSetBrowser |
635 |
^ true |
|
636 |
! |
|
637 |
||
224 | 638 |
numberOfChanges |
639 |
^ changeSet size |
|
640 |
||
641 |
"Created: 3.12.1995 / 18:15:56 / cg" |
|
642 |
! |
|
643 |
||
222 | 644 |
queryCloseText |
645 |
^ 'Quit without updating changeSet ?' |
|
646 |
! |
|
647 |
||
45 | 648 |
readChangesFileInBackground:dummy |
30 | 649 |
"read the changeSet, create a list of header-lines" |
650 |
||
3673 | 651 |
|tabSpec| |
30 | 652 |
|
653 |
self withCursor:(Cursor read) do:[ |
|
3673 | 654 |
changeSet size == 0 ifTrue:[ |
655 |
changeFileName notNil ifTrue:[ |
|
656 |
changeSet := self class readXMLChangesFromFile:changeFileName inBackground:false. |
|
657 |
]. |
|
658 |
]. |
|
659 |
changeSet size == 0 ifTrue:[ |
|
660 |
^ nil |
|
661 |
]. |
|
662 |
||
663 |
tabSpec := TabulatorSpecification new. |
|
664 |
tabSpec unit:#inch. |
|
665 |
tabSpec positions:#(-1 0 5 8.5 ). |
|
666 |
" +/- cls>>sel type info" |
|
667 |
tabSpec align: #(#left #left #left #left). |
|
30 | 668 |
|
3673 | 669 |
changeChunks := OrderedCollection new. |
670 |
changeHeaderLines := OrderedCollection new. |
|
671 |
||
672 |
changeSet do:[:aChange | |entry| |
|
673 |
changeChunks add:(aChange printString). |
|
674 |
"/ changeHeaderLines add:(aChange printString) |
|
675 |
entry := MultiColListEntry new. |
|
676 |
entry tabulatorSpecification:tabSpec. |
|
677 |
entry colAt:1 put:''. "/ changeDelta. |
|
678 |
entry colAt:2 put:aChange printString. |
|
679 |
entry colAt:3 put:''. "/ changeType. |
|
680 |
||
681 |
(aChange respondsTo:#timeOfChangeIfKnown) ifTrue:[ |
|
682 |
aChange timeOfChangeIfKnown notNil ifTrue:[ |
|
683 |
entry colAt:4 put:(aChange timeOfChangeIfKnown printString). |
|
684 |
] |
|
685 |
]. |
|
686 |
changeHeaderLines add:entry |
|
687 |
]. |
|
688 |
changeClassNames := OrderedCollection new:(changeChunks size). |
|
689 |
anyChanges := false |
|
224 | 690 |
]. |
691 |
self newLabel:''. |
|
692 |
||
693 |
"Created: 3.12.1995 / 18:02:39 / cg" |
|
30 | 694 |
! |
695 |
||
3364 | 696 |
realClassNameOfChange:nr |
697 |
^ (changeSet at:nr) className. |
|
698 |
||
699 |
"Created: / 5.11.2001 / 18:10:38 / cg" |
|
700 |
! |
|
701 |
||
30 | 702 |
saveBackChanges |
703 |
"save back the change set" |
|
704 |
||
705 |
[originalChangeSet isEmpty] whileFalse:[ |
|
45 | 706 |
originalChangeSet removeLast |
30 | 707 |
]. |
708 |
changeSet do:[:aChange | |
|
45 | 709 |
originalChangeSet add:aChange |
30 | 710 |
] |
711 |
! |
|
712 |
||
1470 | 713 |
selectorOfMethodChange:changeNr |
714 |
^ (changeSet at:changeNr) selector |
|
715 |
||
716 |
"Created: / 6.2.1998 / 13:28:20 / cg" |
|
717 |
"Modified: / 6.2.1998 / 13:29:59 / cg" |
|
718 |
! |
|
719 |
||
30 | 720 |
silentDeleteChange:changeNr |
721 |
"delete a change do not update changeListView" |
|
722 |
||
1474 | 723 |
changeSet removeIndex:changeNr. |
724 |
super silentDeleteChange:changeNr. |
|
725 |
||
726 |
"Created: / 3.12.1995 / 18:14:17 / cg" |
|
727 |
"Modified: / 7.2.1998 / 19:57:57 / cg" |
|
728 |
! |
|
224 | 729 |
|
1474 | 730 |
silentDeleteInternalChange:changeNr |
731 |
"delete a change do not update changeListView" |
|
732 |
||
733 |
changeSet removeIndex:changeNr. |
|
734 |
super silentDeleteInternalChange:changeNr. |
|
735 |
||
736 |
"Modified: / 7.2.1998 / 19:44:45 / cg" |
|
737 |
"Created: / 7.2.1998 / 19:58:02 / cg" |
|
222 | 738 |
! |
739 |
||
740 |
streamForChange:changeNr |
|
741 |
"answer a stream for change" |
|
742 |
||
1474 | 743 |
|change s| |
222 | 744 |
|
745 |
change := changeSet at:changeNr. |
|
746 |
change isNil ifTrue:[^nil]. |
|
1474 | 747 |
change isMethodChange ifTrue:[ |
748 |
s := '!!' , change className , |
|
749 |
' methodsFor:''' , change methodCategory , '''!!\' withCRs , |
|
750 |
change source , '\' withCRs , '!! !!\' withCRs. |
|
751 |
^ ReadStream on:s |
|
752 |
]. |
|
222 | 753 |
^ ReadStream on:(change source) |
1474 | 754 |
|
755 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
|
30 | 756 |
! ! |
757 |
||
758 |
!ChangeSetBrowser methodsFor:'user actions'! |
|
759 |
||
760 |
doSaveBack |
|
761 |
anyChanges ifTrue:[ |
|
45 | 762 |
self saveBackChanges. |
763 |
self doUpdate |
|
30 | 764 |
] |
222 | 765 |
! |
766 |
||
767 |
doUpdate |
|
768 |
changeSet := OrderedCollection new. |
|
769 |
originalChangeSet notNil ifTrue:[ |
|
770 |
originalChangeSet do:[:aChange | |
|
771 |
changeSet add:aChange |
|
772 |
]. |
|
773 |
]. |
|
774 |
super doUpdate |
|
775 |
||
776 |
"Created: 3.12.1995 / 13:54:14 / cg" |
|
30 | 777 |
! ! |
222 | 778 |
|
779 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
780 |
||
781 |
version |
|
3673 | 782 |
^ '$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.24 2002-06-19 12:13:21 cg Exp $' |
222 | 783 |
! ! |