author | Claus Gittinger <cg@exept.de> |
Fri, 09 Nov 2001 19:21:00 +0100 | |
changeset 3392 | 2dae85e52160 |
parent 3364 | 8276ce475f4c |
child 3554 | 1ef7694bd41a |
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 |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
166 |
#isVisible: #notReadOnly |
3203 | 167 |
#label: '-' |
168 |
) |
|
169 |
#(#MenuItem |
|
170 |
#label: 'Update' |
|
171 |
#translateLabel: true |
|
172 |
#value: #doUpdate |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
173 |
#isVisible: #notReadOnly |
3203 | 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 |
|
190 |
#label: 'Search' |
|
191 |
#translateLabel: true |
|
192 |
#submenu: |
|
193 |
#(#Menu |
|
194 |
#( |
|
195 |
#(#MenuItem |
|
196 |
#label: 'Class...' |
|
197 |
#translateLabel: true |
|
198 |
#value: #findClass |
|
199 |
) |
|
200 |
#(#MenuItem |
|
201 |
#label: 'Previous for Class' |
|
202 |
#translateLabel: true |
|
203 |
#value: #findPreviousForClass |
|
204 |
#enabled: #hasSelection |
|
205 |
) |
|
206 |
#(#MenuItem |
|
207 |
#label: 'Next for Class' |
|
208 |
#translateLabel: true |
|
209 |
#value: #findNextForClass |
|
210 |
#enabled: #hasSelection |
|
211 |
) |
|
212 |
#(#MenuItem |
|
213 |
#label: '-' |
|
214 |
) |
|
215 |
#(#MenuItem |
|
216 |
#label: 'Selector...' |
|
217 |
#translateLabel: true |
|
218 |
#value: #findSelector |
|
219 |
) |
|
220 |
#(#MenuItem |
|
221 |
#label: 'Previous for Selector' |
|
222 |
#translateLabel: true |
|
223 |
#value: #findPreviousForSelector |
|
224 |
#enabled: #hasSelection |
|
225 |
) |
|
226 |
#(#MenuItem |
|
227 |
#label: 'Next for Selector' |
|
228 |
#translateLabel: true |
|
229 |
#value: #findNextForSelector |
|
230 |
#enabled: #hasSelection |
|
231 |
) |
|
232 |
#(#MenuItem |
|
233 |
#label: '-' |
|
234 |
) |
|
235 |
#(#MenuItem |
|
236 |
#label: 'String...' |
|
237 |
#translateLabel: true |
|
238 |
#value: #findString |
|
239 |
) |
|
240 |
#(#MenuItem |
|
241 |
#label: 'Previous with String' |
|
242 |
#translateLabel: true |
|
243 |
#value: #findPreviousForString |
|
244 |
#enabled: #hasSelection |
|
245 |
) |
|
246 |
#(#MenuItem |
|
247 |
#label: 'Next with String' |
|
248 |
#translateLabel: true |
|
249 |
#value: #findNextForString |
|
250 |
#enabled: #hasSelection |
|
251 |
) |
|
252 |
#(#MenuItem |
|
253 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
254 |
#isVisible: #notReadOnly |
3203 | 255 |
) |
256 |
#(#MenuItem |
|
257 |
#label: 'Previous Snapshot' |
|
258 |
#translateLabel: true |
|
259 |
#value: #findPreviousSnapshot |
|
260 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
261 |
#isVisible: #notReadOnly |
3203 | 262 |
) |
263 |
#(#MenuItem |
|
264 |
#label: 'Next Snapshot' |
|
265 |
#translateLabel: true |
|
266 |
#value: #findNextSnapshot |
|
267 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
268 |
#isVisible: #notReadOnly |
3203 | 269 |
) |
270 |
) |
|
271 |
nil |
|
272 |
nil |
|
273 |
) |
|
274 |
) |
|
275 |
#(#MenuItem |
|
276 |
#label: 'Change' |
|
277 |
#translateLabel: true |
|
278 |
#submenu: |
|
279 |
#(#Menu |
|
280 |
#( |
|
281 |
#(#MenuItem |
|
282 |
#label: 'Apply' |
|
283 |
#translateLabel: true |
|
284 |
#value: #doApply |
|
285 |
#enabled: #hasSelection |
|
286 |
) |
|
287 |
#(#MenuItem |
|
288 |
#label: 'Apply to End' |
|
289 |
#translateLabel: true |
|
290 |
#value: #doApplyRest |
|
291 |
#enabled: #hasSelection |
|
292 |
) |
|
293 |
#(#MenuItem |
|
294 |
#label: 'Apply for Class to End' |
|
295 |
#translateLabel: true |
|
296 |
#value: #doApplyClassRest |
|
297 |
#enabled: #hasSelection |
|
298 |
) |
|
299 |
#(#MenuItem |
|
300 |
#label: 'Apply All' |
|
301 |
#translateLabel: true |
|
302 |
#value: #doApplyAll |
|
3228 | 303 |
#enabled: hasNoSelection |
3203 | 304 |
) |
305 |
#(#MenuItem |
|
306 |
#label: '-' |
|
307 |
) |
|
308 |
#(#MenuItem |
|
309 |
#label: 'Delete' |
|
310 |
#translateLabel: true |
|
311 |
#value: #doDelete |
|
312 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
313 |
#isVisible: #notReadOnly |
3203 | 314 |
) |
315 |
#(#MenuItem |
|
316 |
#label: 'Delete to End' |
|
317 |
#translateLabel: true |
|
318 |
#value: #doDeleteRest |
|
319 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
320 |
#isVisible: #notReadOnly |
3203 | 321 |
) |
322 |
#(#MenuItem |
|
323 |
#label: 'Delete for Class to End' |
|
324 |
#translateLabel: true |
|
325 |
#value: #doDeleteClassRest |
|
326 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
327 |
#isVisible: #notReadOnly |
3203 | 328 |
) |
329 |
#(#MenuItem |
|
330 |
#label: 'Delete for Class from Begin' |
|
331 |
#translateLabel: true |
|
332 |
#value: #doDeleteClassFromBeginning |
|
333 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
334 |
#isVisible: #notReadOnly |
3203 | 335 |
) |
336 |
#(#MenuItem |
|
337 |
#label: 'Delete All for Class' |
|
338 |
#translateLabel: true |
|
339 |
#value: #doDeleteClassAll |
|
340 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
341 |
#isVisible: #notReadOnly |
3203 | 342 |
) |
343 |
#(#MenuItem |
|
344 |
#label: 'Delete All for Class && its Private Classes' |
|
345 |
#translateLabel: true |
|
346 |
#value: #doDeleteClassAndPrivateClassesAll |
|
347 |
#enabled: #hasSelection |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
348 |
#isVisible: #notReadOnly |
3203 | 349 |
) |
350 |
#(#MenuItem |
|
351 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
352 |
#isVisible: #notReadOnly |
3203 | 353 |
) |
354 |
#(#MenuItem |
|
355 |
#label: 'Compare with Current' |
|
356 |
#translateLabel: true |
|
357 |
#value: #doCompare |
|
358 |
#enabled: #hasSelection |
|
359 |
) |
|
360 |
#(#MenuItem |
|
361 |
#label: 'Browse' |
|
362 |
#translateLabel: true |
|
363 |
#value: #doBrowse |
|
364 |
#enabled: #hasSelection |
|
365 |
) |
|
366 |
#(#MenuItem |
|
367 |
#label: '-' |
|
368 |
) |
|
369 |
#(#MenuItem |
|
370 |
#label: 'Make Change a Patch' |
|
371 |
#translateLabel: true |
|
372 |
#value: #doMakePatch |
|
373 |
#enabled: #hasSelection |
|
374 |
) |
|
375 |
) |
|
376 |
nil |
|
377 |
nil |
|
378 |
) |
|
379 |
) |
|
380 |
#(#MenuItem |
|
381 |
#label: 'Settings' |
|
382 |
#translateLabel: true |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
383 |
#isVisible: #notReadOnly |
3203 | 384 |
#submenu: |
385 |
#(#Menu |
|
386 |
#( |
|
387 |
#(#MenuItem |
|
388 |
#label: 'Auto Compare' |
|
389 |
#translateLabel: true |
|
390 |
#indication: #autoCompare |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
391 |
#isVisible: #notReadOnly |
3203 | 392 |
) |
393 |
#(#MenuItem |
|
394 |
#label: 'Auto Update' |
|
395 |
#translateLabel: true |
|
396 |
#indication: #autoUpdate |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
397 |
#isVisible: #notReadOnly |
3203 | 398 |
) |
399 |
#(#MenuItem |
|
400 |
#label: '-' |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
401 |
#isVisible: #notReadOnly |
3203 | 402 |
) |
403 |
#(#MenuItem |
|
404 |
#label: 'Apply in Original NameSpace' |
|
405 |
#translateLabel: true |
|
406 |
#indication: #applyInOriginalNameSpace |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
407 |
#isVisible: #notReadOnly |
3203 | 408 |
) |
409 |
) |
|
410 |
nil |
|
411 |
nil |
|
412 |
) |
|
413 |
) |
|
414 |
#(#MenuItem |
|
415 |
#label: 'Help' |
|
416 |
#translateLabel: true |
|
417 |
#startGroup: #right |
|
418 |
#submenu: |
|
419 |
#(#Menu |
|
420 |
#( |
|
421 |
#(#MenuItem |
|
422 |
#label: 'ChangesBrowser Documentation' |
|
423 |
#translateLabel: true |
|
424 |
#value: #openHTMLDocument: |
|
425 |
#argument: 'tools/cbrowser/TOP.html' |
|
426 |
) |
|
3205 | 427 |
#(#MenuItem |
428 |
#label: '-' |
|
429 |
) |
|
430 |
#(#MenuItem |
|
431 |
#label: 'About ChangesBrowser...' |
|
432 |
#translateLabel: true |
|
433 |
#value: #openAboutThisApplication |
|
434 |
) |
|
3203 | 435 |
) |
436 |
nil |
|
437 |
nil |
|
438 |
) |
|
439 |
) |
|
440 |
) |
|
441 |
nil |
|
442 |
nil |
|
443 |
) |
|
444 |
! ! |
|
445 |
||
30 | 446 |
!ChangeSetBrowser methodsFor:'initialize / release'! |
447 |
||
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
448 |
askIfChangesAreToBeWrittenBack |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
449 |
|action| |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
450 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
451 |
anyChanges ifFalse:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
452 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
453 |
action := OptionBox |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
454 |
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
|
455 |
label:'ChangesBrowser' |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
456 |
form:(WarningBox iconBitmap) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
457 |
buttonLabels:(resources array:#('Cancel' 'Don''t Update' 'Update')) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
458 |
values:#(#abort #ignore #save) |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
459 |
default:#save |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
460 |
onCancel:#abort. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
461 |
|
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
462 |
action == #abort ifTrue:[^ self]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
463 |
action == #save ifTrue:[ |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
464 |
self saveBackChanges |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
465 |
]. |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
466 |
! |
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
467 |
|
224 | 468 |
changeListMenu |
3203 | 469 |
<resource: #programMenu > |
470 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
471 |
|items m| |
30 | 472 |
|
3203 | 473 |
items := #( |
474 |
('Apply' doApply) |
|
475 |
('Apply to End' doApplyRest) |
|
476 |
('Apply All changes' doApplyAll) |
|
477 |
('-' ) |
|
478 |
('Delete' doDelete) |
|
479 |
('Delete to End' doDeleteRest) |
|
480 |
('Delete for Class to End' doDeleteClassRest) |
|
481 |
('Delete All for Class' doDeleteClassAll) |
|
482 |
('-' ) |
|
483 |
"/ ('compress' doCompress) |
|
484 |
('Compare with Current' doCompare) |
|
485 |
('-' ) |
|
486 |
('Make Change a Patch' doMakePatch) |
|
487 |
"/ ('update sourcefile from change' doMakePermanent) |
|
488 |
('-' ) |
|
489 |
('Saveback ChangeSet' doSaveBack) |
|
490 |
('-' ) |
|
491 |
('Update' doUpdate) |
|
492 |
). |
|
224 | 493 |
|
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
494 |
m := PopUpMenu |
3203 | 495 |
itemList:items |
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
496 |
resources:resources. |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
497 |
|
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
498 |
readOnly == true ifTrue:[ |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
499 |
m disableAll:#(doDelete doDeleteRest doDeleteClassRest doDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
500 |
doDeleteClassAndPrivateClassesAll doCompress |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
501 |
doFileoutAndDeleteClassAll doCheckinAndDeleteClassAll |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
502 |
doWriteBack doSaveBack doUpdate |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
503 |
doApplyAll doApplyRest) |
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
504 |
]. |
3228 | 505 |
|
506 |
self hasSelection ifTrue:[ |
|
507 |
m disable:#doApplyAll |
|
508 |
]. |
|
509 |
||
3224
b2f3a2a0bc80
readOnly flag added (for method-versions browsing)
Claus Gittinger <cg@exept.de>
parents:
3212
diff
changeset
|
510 |
^ m |
224 | 511 |
|
512 |
"Created: 3.12.1995 / 18:06:35 / cg" |
|
513 |
"Modified: 3.12.1995 / 18:13:06 / cg" |
|
30 | 514 |
! ! |
515 |
||
2862
ae3f14623d62
default open is on the current changeSet
Claus Gittinger <cg@exept.de>
parents:
1474
diff
changeset
|
516 |
!ChangeSetBrowser methodsFor:'private'! |
1474 | 517 |
|
518 |
applyChange:changeNr |
|
519 |
"fileIn a change" |
|
520 |
||
521 |
|nm applyAction| |
|
522 |
||
523 |
nm := self classNameOfChange:changeNr. |
|
524 |
nm notNil ifTrue:[ |
|
525 |
|cls| |
|
526 |
||
527 |
cls := Smalltalk at:(nm asSymbol) ifAbsent:[]. |
|
528 |
cls notNil ifTrue:[ |
|
529 |
cls isLoaded ifFalse:[ |
|
530 |
cls autoload |
|
531 |
] |
|
532 |
] |
|
533 |
]. |
|
534 |
||
535 |
changeNrProcessed := changeNr. |
|
536 |
||
537 |
applyAction := [ |
|
538 |
|sig| |
|
539 |
||
540 |
(skipSignal notNil) ifTrue:[ |
|
541 |
sig := skipSignal |
|
542 |
] ifFalse:[ |
|
543 |
sig := Object abortSignal |
|
544 |
]. |
|
545 |
sig catch:[ |
|
3276 | 546 |
(changeSet at:changeNr) apply. |
1474 | 547 |
]. |
548 |
changeNrProcessed := nil. |
|
549 |
]. |
|
550 |
||
551 |
"/ |
|
552 |
"/ if I am showing the changes file, dont update it |
|
553 |
"/ |
|
554 |
changeFileName = ObjectMemory nameForChanges ifTrue:[ |
|
555 |
Class withoutUpdatingChangesDo:applyAction |
|
556 |
] ifFalse:[ |
|
557 |
applyAction value |
|
558 |
]. |
|
559 |
||
560 |
"Created: / 7.2.1998 / 19:32:35 / cg" |
|
561 |
"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
|
562 |
! |
30 | 563 |
|
1470 | 564 |
changeIsFollowupMethodChange:changeNr |
565 |
^ false |
|
566 |
||
567 |
"Created: / 6.2.1998 / 13:04:59 / cg" |
|
1474 | 568 |
"Modified: / 7.2.1998 / 19:28:52 / cg" |
1470 | 569 |
! |
570 |
||
30 | 571 |
changeSet:aChangeSet |
572 |
originalChangeSet := aChangeSet. |
|
573 |
changeSet := OrderedCollection new. |
|
106 | 574 |
originalChangeSet notNil ifTrue:[ |
575 |
originalChangeSet do:[:aChange | |
|
576 |
changeSet add:aChange |
|
577 |
]. |
|
30 | 578 |
]. |
579 |
! |
|
580 |
||
222 | 581 |
checkIfFileHasChanged |
582 |
Processor removeTimedBlock:checkBlock. |
|
583 |
changeSet size ~= originalChangeSet size ifTrue:[ |
|
584 |
self newLabel:'(outdated)'. |
|
3203 | 585 |
autoUpdate value ifTrue:[ |
222 | 586 |
self doUpdate |
587 |
] |
|
588 |
] ifFalse:[ |
|
589 |
self newLabel:'' |
|
590 |
]. |
|
591 |
Processor addTimedBlock:checkBlock afterSeconds:5. |
|
592 |
||
593 |
"Created: 3.12.1995 / 13:52:30 / cg" |
|
594 |
"Modified: 3.12.1995 / 14:15:06 / cg" |
|
595 |
! |
|
596 |
||
1470 | 597 |
fullClassNameOfChange:nr |
598 |
^ (changeSet at:nr) className |
|
599 |
||
600 |
"Created: / 6.2.1998 / 13:02:25 / cg" |
|
601 |
"Modified: / 6.2.1998 / 13:07:02 / cg" |
|
602 |
! |
|
603 |
||
3203 | 604 |
isChangeSetBrowser |
605 |
^ true |
|
606 |
! |
|
607 |
||
224 | 608 |
numberOfChanges |
609 |
^ changeSet size |
|
610 |
||
611 |
"Created: 3.12.1995 / 18:15:56 / cg" |
|
612 |
! |
|
613 |
||
222 | 614 |
queryCloseText |
615 |
^ 'Quit without updating changeSet ?' |
|
616 |
! |
|
617 |
||
45 | 618 |
readChangesFileInBackground:dummy |
30 | 619 |
"read the changeSet, create a list of header-lines" |
620 |
||
621 |
changeSet size == 0 ifTrue:[^ nil]. |
|
622 |
||
224 | 623 |
self newLabel:'updating ...'. |
30 | 624 |
self withCursor:(Cursor read) do:[ |
45 | 625 |
changeChunks := OrderedCollection new. |
626 |
changeHeaderLines := OrderedCollection new. |
|
30 | 627 |
|
45 | 628 |
changeSet do:[:aChange | |
629 |
changeChunks add:(aChange printString). |
|
630 |
changeHeaderLines add:(aChange printString) |
|
631 |
]. |
|
632 |
changeClassNames := OrderedCollection new:(changeChunks size). |
|
633 |
anyChanges := false |
|
224 | 634 |
]. |
635 |
self newLabel:''. |
|
636 |
||
637 |
"Created: 3.12.1995 / 18:02:39 / cg" |
|
30 | 638 |
! |
639 |
||
3364 | 640 |
realClassNameOfChange:nr |
641 |
^ (changeSet at:nr) className. |
|
642 |
||
643 |
"Created: / 5.11.2001 / 18:10:38 / cg" |
|
644 |
! |
|
645 |
||
30 | 646 |
saveBackChanges |
647 |
"save back the change set" |
|
648 |
||
649 |
[originalChangeSet isEmpty] whileFalse:[ |
|
45 | 650 |
originalChangeSet removeLast |
30 | 651 |
]. |
652 |
changeSet do:[:aChange | |
|
45 | 653 |
originalChangeSet add:aChange |
30 | 654 |
] |
655 |
! |
|
656 |
||
1470 | 657 |
selectorOfMethodChange:changeNr |
658 |
^ (changeSet at:changeNr) selector |
|
659 |
||
660 |
"Created: / 6.2.1998 / 13:28:20 / cg" |
|
661 |
"Modified: / 6.2.1998 / 13:29:59 / cg" |
|
662 |
! |
|
663 |
||
30 | 664 |
silentDeleteChange:changeNr |
665 |
"delete a change do not update changeListView" |
|
666 |
||
1474 | 667 |
changeSet removeIndex:changeNr. |
668 |
super silentDeleteChange:changeNr. |
|
669 |
||
670 |
"Created: / 3.12.1995 / 18:14:17 / cg" |
|
671 |
"Modified: / 7.2.1998 / 19:57:57 / cg" |
|
672 |
! |
|
224 | 673 |
|
1474 | 674 |
silentDeleteInternalChange:changeNr |
675 |
"delete a change do not update changeListView" |
|
676 |
||
677 |
changeSet removeIndex:changeNr. |
|
678 |
super silentDeleteInternalChange:changeNr. |
|
679 |
||
680 |
"Modified: / 7.2.1998 / 19:44:45 / cg" |
|
681 |
"Created: / 7.2.1998 / 19:58:02 / cg" |
|
222 | 682 |
! |
683 |
||
684 |
streamForChange:changeNr |
|
685 |
"answer a stream for change" |
|
686 |
||
1474 | 687 |
|change s| |
222 | 688 |
|
689 |
change := changeSet at:changeNr. |
|
690 |
change isNil ifTrue:[^nil]. |
|
1474 | 691 |
change isMethodChange ifTrue:[ |
692 |
s := '!!' , change className , |
|
693 |
' methodsFor:''' , change methodCategory , '''!!\' withCRs , |
|
694 |
change source , '\' withCRs , '!! !!\' withCRs. |
|
695 |
^ ReadStream on:s |
|
696 |
]. |
|
222 | 697 |
^ ReadStream on:(change source) |
1474 | 698 |
|
699 |
"Modified: / 7.2.1998 / 19:52:44 / cg" |
|
30 | 700 |
! ! |
701 |
||
702 |
!ChangeSetBrowser methodsFor:'user actions'! |
|
703 |
||
704 |
doSaveBack |
|
705 |
anyChanges ifTrue:[ |
|
45 | 706 |
self saveBackChanges. |
707 |
self doUpdate |
|
30 | 708 |
] |
222 | 709 |
! |
710 |
||
711 |
doUpdate |
|
712 |
changeSet := OrderedCollection new. |
|
713 |
originalChangeSet notNil ifTrue:[ |
|
714 |
originalChangeSet do:[:aChange | |
|
715 |
changeSet add:aChange |
|
716 |
]. |
|
717 |
]. |
|
718 |
super doUpdate |
|
719 |
||
720 |
"Created: 3.12.1995 / 13:54:14 / cg" |
|
30 | 721 |
! ! |
222 | 722 |
|
723 |
!ChangeSetBrowser class methodsFor:'documentation'! |
|
724 |
||
725 |
version |
|
3392
2dae85e52160
changeSetBrowsers writeBack fixed (when closing)
Claus Gittinger <cg@exept.de>
parents:
3364
diff
changeset
|
726 |
^ '$Header: /cvs/stx/stx/libtool/ChangeSetBrowser.st,v 1.22 2001-11-09 18:21:00 cg Exp $' |
222 | 727 |
! ! |