131
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCTool subclass:#MCVersionHistoryBrowser
|
|
4 |
instanceVariableNames:'ancestry index repositoryGroup package infos'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
699
|
7 |
category:'SCM-Monticello-UI'
|
131
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCVersionHistoryBrowser methodsFor:'accessing'!
|
|
12 |
|
|
13 |
ancestry: anAncestry
|
|
14 |
ancestry _ anAncestry
|
|
15 |
!
|
|
16 |
|
|
17 |
baseSnapshot
|
|
18 |
^ self snapshotForInfo: ancestry
|
|
19 |
!
|
|
20 |
|
|
21 |
index
|
|
22 |
"Answer the value of index"
|
|
23 |
|
|
24 |
^ index
|
|
25 |
!
|
|
26 |
|
|
27 |
index: anObject
|
|
28 |
"Set the value of index"
|
|
29 |
|
|
30 |
index _ anObject
|
|
31 |
!
|
|
32 |
|
|
33 |
infos
|
|
34 |
^ infos ifNil: [infos _ ancestry withBreadthFirstAncestors]
|
|
35 |
!
|
|
36 |
|
|
37 |
list
|
|
38 |
^ self infos collect: [:ea | ea name]
|
|
39 |
!
|
|
40 |
|
|
41 |
package: aMCPackage
|
|
42 |
package _ aMCPackage
|
|
43 |
!
|
|
44 |
|
|
45 |
repositoryGroup
|
|
46 |
^ MCRepositoryGroup default
|
|
47 |
!
|
|
48 |
|
|
49 |
selectedInfo
|
|
50 |
^ self infos at: self selection ifAbsent: [nil]
|
|
51 |
!
|
|
52 |
|
|
53 |
selectedSnapshot
|
|
54 |
^ self snapshotForInfo: self selectedInfo
|
|
55 |
!
|
|
56 |
|
|
57 |
selection
|
|
58 |
^ index ifNil: [0]
|
|
59 |
!
|
|
60 |
|
|
61 |
selection: aNumber
|
|
62 |
index _ aNumber.
|
|
63 |
self changed: #selection; changed: #summary
|
|
64 |
!
|
|
65 |
|
|
66 |
snapshotForInfo: aVersionInfo
|
|
67 |
^ (self repositoryGroup versionWithInfo: aVersionInfo) snapshot
|
|
68 |
!
|
|
69 |
|
|
70 |
summary
|
|
71 |
| selInfo |
|
|
72 |
selInfo _ self selectedInfo.
|
|
73 |
^ selInfo
|
|
74 |
ifNil: ['']
|
|
75 |
ifNotNil: [selInfo summary]
|
|
76 |
! !
|
|
77 |
|
|
78 |
!MCVersionHistoryBrowser methodsFor:'morphic ui'!
|
|
79 |
|
|
80 |
defaultExtent
|
|
81 |
^ 440@169.
|
|
82 |
|
|
83 |
!
|
|
84 |
|
|
85 |
defaultLabel
|
|
86 |
^ ancestry name, ' History'
|
|
87 |
!
|
|
88 |
|
|
89 |
getMenu: aMenu
|
|
90 |
index < 2 ifTrue: [^ aMenu].
|
|
91 |
self fillMenu: aMenu fromSpecs:
|
|
92 |
(Array
|
|
93 |
with: (Array with: 'view changes -> ', ancestry name with: #viewChanges)
|
|
94 |
with: #('spawn history' spawnHistory)).
|
|
95 |
^ aMenu
|
|
96 |
!
|
|
97 |
|
|
98 |
spawnHistory
|
|
99 |
MCVersionHistoryBrowser new
|
|
100 |
ancestry: self selectedInfo;
|
|
101 |
package: package;
|
|
102 |
show
|
|
103 |
!
|
|
104 |
|
|
105 |
viewChanges
|
|
106 |
"Note that the patchLabel will be parsed in MCPatchBrowser>>installSelection, so don't translate it!!"
|
|
107 |
| patch patchLabel |
|
|
108 |
patchLabel _ 'changes between {1} and {2}' format: { self selectedInfo name. ancestry name }.
|
|
109 |
patch _ self baseSnapshot patchRelativeToBase: self selectedSnapshot.
|
|
110 |
(MCPatchBrowser forPatch: patch) label: patchLabel; show
|
|
111 |
!
|
|
112 |
|
|
113 |
widgetSpecs
|
|
114 |
^ #(
|
|
115 |
((listMorph:selection:menu: list selection getMenu:) (0 0 0.3 1))
|
|
116 |
((textMorph: summary) (0.3 0 1 1))
|
|
117 |
)
|
|
118 |
! !
|
|
119 |
|
|
120 |
!MCVersionHistoryBrowser class methodsFor:'documentation'!
|
|
121 |
|
|
122 |
version
|
699
|
123 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCVersionHistoryBrowser.st,v 1.2 2012-09-11 21:30:22 cg Exp $'
|
131
|
124 |
! !
|