360
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCDialog subclass:#MCCommitDialog
|
|
4 |
instanceVariableNames:'workingCopyHolder repositoryHolder versionNameHolder
|
|
5 |
messageHolder messageView'
|
|
6 |
classVariableNames:''
|
|
7 |
poolDictionaries:''
|
|
8 |
category:'Monticello-St/X UI'
|
|
9 |
!
|
|
10 |
|
|
11 |
|
|
12 |
!MCCommitDialog class methodsFor:'interface specs'!
|
|
13 |
|
|
14 |
contentSpec
|
|
15 |
"This resource specification was automatically generated
|
|
16 |
by the UIPainter of ST/X."
|
|
17 |
|
|
18 |
"Do not manually edit this!! If it is corrupted,
|
|
19 |
the UIPainter may not be able to read the specification."
|
|
20 |
|
|
21 |
"
|
|
22 |
UIPainter new openOnClass:MCCommitDialog andSelector:#contentSpec
|
|
23 |
MCCommitDialog new openInterface:#contentSpec
|
|
24 |
"
|
|
25 |
|
|
26 |
<resource: #canvas>
|
|
27 |
|
|
28 |
^
|
|
29 |
#(FullSpec
|
|
30 |
name: contentSpec
|
|
31 |
window:
|
|
32 |
(WindowSpec
|
|
33 |
label: 'Commit Dialog'
|
|
34 |
name: 'Commit Dialog'
|
|
35 |
min: (Point 10 10)
|
|
36 |
bounds: (Rectangle 0 0 300 300)
|
|
37 |
)
|
|
38 |
component:
|
|
39 |
(SpecCollection
|
|
40 |
collection: (
|
|
41 |
(ComboListSpec
|
|
42 |
name: 'RepositoryList'
|
|
43 |
layout: (LayoutFrame 0 0 0 0 0 1 25 0)
|
|
44 |
model: repositoryHolder
|
|
45 |
comboList: repositoryList
|
|
46 |
useIndex: false
|
|
47 |
)
|
|
48 |
(InputFieldSpec
|
|
49 |
name: 'VersionName'
|
|
50 |
layout: (LayoutFrame 0 0 30 0 0 1 55 0)
|
|
51 |
model: versionNameHolder
|
|
52 |
immediateAccept: true
|
|
53 |
acceptOnReturn: true
|
|
54 |
acceptOnTab: true
|
|
55 |
acceptOnPointerLeave: true
|
|
56 |
)
|
|
57 |
(TextEditorSpec
|
|
58 |
name: 'CommitMessage'
|
|
59 |
layout: (LayoutFrame 0 0 60 0 0 1 0 1)
|
|
60 |
model: messageHolder
|
|
61 |
hasHorizontalScrollBar: true
|
|
62 |
hasVerticalScrollBar: true
|
|
63 |
hasKeyboardFocusInitially: false
|
|
64 |
postBuildCallback: postBuildMessageView:
|
|
65 |
)
|
|
66 |
)
|
|
67 |
|
|
68 |
)
|
|
69 |
)
|
|
70 |
! !
|
|
71 |
|
|
72 |
!MCCommitDialog methodsFor:'accessing'!
|
|
73 |
|
|
74 |
workingCopy: aMCWorkingCopy
|
|
75 |
|
|
76 |
^self workingCopyHolder value: aMCWorkingCopy
|
|
77 |
|
|
78 |
"Created: / 14-09-2010 / 23:43:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
79 |
! !
|
|
80 |
|
|
81 |
!MCCommitDialog methodsFor:'accessing - defaults'!
|
|
82 |
|
|
83 |
defaultTitle
|
|
84 |
"superclass MCDialog says that I am responsible to implement this method"
|
|
85 |
|
|
86 |
^ 'Commit'
|
|
87 |
|
|
88 |
"Modified: / 14-09-2010 / 23:00:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
89 |
! !
|
|
90 |
|
|
91 |
!MCCommitDialog methodsFor:'actions'!
|
|
92 |
|
|
93 |
doAccept
|
|
94 |
|
|
95 |
| workingCopy version repository |
|
|
96 |
|
|
97 |
self acceptEnabled ifFalse:[^self].
|
|
98 |
workingCopy := self workingCopyHolder value.
|
|
99 |
[version := workingCopy newVersion]
|
|
100 |
on: MCVersionNameAndMessageRequest
|
|
101 |
do: [:n |
|
|
102 |
n resume:
|
|
103 |
(Array with: self versionNameHolder value
|
440
|
104 |
with: messageView contents asText string)].
|
360
|
105 |
repository := self repositoryHolder value.
|
|
106 |
repository storeVersion: version.
|
|
107 |
super doAccept.
|
|
108 |
|
|
109 |
"Created: / 15-09-2010 / 14:07:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
110 |
! !
|
|
111 |
|
|
112 |
!MCCommitDialog methodsFor:'aspects'!
|
|
113 |
|
|
114 |
messageHolder
|
|
115 |
"return/create the 'messageHolder' value holder (automatically generated)"
|
|
116 |
|
|
117 |
messageHolder isNil ifTrue:[
|
|
118 |
messageHolder := ValueHolder with: ('Commit message' asText colorizeAllWith: Color gray).
|
|
119 |
messageHolder addDependent:self.
|
|
120 |
].
|
|
121 |
^ messageHolder
|
|
122 |
|
|
123 |
"Modified: / 15-09-2010 / 13:58:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
124 |
!
|
|
125 |
|
|
126 |
messageHolder:something
|
|
127 |
"set the 'messageHolder' value holder (automatically generated)"
|
|
128 |
|
|
129 |
|oldValue newValue|
|
|
130 |
|
|
131 |
messageHolder notNil ifTrue:[
|
|
132 |
oldValue := messageHolder value.
|
|
133 |
messageHolder removeDependent:self.
|
|
134 |
].
|
|
135 |
messageHolder := something.
|
|
136 |
messageHolder notNil ifTrue:[
|
|
137 |
messageHolder addDependent:self.
|
|
138 |
].
|
|
139 |
newValue := messageHolder value.
|
|
140 |
oldValue ~~ newValue ifTrue:[
|
|
141 |
self update:#value with:newValue from:messageHolder.
|
|
142 |
].
|
|
143 |
!
|
|
144 |
|
|
145 |
repositoryHolder
|
|
146 |
"return/create the 'repositoryHolder' value holder (automatically generated)"
|
|
147 |
|
|
148 |
repositoryHolder isNil ifTrue:[
|
|
149 |
repositoryHolder := ValueHolder new.
|
|
150 |
repositoryHolder addDependent:self.
|
|
151 |
].
|
|
152 |
^ repositoryHolder
|
|
153 |
!
|
|
154 |
|
|
155 |
repositoryHolder:something
|
|
156 |
"set the 'repositoryHolder' value holder (automatically generated)"
|
|
157 |
|
|
158 |
|oldValue newValue|
|
|
159 |
|
|
160 |
repositoryHolder notNil ifTrue:[
|
|
161 |
oldValue := repositoryHolder value.
|
|
162 |
repositoryHolder removeDependent:self.
|
|
163 |
].
|
|
164 |
repositoryHolder := something.
|
|
165 |
repositoryHolder notNil ifTrue:[
|
|
166 |
repositoryHolder addDependent:self.
|
|
167 |
].
|
|
168 |
newValue := repositoryHolder value.
|
|
169 |
oldValue ~~ newValue ifTrue:[
|
|
170 |
self update:#value with:newValue from:repositoryHolder.
|
|
171 |
].
|
|
172 |
!
|
|
173 |
|
|
174 |
repositoryList
|
|
175 |
|
|
176 |
^[MCRepositoryGroup default repositories]
|
|
177 |
|
|
178 |
"Created: / 14-09-2010 / 23:16:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
179 |
!
|
|
180 |
|
|
181 |
versionNameHolder
|
|
182 |
"return/create the 'versionNameHolder' value holder (automatically generated)"
|
|
183 |
|
|
184 |
versionNameHolder isNil ifTrue:[
|
|
185 |
versionNameHolder := ValueHolder new.
|
|
186 |
versionNameHolder addDependent:self.
|
|
187 |
].
|
|
188 |
^ versionNameHolder
|
|
189 |
!
|
|
190 |
|
|
191 |
versionNameHolder:something
|
|
192 |
"set the 'versionNameHolder' value holder (automatically generated)"
|
|
193 |
|
|
194 |
|oldValue newValue|
|
|
195 |
|
|
196 |
versionNameHolder notNil ifTrue:[
|
|
197 |
oldValue := versionNameHolder value.
|
|
198 |
versionNameHolder removeDependent:self.
|
|
199 |
].
|
|
200 |
versionNameHolder := something.
|
|
201 |
versionNameHolder notNil ifTrue:[
|
|
202 |
versionNameHolder addDependent:self.
|
|
203 |
].
|
|
204 |
newValue := versionNameHolder value.
|
|
205 |
oldValue ~~ newValue ifTrue:[
|
|
206 |
self update:#value with:newValue from:versionNameHolder.
|
|
207 |
].
|
|
208 |
!
|
|
209 |
|
|
210 |
workingCopyHolder
|
|
211 |
"return/create the 'workingCopyHolder' value holder (automatically generated)"
|
|
212 |
|
|
213 |
workingCopyHolder isNil ifTrue:[
|
|
214 |
workingCopyHolder := ValueHolder new.
|
|
215 |
workingCopyHolder addDependent:self.
|
|
216 |
].
|
|
217 |
^ workingCopyHolder
|
|
218 |
!
|
|
219 |
|
|
220 |
workingCopyHolder:something
|
|
221 |
"set the 'workingCopyHolder' value holder (automatically generated)"
|
|
222 |
|
|
223 |
|oldValue newValue|
|
|
224 |
|
|
225 |
workingCopyHolder notNil ifTrue:[
|
|
226 |
oldValue := workingCopyHolder value.
|
|
227 |
workingCopyHolder removeDependent:self.
|
|
228 |
].
|
|
229 |
workingCopyHolder := something.
|
|
230 |
workingCopyHolder notNil ifTrue:[
|
|
231 |
workingCopyHolder addDependent:self.
|
|
232 |
].
|
|
233 |
newValue := workingCopyHolder value.
|
|
234 |
oldValue ~~ newValue ifTrue:[
|
|
235 |
self update:#value with:newValue from:workingCopyHolder.
|
|
236 |
].
|
|
237 |
! !
|
|
238 |
|
|
239 |
!MCCommitDialog methodsFor:'change & update'!
|
|
240 |
|
|
241 |
messageChanged
|
|
242 |
|
|
243 |
self halt
|
|
244 |
|
|
245 |
"Created: / 15-09-2010 / 10:04:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
246 |
!
|
|
247 |
|
|
248 |
repositoryChanged
|
|
249 |
|
|
250 |
self updateAcceptEnabled
|
|
251 |
|
|
252 |
"Created: / 15-09-2010 / 14:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
253 |
!
|
|
254 |
|
|
255 |
update:something with:aParameter from:changedObject
|
|
256 |
"Invoked when an object that I depend upon sends a change notification."
|
|
257 |
|
|
258 |
"stub code automatically generated - please change as required"
|
|
259 |
|
|
260 |
changedObject == workingCopyHolder ifTrue:[
|
|
261 |
self workingCopyChanged.
|
|
262 |
^ self.
|
|
263 |
].
|
|
264 |
|
|
265 |
changedObject == messageHolder ifTrue:[
|
|
266 |
self messageChanged.
|
|
267 |
^ self.
|
|
268 |
].
|
|
269 |
changedObject == repositoryHolder ifTrue:[
|
|
270 |
self repositoryChanged.
|
|
271 |
^ self.
|
|
272 |
].
|
|
273 |
|
|
274 |
super update:something with:aParameter from:changedObject
|
|
275 |
|
|
276 |
"Modified: / 15-09-2010 / 14:02:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
277 |
!
|
|
278 |
|
|
279 |
updateAcceptEnabled
|
|
280 |
|
|
281 |
| enabled |
|
|
282 |
enabled := true.
|
|
283 |
enabled := enabled and:[self workingCopyHolder value notNil].
|
|
284 |
enabled := enabled and:[self repositoryHolder value notNil].
|
|
285 |
self acceptEnabledHolder value: enabled.
|
|
286 |
|
|
287 |
"Created: / 15-09-2010 / 14:01:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
288 |
!
|
|
289 |
|
|
290 |
workingCopyChanged
|
|
291 |
|
|
292 |
| wc |
|
|
293 |
wc := self workingCopyHolder value.
|
|
294 |
wc ifNil:[^self].
|
|
295 |
self subtitle: wc package name.
|
|
296 |
self versionNameHolder value: wc uniqueVersionName.
|
|
297 |
self updateAcceptEnabled
|
|
298 |
|
|
299 |
"Created: / 15-09-2010 / 09:30:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
300 |
"Modified: / 15-09-2010 / 14:01:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
301 |
! !
|
|
302 |
|
|
303 |
!MCCommitDialog methodsFor:'hooks'!
|
|
304 |
|
|
305 |
postBuildMessageView: aView
|
|
306 |
|
|
307 |
messageView := aView scrolledView
|
|
308 |
|
|
309 |
"Created: / 15-09-2010 / 13:56:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
310 |
! !
|
|
311 |
|
|
312 |
!MCCommitDialog class methodsFor:'documentation'!
|
|
313 |
|
|
314 |
version
|
440
|
315 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.2 2011-08-23 13:46:54 vrany Exp $'
|
360
|
316 |
!
|
|
317 |
|
|
318 |
version_CVS
|
440
|
319 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCCommitDialog.st,v 1.2 2011-08-23 13:46:54 vrany Exp $'
|
360
|
320 |
!
|
|
321 |
|
|
322 |
version_SVN
|
|
323 |
^ '§Id: MCCommitDialog.st 12 2010-09-15 13:13:22Z vranyj1 §'
|
|
324 |
! !
|