265
|
1 |
"
|
|
2 |
Copyright (c) 2007-2010 Jan Vrany
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
|
4 |
|
|
5 |
Permission is hereby granted, free of charge, to any person
|
|
6 |
obtaining a copy of this software and associated documentation
|
|
7 |
files (the 'Software'), to deal in the Software without
|
|
8 |
restriction, including without limitation the rights to use,
|
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10 |
copies of the Software, and to permit persons to whom the
|
|
11 |
Software is furnished to do so, subject to the following
|
|
12 |
conditions:
|
|
13 |
|
|
14 |
The above copyright notice and this permission notice shall be
|
|
15 |
included in all copies or substantial portions of the Software.
|
|
16 |
|
|
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
24 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
25 |
"
|
|
26 |
"{ Package: 'stx:goodies/monticello' }"
|
|
27 |
|
|
28 |
SimpleDialog subclass:#MCDialog
|
|
29 |
instanceVariableNames:'onCancelBlock onAcceptBlock modelHolder titleHolder
|
|
30 |
subtitleHolder infoHolder progressIndicator worker exception'
|
|
31 |
classVariableNames:'CatchExceptions'
|
|
32 |
poolDictionaries:''
|
584
|
33 |
category:'SCM-Monticello-St/X UI'
|
265
|
34 |
!
|
|
35 |
|
|
36 |
!MCDialog class methodsFor:'documentation'!
|
|
37 |
|
|
38 |
copyright
|
|
39 |
"
|
|
40 |
Copyright (c) 2007-2010 Jan Vrany
|
|
41 |
Copyright (c) 2009-2010 eXept Software AG
|
|
42 |
|
|
43 |
Permission is hereby granted, free of charge, to any person
|
|
44 |
obtaining a copy of this software and associated documentation
|
|
45 |
files (the 'Software'), to deal in the Software without
|
|
46 |
restriction, including without limitation the rights to use,
|
|
47 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
48 |
copies of the Software, and to permit persons to whom the
|
|
49 |
Software is furnished to do so, subject to the following
|
|
50 |
conditions:
|
|
51 |
|
|
52 |
The above copyright notice and this permission notice shall be
|
|
53 |
included in all copies or substantial portions of the Software.
|
|
54 |
|
|
55 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
56 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
57 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
58 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
59 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
60 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
61 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
62 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
63 |
|
|
64 |
"
|
|
65 |
! !
|
|
66 |
|
|
67 |
!MCDialog class methodsFor:'instance creation'!
|
|
68 |
|
|
69 |
on: model
|
|
70 |
|
|
71 |
^self new
|
|
72 |
model: model;
|
|
73 |
yourself
|
|
74 |
|
|
75 |
"Created: / 14-04-2008 / 11:09:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
76 |
! !
|
|
77 |
|
|
78 |
!MCDialog class methodsFor:'accessing'!
|
|
79 |
|
|
80 |
catchExceptions
|
|
81 |
|
|
82 |
^CatchExceptions isNil or:[CatchExceptions]
|
|
83 |
|
|
84 |
"Created: / 09-12-2009 / 16:22:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
85 |
!
|
|
86 |
|
|
87 |
catchExceptions: aBoolean
|
|
88 |
|
|
89 |
CatchExceptions := aBoolean
|
|
90 |
|
|
91 |
"Created: / 09-12-2009 / 16:22:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
92 |
! !
|
|
93 |
|
|
94 |
!MCDialog class methodsFor:'image specs'!
|
|
95 |
|
|
96 |
dialogIcon
|
|
97 |
^ "IconLibrary svn_wizban"nil
|
|
98 |
|
|
99 |
"Created: / 13-04-2008 / 11:06:56 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
100 |
"Modified: / 14-09-2010 / 22:59:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
101 |
!
|
|
102 |
|
|
103 |
downArrow
|
|
104 |
"This resource specification was automatically generated
|
|
105 |
by the ImageEditor of ST/X."
|
|
106 |
|
|
107 |
"Do not manually edit this!! If it is corrupted,
|
|
108 |
the ImageEditor may not be able to read the specification."
|
|
109 |
|
|
110 |
"
|
|
111 |
self downArrow inspect
|
|
112 |
ImageEditor openOnClass:self andSelector:#downArrow
|
|
113 |
Icon flushCachedIcons
|
|
114 |
"
|
|
115 |
|
|
116 |
<resource: #image>
|
|
117 |
|
|
118 |
^Icon
|
|
119 |
constantNamed:'SVN::Dialog class downArrow'
|
|
120 |
ifAbsentPut:[(Depth1Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0]; mask:((Depth1Image new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@C?@O<@_ @<@A @@@@@@@@@@@@@@b') ; yourself); yourself]
|
|
121 |
!
|
|
122 |
|
|
123 |
errorIcon
|
|
124 |
^ ToolbarIconLibrary error32x32Icon
|
|
125 |
|
|
126 |
"Created: / 09-12-2009 / 16:38:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
127 |
! !
|
|
128 |
|
|
129 |
!MCDialog class methodsFor:'interface opening'!
|
|
130 |
|
|
131 |
openOn: model
|
|
132 |
|
|
133 |
|
|
134 |
^(self on: model) open
|
|
135 |
|
|
136 |
"Created: / 14-04-2008 / 11:09:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
137 |
"Modified: / 19-04-2008 / 13:17:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
138 |
! !
|
|
139 |
|
|
140 |
!MCDialog class methodsFor:'interface specs'!
|
|
141 |
|
|
142 |
buttonsSpec
|
|
143 |
"This resource specification was automatically generated
|
|
144 |
by the UIPainter of ST/X."
|
|
145 |
|
|
146 |
"Do not manually edit this!! If it is corrupted,
|
|
147 |
the UIPainter may not be able to read the specification."
|
|
148 |
|
|
149 |
"
|
539
|
150 |
UIPainter new openOnClass:MCDialog andSelector:#buttonsSpec
|
|
151 |
MCDialog new openInterface:#buttonsSpec
|
265
|
152 |
"
|
|
153 |
|
|
154 |
<resource: #canvas>
|
|
155 |
|
|
156 |
^
|
|
157 |
#(FullSpec
|
|
158 |
name: buttonsSpec
|
|
159 |
window:
|
|
160 |
(WindowSpec
|
|
161 |
label: 'Buttons'
|
|
162 |
name: 'Buttons'
|
|
163 |
min: (Point 10 10)
|
|
164 |
bounds: (Rectangle 0 0 400 30)
|
|
165 |
)
|
|
166 |
component:
|
|
167 |
(SpecCollection
|
|
168 |
collection: (
|
|
169 |
(HorizontalPanelViewSpec
|
|
170 |
name: 'ButtonPanel'
|
|
171 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
172 |
horizontalLayout: rightSpace
|
|
173 |
verticalLayout: center
|
|
174 |
horizontalSpace: 3
|
|
175 |
verticalSpace: 3
|
|
176 |
component:
|
|
177 |
(SpecCollection
|
|
178 |
collection: (
|
|
179 |
(ActionButtonSpec
|
|
180 |
label: 'OK'
|
|
181 |
name: 'AcceptButton'
|
|
182 |
translateLabel: true
|
|
183 |
labelChannel: acceptButtonTitleAspect
|
|
184 |
model: doAccept
|
|
185 |
enableChannel: acceptEnabledHolder
|
539
|
186 |
isDefault: true
|
|
187 |
defaultable: true
|
265
|
188 |
extent: (Point 125 22)
|
|
189 |
)
|
|
190 |
(ActionButtonSpec
|
|
191 |
label: 'Cancel'
|
|
192 |
name: 'CancelButton'
|
|
193 |
translateLabel: true
|
|
194 |
model: doCancel
|
|
195 |
extent: (Point 125 22)
|
|
196 |
)
|
|
197 |
)
|
|
198 |
|
|
199 |
)
|
|
200 |
)
|
|
201 |
)
|
|
202 |
|
|
203 |
)
|
|
204 |
)
|
|
205 |
!
|
|
206 |
|
|
207 |
contentSpec
|
|
208 |
"This resource specification was automatically generated
|
|
209 |
by the UIPainter of ST/X."
|
|
210 |
|
|
211 |
"Do not manually edit this!! If it is corrupted,
|
|
212 |
the UIPainter may not be able to read the specification."
|
|
213 |
|
|
214 |
"
|
|
215 |
UIPainter new openOnClass:SVN::Dialog andSelector:#contentSpec
|
|
216 |
SVN::Dialog new openInterface:#contentSpec
|
|
217 |
"
|
|
218 |
|
|
219 |
<resource: #canvas>
|
|
220 |
|
|
221 |
^
|
|
222 |
#(FullSpec
|
|
223 |
name: contentSpec
|
|
224 |
window:
|
|
225 |
(WindowSpec
|
|
226 |
label: 'Dialog'
|
|
227 |
name: 'Dialog'
|
|
228 |
min: (Point 10 10)
|
|
229 |
bounds: (Rectangle 0 0 300 300)
|
|
230 |
)
|
|
231 |
component:
|
|
232 |
(SpecCollection
|
|
233 |
collection: (
|
|
234 |
(LabelSpec
|
|
235 |
label: 'You should override #contentSpec'
|
|
236 |
name: 'Message'
|
|
237 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
238 |
translateLabel: true
|
|
239 |
)
|
|
240 |
)
|
|
241 |
|
|
242 |
)
|
|
243 |
)
|
|
244 |
!
|
|
245 |
|
|
246 |
errorSpec
|
|
247 |
"This resource specification was automatically generated
|
|
248 |
by the UIPainter of ST/X."
|
|
249 |
|
|
250 |
"Do not manually edit this!! If it is corrupted,
|
|
251 |
the UIPainter may not be able to read the specification."
|
|
252 |
|
|
253 |
"
|
|
254 |
UIPainter new openOnClass:SVN::Dialog andSelector:#errorSpec
|
|
255 |
SVN::Dialog new openInterface:#errorSpec
|
|
256 |
"
|
|
257 |
|
|
258 |
<resource: #canvas>
|
|
259 |
|
|
260 |
^
|
|
261 |
#(FullSpec
|
|
262 |
name: errorSpec
|
|
263 |
window:
|
|
264 |
(WindowSpec
|
|
265 |
label: 'Error'
|
|
266 |
name: 'Error'
|
|
267 |
min: (Point 10 10)
|
|
268 |
bounds: (Rectangle 0 0 300 300)
|
|
269 |
)
|
|
270 |
component:
|
|
271 |
(SpecCollection
|
|
272 |
collection: (
|
|
273 |
(LabelSpec
|
|
274 |
label: 'errorIcon'
|
|
275 |
name: 'ErrorIcon'
|
|
276 |
layout: (LayoutFrame 0 0 0 0 35 0 35 0)
|
|
277 |
hasCharacterOrientedLabel: false
|
|
278 |
translateLabel: true
|
|
279 |
)
|
|
280 |
(LabelSpec
|
|
281 |
name: 'ErrorMessage'
|
|
282 |
layout: (LayoutFrame 35 0 0 0 0 1 0 1)
|
|
283 |
translateLabel: true
|
|
284 |
labelChannel: infoHolder
|
|
285 |
)
|
|
286 |
)
|
|
287 |
|
|
288 |
)
|
|
289 |
)
|
|
290 |
!
|
|
291 |
|
|
292 |
messageSpec
|
|
293 |
"This resource specification was automatically generated
|
|
294 |
by the UIPainter of ST/X."
|
|
295 |
|
|
296 |
"Do not manually edit this!! If it is corrupted,
|
|
297 |
the UIPainter may not be able to read the specification."
|
|
298 |
|
|
299 |
"
|
|
300 |
UIPainter new openOnClass:SVN::Dialog andSelector:#messageSpec
|
|
301 |
SVN::Dialog new openInterface:#messageSpec
|
|
302 |
"
|
|
303 |
|
|
304 |
<resource: #canvas>
|
|
305 |
|
|
306 |
^
|
|
307 |
#(FullSpec
|
|
308 |
name: messageSpec
|
|
309 |
window:
|
|
310 |
(WindowSpec
|
|
311 |
label: 'Message'
|
|
312 |
name: 'Message'
|
|
313 |
min: (Point 10 10)
|
|
314 |
bounds: (Rectangle 0 0 300 300)
|
|
315 |
)
|
|
316 |
component:
|
|
317 |
(SpecCollection
|
|
318 |
collection: (
|
|
319 |
(HTMLViewSpec
|
|
320 |
name: 'HTMLBrowser'
|
|
321 |
layout: (LayoutFrame 20 0 20 0 -20 1 -20 1)
|
|
322 |
level: 0
|
|
323 |
hasHorizontalScrollBar: true
|
|
324 |
hasVerticalScrollBar: true
|
|
325 |
htmlText: infoHolder
|
|
326 |
)
|
|
327 |
)
|
|
328 |
|
|
329 |
)
|
|
330 |
)
|
|
331 |
!
|
|
332 |
|
|
333 |
progressSpec
|
|
334 |
"This resource specification was automatically generated
|
|
335 |
by the UIPainter of ST/X."
|
|
336 |
|
|
337 |
"Do not manually edit this!! If it is corrupted,
|
|
338 |
the UIPainter may not be able to read the specification."
|
|
339 |
|
|
340 |
"
|
|
341 |
UIPainter new openOnClass:SVN::Dialog andSelector:#progressSpec
|
|
342 |
SVN::Dialog new openInterface:#progressSpec
|
|
343 |
"
|
|
344 |
|
|
345 |
<resource: #canvas>
|
|
346 |
|
|
347 |
^
|
|
348 |
#(FullSpec
|
|
349 |
name: progressSpec
|
|
350 |
window:
|
|
351 |
(WindowSpec
|
|
352 |
label: 'Progress'
|
|
353 |
name: 'Progress'
|
|
354 |
min: (Point 10 10)
|
|
355 |
bounds: (Rectangle 0 0 300 300)
|
|
356 |
)
|
|
357 |
component:
|
|
358 |
(SpecCollection
|
|
359 |
collection: (
|
|
360 |
(VerticalPanelViewSpec
|
|
361 |
name: 'InfoPanel'
|
|
362 |
layout: (LayoutFrame 20 0 20 0 -20 1 -20 1)
|
|
363 |
horizontalLayout: fit
|
|
364 |
verticalLayout: center
|
|
365 |
horizontalSpace: 3
|
|
366 |
verticalSpace: 3
|
|
367 |
component:
|
|
368 |
(SpecCollection
|
|
369 |
collection: (
|
|
370 |
(LabelSpec
|
|
371 |
label: 'Working'
|
|
372 |
name: 'InfoHolder'
|
|
373 |
translateLabel: true
|
|
374 |
labelChannel: infoHolder
|
|
375 |
adjust: left
|
|
376 |
useDefaultExtent: true
|
|
377 |
)
|
|
378 |
(ProgressIndicatorSpec
|
|
379 |
name: 'ProgressIndicator'
|
|
380 |
model: progressHolder
|
|
381 |
isActivityIndicator: true
|
|
382 |
postBuildCallback: postBuildProgressIndicator:
|
|
383 |
useDefaultExtent: true
|
|
384 |
)
|
|
385 |
)
|
|
386 |
|
|
387 |
)
|
|
388 |
)
|
|
389 |
)
|
|
390 |
|
|
391 |
)
|
|
392 |
)
|
|
393 |
!
|
|
394 |
|
|
395 |
windowSpec
|
|
396 |
"This resource specification was automatically generated
|
|
397 |
by the UIPainter of ST/X."
|
|
398 |
|
|
399 |
"Do not manually edit this!! If it is corrupted,
|
|
400 |
the UIPainter may not be able to read the specification."
|
|
401 |
|
|
402 |
"
|
539
|
403 |
UIPainter new openOnClass:MCDialog andSelector:#windowSpec
|
|
404 |
MCDialog new openInterface:#windowSpec
|
|
405 |
MCDialog open
|
265
|
406 |
"
|
|
407 |
|
|
408 |
<resource: #canvas>
|
|
409 |
|
|
410 |
^
|
|
411 |
#(FullSpec
|
|
412 |
name: windowSpec
|
|
413 |
window:
|
|
414 |
(WindowSpec
|
|
415 |
label: 'SubVersion: Commit '
|
|
416 |
name: 'SubVersion: Commit '
|
|
417 |
labelChannel: titleHolder
|
|
418 |
min: (Point 10 10)
|
|
419 |
bounds: (Rectangle 0 0 648 451)
|
|
420 |
)
|
|
421 |
component:
|
|
422 |
(SpecCollection
|
|
423 |
collection: (
|
|
424 |
(ViewSpec
|
|
425 |
name: 'TitleBox'
|
|
426 |
layout: (LayoutFrame 0 0 0 0 0 1 66 0)
|
|
427 |
backgroundColor: (Color 100.0 100.0 100.0)
|
|
428 |
component:
|
|
429 |
(SpecCollection
|
|
430 |
collection: (
|
|
431 |
(LabelSpec
|
|
432 |
label: 'SVN Dialog'
|
|
433 |
name: 'DialogTitle'
|
|
434 |
layout: (LayoutFrame 10 0 0 0 -75 1 40 0)
|
|
435 |
style: (FontDescription helvetica medium roman 18 #'iso10646-1')
|
|
436 |
backgroundColor: (Color 100.0 100.0 100.0)
|
|
437 |
translateLabel: true
|
|
438 |
labelChannel: titleHolder
|
|
439 |
adjust: left
|
|
440 |
)
|
|
441 |
(LabelSpec
|
|
442 |
label: 'SVN Dialog Subtitle'
|
|
443 |
name: 'DialogSubtitle'
|
|
444 |
layout: (LayoutFrame 30 0 40 0 -75 1 66 0)
|
|
445 |
backgroundColor: (Color 100.0 100.0 100.0)
|
|
446 |
translateLabel: true
|
|
447 |
labelChannel: subtitleHolder
|
|
448 |
resizeForLabel: false
|
|
449 |
adjust: left
|
|
450 |
)
|
|
451 |
(LabelSpec
|
|
452 |
label: 'Icon'
|
|
453 |
name: 'DialogIcon'
|
|
454 |
layout: (LayoutFrame -75 1 0 0 0 1 66 0)
|
|
455 |
hasCharacterOrientedLabel: false
|
|
456 |
backgroundColor: (Color 100.0 100.0 100.0)
|
|
457 |
translateLabel: true
|
|
458 |
labelChannel: dialogIconAspect
|
|
459 |
)
|
|
460 |
)
|
|
461 |
|
|
462 |
)
|
|
463 |
)
|
|
464 |
(SubCanvasSpec
|
|
465 |
name: 'Content'
|
|
466 |
layout: (LayoutFrame 5 0 70 0 -5 1 -50 1)
|
|
467 |
hasHorizontalScrollBar: false
|
|
468 |
hasVerticalScrollBar: false
|
|
469 |
specHolder: contentSpecHolder
|
|
470 |
createNewBuilder: false
|
|
471 |
)
|
|
472 |
(DividerSpec
|
|
473 |
name: 'Separator'
|
|
474 |
layout: (LayoutFrame 5 0 -50 1 -5 1 -30 1)
|
|
475 |
)
|
|
476 |
(UISubSpecification
|
|
477 |
name: 'Buttons'
|
|
478 |
layout: (LayoutFrame 130 0 -30 1 0 1 0 1)
|
|
479 |
minorKey: buttonsSpec
|
770
|
480 |
keepSpaceForOSXResizeHandleH: true
|
265
|
481 |
)
|
|
482 |
(LinkButtonSpec
|
|
483 |
label: 'Help'
|
|
484 |
name: 'Help'
|
539
|
485 |
layout: (LayoutFrame 53 0 -26 1 153 0 -3 1)
|
568
|
486 |
visibilityChannel: false
|
|
487 |
foregroundColor: (Color 0.0 0.0 86.9993133440147)
|
265
|
488 |
translateLabel: true
|
|
489 |
model: doHelp
|
|
490 |
)
|
|
491 |
(MenuPanelSpec
|
|
492 |
name: 'More'
|
539
|
493 |
layout: (LayoutFrame 0 0 -30 1 62 0 0 1)
|
265
|
494 |
level: 0
|
|
495 |
model: doInspect
|
|
496 |
menu: actionsMenu
|
|
497 |
)
|
|
498 |
)
|
|
499 |
|
|
500 |
)
|
|
501 |
)
|
|
502 |
! !
|
|
503 |
|
|
504 |
!MCDialog class methodsFor:'menu specs'!
|
|
505 |
|
|
506 |
actionsMenu
|
|
507 |
"This resource specification was automatically generated
|
|
508 |
by the MenuEditor of ST/X."
|
|
509 |
|
|
510 |
"Do not manually edit this!! If it is corrupted,
|
|
511 |
the MenuEditor may not be able to read the specification."
|
|
512 |
|
539
|
513 |
|
265
|
514 |
"
|
539
|
515 |
MenuEditor new openOnClass:MCDialog andSelector:#actionsMenu
|
|
516 |
(Menu new fromLiteralArrayEncoding:(MCDialog actionsMenu)) startUp
|
265
|
517 |
"
|
|
518 |
|
|
519 |
<resource: #menu>
|
|
520 |
|
|
521 |
^
|
|
522 |
#(Menu
|
|
523 |
(
|
|
524 |
(MenuItem
|
539
|
525 |
label: 'Debug'
|
265
|
526 |
translateLabel: true
|
539
|
527 |
isButton: true
|
265
|
528 |
submenu:
|
|
529 |
(Menu
|
|
530 |
(
|
|
531 |
(MenuItem
|
|
532 |
label: 'Catch exceptions'
|
|
533 |
translateLabel: true
|
|
534 |
indication: catchExceptionsAspect
|
|
535 |
)
|
|
536 |
(MenuItem
|
|
537 |
label: 'Inspect model'
|
|
538 |
itemValue: doInspect
|
|
539 |
translateLabel: true
|
|
540 |
)
|
|
541 |
(MenuItem
|
|
542 |
label: 'Inspect dialog'
|
|
543 |
itemValue: doInspectDialog
|
|
544 |
translateLabel: true
|
|
545 |
)
|
|
546 |
)
|
|
547 |
nil
|
|
548 |
nil
|
|
549 |
)
|
|
550 |
)
|
|
551 |
)
|
|
552 |
nil
|
|
553 |
nil
|
|
554 |
)
|
|
555 |
! !
|
|
556 |
|
|
557 |
!MCDialog methodsFor:'accessing'!
|
|
558 |
|
|
559 |
acceptButtonLabel
|
|
560 |
^ 'OK'
|
|
561 |
|
|
562 |
"Created: / 13-04-2008 / 11:06:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
563 |
!
|
|
564 |
|
|
565 |
acceptEnabled
|
|
566 |
^ self acceptEnabledHolder value
|
|
567 |
|
|
568 |
"Created: / 16-08-2009 / 17:18:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
569 |
!
|
|
570 |
|
|
571 |
acceptEnabled:aBoolean
|
|
572 |
self acceptEnabledHolder value:aBoolean
|
|
573 |
|
|
574 |
"Created: / 03-10-2008 / 14:29:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
575 |
!
|
|
576 |
|
|
577 |
contentSpec
|
|
578 |
|
|
579 |
^self contentSpecHolder value
|
|
580 |
|
|
581 |
"Created: / 21-10-2008 / 12:39:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
582 |
!
|
|
583 |
|
|
584 |
contentSpec: aSymbol
|
|
585 |
|
|
586 |
self contentSpecHolder value: aSymbol
|
|
587 |
|
|
588 |
"Created: / 21-10-2008 / 12:38:56 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
589 |
!
|
|
590 |
|
|
591 |
info: aString
|
|
592 |
|
|
593 |
^self infoHolder value: aString
|
|
594 |
|
|
595 |
"Created: / 09-04-2009 / 08:00:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
596 |
!
|
|
597 |
|
|
598 |
model
|
|
599 |
^self modelHolder value
|
|
600 |
|
|
601 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog"
|
|
602 |
"Created: / 12-04-2008 / 20:50:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
603 |
!
|
|
604 |
|
|
605 |
model:aModel
|
|
606 |
self modelHolder subjectChannel:aModel
|
|
607 |
"aModel isValueModel
|
|
608 |
ifTrue:[self modelHolder subjectChannel:aModel]
|
|
609 |
ifFalse:[self modelHolder subject:aModel]."
|
|
610 |
|
|
611 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog"
|
|
612 |
"Created: / 12-04-2008 / 20:50:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
613 |
!
|
|
614 |
|
|
615 |
modelHolder
|
|
616 |
^ modelHolder
|
|
617 |
ifNil:[
|
|
618 |
modelHolder := (AspectAdaptor subjectChannel:self defaultModel)
|
|
619 |
forAspect:#value
|
|
620 |
]
|
|
621 |
|
|
622 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog"
|
|
623 |
"Created: / 12-04-2008 / 20:50:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
624 |
"Modified: / 03-10-2008 / 14:57:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
625 |
!
|
|
626 |
|
|
627 |
subtitle
|
|
628 |
"return the value in 'dialogSubtitleHolder'"
|
|
629 |
|
|
630 |
^ self subtitleHolder value
|
|
631 |
|
|
632 |
"Created: / 22-10-2008 / 12:40:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
633 |
"Modified: / 09-04-2009 / 07:53:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
634 |
!
|
|
635 |
|
|
636 |
subtitle:newValue
|
|
637 |
"set the value in 'dialogSubtitleHolder'"
|
|
638 |
|
|
639 |
self subtitleHolder value:' ' , newValue
|
|
640 |
|
|
641 |
"Created: / 22-10-2008 / 12:40:14 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
642 |
"Modified: / 09-04-2009 / 07:53:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
643 |
!
|
|
644 |
|
|
645 |
title
|
|
646 |
|
|
647 |
^self dialogTitleAspect value
|
|
648 |
|
|
649 |
"Created: / 22-10-2008 / 12:40:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
650 |
!
|
|
651 |
|
|
652 |
title: aString
|
|
653 |
|
|
654 |
^self titleHolder value: aString
|
|
655 |
|
|
656 |
"Created: / 22-10-2008 / 12:40:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
657 |
"Modified: / 09-04-2009 / 14:12:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
658 |
! !
|
|
659 |
|
|
660 |
!MCDialog methodsFor:'accessing - defaults'!
|
|
661 |
|
|
662 |
defaultContentSpec
|
|
663 |
|
|
664 |
^#contentSpec
|
|
665 |
|
|
666 |
"Created: / 21-10-2008 / 12:35:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
667 |
!
|
|
668 |
|
|
669 |
defaultModel
|
|
670 |
^ nil
|
|
671 |
|
|
672 |
"Created: / 03-10-2008 / 14:57:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
673 |
!
|
|
674 |
|
|
675 |
defaultSubtitle
|
|
676 |
|
|
677 |
^''
|
|
678 |
|
|
679 |
"Created: / 03-10-2008 / 13:54:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
680 |
!
|
|
681 |
|
|
682 |
defaultTitle
|
|
683 |
^ self subclassResponsibility
|
|
684 |
|
|
685 |
"Created: / 03-10-2008 / 13:58:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
686 |
! !
|
|
687 |
|
|
688 |
!MCDialog methodsFor:'actions'!
|
|
689 |
|
|
690 |
doAccept
|
|
691 |
self acceptEnabled ifTrue:[
|
|
692 |
super doAccept
|
|
693 |
]
|
|
694 |
|
|
695 |
"Created: / 16-08-2009 / 17:18:47 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
696 |
!
|
|
697 |
|
|
698 |
doCancel
|
|
699 |
|
|
700 |
"Terminate a worker process, if any"
|
|
701 |
worker ifNotNil:[worker terminate].
|
|
702 |
"And close"
|
|
703 |
super doCancel
|
|
704 |
|
|
705 |
"Created: / 28-10-2008 / 14:47:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
706 |
!
|
|
707 |
|
|
708 |
doHelp
|
|
709 |
<resource: #uiCallback>
|
|
710 |
|
568
|
711 |
Dialog information: 'Sorry: no help (yet)'.
|
|
712 |
|
|
713 |
"Modified: / 24-07-2012 / 16:20:22 / cg"
|
265
|
714 |
!
|
|
715 |
|
|
716 |
doInspect
|
|
717 |
|
|
718 |
self model inspect
|
|
719 |
!
|
|
720 |
|
|
721 |
doInspectDialog
|
|
722 |
|
|
723 |
self inspect
|
|
724 |
|
|
725 |
"Created: / 10-03-2010 / 15:30:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
726 |
! !
|
|
727 |
|
|
728 |
!MCDialog methodsFor:'aspects'!
|
|
729 |
|
|
730 |
acceptButtonTitleAspect
|
|
731 |
^ self acceptButtonLabel
|
|
732 |
|
|
733 |
"Modified: / 31-03-2008 / 18:53:56 / janfrog"
|
|
734 |
"Created: / 13-04-2008 / 11:08:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
735 |
!
|
|
736 |
|
|
737 |
acceptEnabledHolder
|
|
738 |
|holder|
|
|
739 |
|
|
740 |
(holder := builder bindingAt:#acceptEnabledHolder) isNil ifTrue:[
|
|
741 |
holder := false asValue.
|
|
742 |
builder aspectAt:#acceptEnabledHolder put:holder.
|
|
743 |
].
|
|
744 |
^ holder.
|
|
745 |
|
|
746 |
"Created: / 14-04-2008 / 11:17:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
747 |
"Modified: / 14-04-2008 / 12:56:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
748 |
!
|
|
749 |
|
|
750 |
catchExceptionsAspect
|
|
751 |
|
|
752 |
^(AspectAdaptor forAspect:#catchExceptions)
|
|
753 |
subject: self class
|
|
754 |
|
|
755 |
"Created: / 09-12-2009 / 16:23:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
756 |
!
|
|
757 |
|
|
758 |
contentSpecHolder
|
|
759 |
<resource: #uiAspect>
|
|
760 |
|
|
761 |
|holder|
|
|
762 |
|
|
763 |
(holder := builder bindingAt:#contentSpecHolder) isNil ifTrue:[
|
|
764 |
holder := self defaultContentSpec asValue.
|
|
765 |
holder onChangeSend:#contentSpecChanged to: self.
|
|
766 |
builder aspectAt:#contentSpecHolder put:holder.
|
|
767 |
].
|
|
768 |
^ holder.
|
|
769 |
|
|
770 |
"Created: / 21-10-2008 / 12:34:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
771 |
"Modified: / 22-10-2008 / 11:22:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
772 |
!
|
|
773 |
|
|
774 |
dialogIconAspect
|
|
775 |
^ self class dialogIcon
|
|
776 |
|
|
777 |
"Created: / 13-04-2008 / 11:05:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
778 |
!
|
|
779 |
|
|
780 |
infoHolder
|
|
781 |
"return/create the 'infoHolder' value holder (automatically generated)"
|
|
782 |
|
|
783 |
infoHolder isNil ifTrue:[
|
|
784 |
infoHolder := ValueHolder new.
|
|
785 |
].
|
|
786 |
^ infoHolder
|
|
787 |
!
|
|
788 |
|
|
789 |
progressHolder
|
|
790 |
<resource: #uiAspect>
|
|
791 |
|
|
792 |
|holder|
|
|
793 |
|
|
794 |
(holder := builder bindingAt:#progressHolder) isNil ifTrue:[
|
|
795 |
holder := nil asValue.
|
|
796 |
builder aspectAt:#progressHolder put:holder.
|
|
797 |
].
|
|
798 |
^ holder.
|
|
799 |
|
|
800 |
"Created: / 21-10-2008 / 12:24:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
801 |
!
|
|
802 |
|
|
803 |
subtitleHolder
|
|
804 |
"return/create the valueHolder 'dialogSubtitleHolder'"
|
|
805 |
|
|
806 |
subtitleHolder isNil ifTrue:[
|
|
807 |
subtitleHolder := self defaultSubtitle asValue
|
|
808 |
].
|
|
809 |
^ subtitleHolder
|
|
810 |
|
|
811 |
"Created: / 03-10-2008 / 13:53:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
812 |
"Modified: / 09-04-2009 / 07:53:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
813 |
!
|
|
814 |
|
|
815 |
titleHolder
|
|
816 |
titleHolder isNil ifTrue:[
|
|
817 |
titleHolder := self defaultTitle asValue.
|
|
818 |
].
|
|
819 |
^titleHolder
|
|
820 |
|
|
821 |
"Modified: / 31-03-2008 / 18:53:56 / janfrog"
|
|
822 |
"Created: / 13-04-2008 / 11:05:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
823 |
"Modified: / 09-04-2009 / 07:52:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
824 |
! !
|
|
825 |
|
|
826 |
!MCDialog methodsFor:'change & update'!
|
|
827 |
|
|
828 |
contentSpecChanged
|
|
829 |
|
|
830 |
self contentSpecChanged: self contentSpec
|
|
831 |
|
|
832 |
"Created: / 22-10-2008 / 11:22:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
833 |
"Modified: / 06-11-2008 / 18:31:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
834 |
!
|
|
835 |
|
|
836 |
contentSpecChanged: specSymbol
|
|
837 |
|
|
838 |
"nothing to do here"
|
|
839 |
|
|
840 |
"Created: / 06-11-2008 / 18:31:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
841 |
! !
|
|
842 |
|
|
843 |
!MCDialog methodsFor:'events'!
|
|
844 |
|
|
845 |
closeAccept
|
|
846 |
|
|
847 |
[onAcceptBlock ifNotNil:[onAcceptBlock value: self]]
|
|
848 |
ensure:[super closeAccept]
|
|
849 |
!
|
|
850 |
|
|
851 |
closeCancel
|
|
852 |
|
|
853 |
[onCancelBlock ifNotNil:[onCancelBlock value: self]]
|
|
854 |
ensure:[super closeCancel]
|
|
855 |
!
|
|
856 |
|
|
857 |
closeWindow
|
|
858 |
|
|
859 |
worker
|
|
860 |
ifNotNil:[worker addExitAction:[self closeWindow]]
|
|
861 |
ifNil:[super closeWindow]
|
|
862 |
|
|
863 |
"Created: / 01-11-2009 / 16:33:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
864 |
! !
|
|
865 |
|
|
866 |
!MCDialog methodsFor:'hooks'!
|
|
867 |
|
|
868 |
onAccept: aBlock
|
|
869 |
|
|
870 |
onAcceptBlock := aBlock
|
|
871 |
!
|
|
872 |
|
|
873 |
onCancel: aBlock
|
|
874 |
|
|
875 |
onCancelBlock := aBlock
|
|
876 |
!
|
|
877 |
|
|
878 |
postBuildProgressIndicator:aView
|
|
879 |
<resource: #uiCallback>
|
|
880 |
|
|
881 |
progressIndicator := aView
|
|
882 |
|
|
883 |
"Modified: / 28-10-2008 / 12:50:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
884 |
! !
|
|
885 |
|
|
886 |
!MCDialog methodsFor:'initialization'!
|
|
887 |
|
|
888 |
initialize
|
|
889 |
|
|
890 |
super initialize.
|
|
891 |
self createBuilder
|
|
892 |
|
|
893 |
"Created: / 22-10-2008 / 12:37:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
894 |
! !
|
|
895 |
|
|
896 |
!MCDialog methodsFor:'private'!
|
|
897 |
|
|
898 |
handleError: ex
|
|
899 |
|
|
900 |
self class catchExceptions ifFalse:[ex pass].
|
|
901 |
self showError: ex description.
|
|
902 |
|
|
903 |
"Created: / 09-12-2009 / 16:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
904 |
!
|
|
905 |
|
|
906 |
handleNotification:ex
|
|
907 |
|
|
908 |
self info:ex messageText.
|
|
909 |
ex parameter isNumber
|
|
910 |
ifTrue:
|
|
911 |
[progressIndicator showBusyIndication:false.
|
|
912 |
self progressHolder value:ex parameter]
|
|
913 |
ifFalse:
|
|
914 |
[progressIndicator showBusyIndication:true].
|
|
915 |
ex proceed.
|
|
916 |
|
|
917 |
"Modified: / 09-12-2009 / 16:32:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
918 |
!
|
|
919 |
|
|
920 |
handleUserConfirmation: ex
|
|
921 |
|
|
922 |
^ex proceedWith: ex defaultAction
|
|
923 |
|
|
924 |
"Created: / 09-12-2009 / 16:31:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
925 |
!
|
|
926 |
|
|
927 |
showContent
|
|
928 |
|
|
929 |
self
|
|
930 |
contentSpec: #contentSpec.
|
|
931 |
|
|
932 |
"Created: / 09-04-2009 / 08:14:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
933 |
!
|
|
934 |
|
|
935 |
showError: aString
|
|
936 |
|
|
937 |
self
|
|
938 |
info: aString;
|
|
939 |
contentSpec: #errorSpec
|
|
940 |
|
|
941 |
"Created: / 09-12-2009 / 16:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
942 |
!
|
|
943 |
|
|
944 |
showMessage: aString
|
|
945 |
|
|
946 |
self
|
|
947 |
info: aString;
|
|
948 |
contentSpec: #messageSpec.
|
|
949 |
|
|
950 |
"Created: / 09-04-2009 / 08:14:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
951 |
!
|
|
952 |
|
|
953 |
showProgressWhile:aBlock
|
|
954 |
|prevSpec|
|
|
955 |
|
|
956 |
prevSpec := self contentSpec.
|
|
957 |
self contentSpec:#progressSpec.
|
|
958 |
worker :=
|
|
959 |
[[ aBlock on: UserConfirmation do: [:ex|self handleUserConfirmation: ex] ]
|
|
960 |
on: (ActivityNotification , ProgressNotification)
|
|
961 |
do: [:ex|self handleNotification: ex]
|
|
962 |
on: Error
|
|
963 |
do: [:ex|self handleError: ex].
|
|
964 |
worker := nil] newProcess.
|
|
965 |
worker
|
|
966 |
addExitAction:[
|
|
967 |
self contentSpec == #progressSpec ifTrue:[
|
|
968 |
self contentSpec:prevSpec
|
|
969 |
].
|
|
970 |
worker := nil
|
|
971 |
];
|
|
972 |
resume.
|
|
973 |
|
|
974 |
"Created: / 21-10-2008 / 12:07:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
975 |
"Modified: / 09-04-2009 / 08:28:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
976 |
"Modified: / 09-12-2009 / 16:42:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
977 |
! !
|
|
978 |
|
|
979 |
!MCDialog class methodsFor:'documentation'!
|
|
980 |
|
|
981 |
version
|
770
|
982 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDialog.st,v 1.6 2013-03-28 00:13:45 cg Exp $'
|
265
|
983 |
!
|
|
984 |
|
|
985 |
version_CVS
|
770
|
986 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCDialog.st,v 1.6 2013-03-28 00:13:45 cg Exp $'
|
265
|
987 |
!
|
|
988 |
|
|
989 |
version_SVN
|
|
990 |
^ '§Id: MCDialog.st 12 2010-09-15 13:13:22Z vranyj1 §'
|
|
991 |
! !
|
770
|
992 |
|