320
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
AbstractSettingsApplication subclass:#MCSettingsApp
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-St/X UI'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCSettingsApp class methodsFor:'* As yet uncategorized *'!
|
|
12 |
|
|
13 |
managerTypeName
|
|
14 |
|
|
15 |
^ 'Monticello'
|
|
16 |
|
|
17 |
"Created: / 21-07-2011 / 11:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
18 |
! !
|
|
19 |
|
|
20 |
!MCSettingsApp class methodsFor:'help specs'!
|
|
21 |
|
|
22 |
flyByHelpSpec
|
|
23 |
|
|
24 |
<resource: #help>
|
|
25 |
|
|
26 |
^self helpSpec
|
|
27 |
|
|
28 |
"Created: / 26-05-2008 / 14:25:31 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
29 |
!
|
|
30 |
|
|
31 |
helpSpec
|
|
32 |
"This resource specification was automatically generated
|
|
33 |
by the UIHelpTool of ST/X."
|
|
34 |
|
|
35 |
"Do not manually edit this!! If it is corrupted,
|
|
36 |
the UIHelpTool may not be able to read the specification."
|
|
37 |
|
|
38 |
"
|
|
39 |
UIHelpTool openOnClass:SVN::SettingsApp
|
|
40 |
"
|
|
41 |
|
|
42 |
<resource: #help>
|
|
43 |
|
|
44 |
^ super helpSpec addPairsFrom:#(
|
|
45 |
|
|
46 |
#Package
|
|
47 |
''
|
|
48 |
|
|
49 |
)
|
|
50 |
|
|
51 |
"Modified: / 26-05-2008 / 14:24:15 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
52 |
! !
|
|
53 |
|
|
54 |
!MCSettingsApp class methodsFor:'image specs'!
|
|
55 |
|
|
56 |
defaultIcon
|
|
57 |
|
|
58 |
"^SVN::IconLibrary svn_wizban2 magnifiedTo: 24@24"
|
|
59 |
^nil
|
|
60 |
|
|
61 |
"Created: / 26-05-2008 / 14:55:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
62 |
"Modified: / 16-09-2010 / 14:02:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
63 |
!
|
|
64 |
|
|
65 |
svnIcon
|
|
66 |
"^ IconLibrary svn_wizban"
|
|
67 |
^nil
|
|
68 |
|
|
69 |
"Created: / 24-05-2008 / 01:44:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
70 |
"Modified: / 16-09-2010 / 14:02:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
71 |
! !
|
|
72 |
|
|
73 |
!MCSettingsApp class methodsFor:'interface opening'!
|
|
74 |
|
|
75 |
open
|
|
76 |
|
|
77 |
| settingsApp |
|
|
78 |
|
|
79 |
settingsApp := SettingsDialog new.
|
|
80 |
settingsApp addApplClass:self fullName
|
|
81 |
withName:'Subversion'.
|
|
82 |
settingsApp showRoot: false.
|
|
83 |
settingsApp selectedItem value:
|
|
84 |
(settingsApp applicationList root children anyOne).
|
|
85 |
settingsApp open.
|
|
86 |
|
|
87 |
"Created: / 26-05-2008 / 12:17:20 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
88 |
"Modified: / 27-02-2010 / 17:07:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
89 |
! !
|
|
90 |
|
|
91 |
!MCSettingsApp class methodsFor:'interface specs'!
|
|
92 |
|
|
93 |
windowSpec
|
|
94 |
"This resource specification was automatically generated
|
|
95 |
by the UIPainter of ST/X."
|
|
96 |
|
|
97 |
"Do not manually edit this!! If it is corrupted,
|
|
98 |
the UIPainter may not be able to read the specification."
|
|
99 |
|
|
100 |
"
|
|
101 |
UIPainter new openOnClass:MCSettingsApp andSelector:#windowSpec
|
|
102 |
MCSettingsApp new openInterface:#windowSpec
|
|
103 |
MCSettingsApp open
|
|
104 |
"
|
|
105 |
|
|
106 |
<resource: #canvas>
|
|
107 |
|
|
108 |
^
|
|
109 |
#(FullSpec
|
|
110 |
name: windowSpec
|
|
111 |
window:
|
|
112 |
(WindowSpec
|
|
113 |
label: 'Monticello Settings'
|
|
114 |
name: 'Monticello Settings'
|
|
115 |
min: (Point 10 10)
|
|
116 |
bounds: (Rectangle 0 0 695 627)
|
|
117 |
)
|
|
118 |
component:
|
|
119 |
(SpecCollection
|
|
120 |
collection: (
|
|
121 |
(LabelSpec
|
|
122 |
label: ' Monticello Settings'
|
|
123 |
name: 'Title'
|
|
124 |
layout: (LayoutFrame 0 0 0 0 0 1 66 0)
|
|
125 |
style: (FontDescription helvetica medium roman 18 #'iso10646-1')
|
|
126 |
backgroundColor: (Color 100.0 100.0 100.0)
|
|
127 |
translateLabel: true
|
|
128 |
adjust: left
|
|
129 |
)
|
|
130 |
(LabelSpec
|
|
131 |
label: 'Icon'
|
|
132 |
name: 'Icon'
|
|
133 |
layout: (LayoutFrame -75 1 0 0 0 1 66 0)
|
|
134 |
initiallyInvisible: true
|
|
135 |
hasCharacterOrientedLabel: false
|
|
136 |
backgroundColor: (Color 100.0 100.0 100.0)
|
|
137 |
translateLabel: true
|
|
138 |
)
|
|
139 |
(VerticalPanelViewSpec
|
|
140 |
name: 'Controls'
|
|
141 |
layout: (LayoutFrame 0 0 70 0 0 1 0 1)
|
|
142 |
horizontalLayout: fit
|
|
143 |
verticalLayout: topFit
|
|
144 |
horizontalSpace: 3
|
|
145 |
verticalSpace: 3
|
|
146 |
component:
|
|
147 |
(SpecCollection
|
|
148 |
collection: (
|
|
149 |
(HorizontalPanelViewSpec
|
|
150 |
name: 'EnabledAndResetPanel'
|
|
151 |
horizontalLayout: rightSpaceFit
|
|
152 |
verticalLayout: fit
|
|
153 |
horizontalSpace: 0
|
|
154 |
verticalSpace: 3
|
|
155 |
component:
|
|
156 |
(SpecCollection
|
|
157 |
collection: (
|
|
158 |
(CheckBoxSpec
|
|
159 |
label: 'Enable Monticello Manager'
|
|
160 |
name: 'Enabled'
|
|
161 |
model: mcEnabled
|
|
162 |
translateLabel: true
|
|
163 |
useDefaultExtent: true
|
|
164 |
)
|
|
165 |
(ActionButtonSpec
|
|
166 |
label: 'Flush caches'
|
|
167 |
name: 'ResetCachedRepositoriesButton'
|
|
168 |
translateLabel: true
|
|
169 |
model: flushCaches
|
|
170 |
enableChannel: mcEnabled
|
|
171 |
useDefaultExtent: true
|
|
172 |
)
|
|
173 |
)
|
|
174 |
|
|
175 |
)
|
|
176 |
useDefaultExtent: true
|
|
177 |
)
|
|
178 |
(FramedBoxSpec
|
|
179 |
label: 'Repositories'
|
|
180 |
name: 'Repositories'
|
|
181 |
labelPosition: topLeft
|
|
182 |
translateLabel: true
|
|
183 |
component:
|
|
184 |
(SpecCollection
|
|
185 |
collection: (
|
|
186 |
(VerticalPanelViewSpec
|
|
187 |
name: 'RepositoryConfigurations'
|
|
188 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
189 |
horizontalLayout: fit
|
|
190 |
verticalLayout: bottomFit
|
|
191 |
horizontalSpace: 3
|
|
192 |
verticalSpace: 3
|
|
193 |
component:
|
|
194 |
(SpecCollection
|
|
195 |
collection: (
|
|
196 |
(ViewSpec
|
|
197 |
name: 'RepositoryConfigurationListBox'
|
|
198 |
model: mcRepositories
|
|
199 |
component:
|
|
200 |
(SpecCollection
|
|
201 |
collection: (
|
|
202 |
(SelectionInListModelViewSpec
|
|
203 |
name: 'RepositoryList'
|
|
204 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
205 |
enableChannel: mcEnabled
|
|
206 |
hasHorizontalScrollBar: true
|
|
207 |
hasVerticalScrollBar: true
|
|
208 |
listModel: mcRepositories
|
|
209 |
useIndex: false
|
|
210 |
highlightMode: line
|
|
211 |
)
|
|
212 |
)
|
|
213 |
|
|
214 |
)
|
|
215 |
extent: (Point 659 457)
|
|
216 |
)
|
|
217 |
(HorizontalPanelViewSpec
|
|
218 |
name: 'AddRemovePanel'
|
|
219 |
horizontalLayout: fit
|
|
220 |
verticalLayout: center
|
|
221 |
horizontalSpace: 3
|
|
222 |
verticalSpace: 3
|
|
223 |
component:
|
|
224 |
(SpecCollection
|
|
225 |
collection: (
|
|
226 |
(ActionButtonSpec
|
|
227 |
label: 'Add repository'
|
|
228 |
name: 'AddConfigurationAction'
|
|
229 |
translateLabel: true
|
|
230 |
model: addRepositoryAction
|
|
231 |
enableChannel: mcEnabled
|
|
232 |
extent: (Point 328 25)
|
|
233 |
)
|
|
234 |
(ActionButtonSpec
|
|
235 |
label: 'Remove repository'
|
|
236 |
name: 'RemoveConfigurationAction'
|
|
237 |
translateLabel: true
|
|
238 |
model: removeRepositoryAction
|
|
239 |
enableChannel: mcEnabled
|
|
240 |
extent: (Point 328 25)
|
|
241 |
)
|
|
242 |
)
|
|
243 |
|
|
244 |
)
|
|
245 |
extent: (Point 659 30)
|
|
246 |
)
|
|
247 |
)
|
|
248 |
|
|
249 |
)
|
|
250 |
)
|
|
251 |
)
|
|
252 |
|
|
253 |
)
|
|
254 |
extent: (Point 695 525)
|
|
255 |
)
|
|
256 |
)
|
|
257 |
|
|
258 |
)
|
|
259 |
)
|
|
260 |
)
|
|
261 |
|
|
262 |
)
|
|
263 |
)
|
|
264 |
! !
|
|
265 |
|
|
266 |
!MCSettingsApp methodsFor:'accessing'!
|
|
267 |
|
|
268 |
repositoryConfiguration
|
|
269 |
|
|
270 |
^self repositoryConfigurationAspect value
|
|
271 |
|
|
272 |
"Created: / 26-05-2008 / 12:04:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
273 |
!
|
|
274 |
|
|
275 |
repositoryConfiguration: anObject
|
|
276 |
|
|
277 |
self repositoryConfigurationAspect value: anObject
|
|
278 |
|
|
279 |
"Created: / 26-05-2008 / 12:12:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
280 |
!
|
|
281 |
|
|
282 |
repositoryConfigurationList
|
|
283 |
|
|
284 |
^self repositoryConfigurationListAspect value
|
|
285 |
|
|
286 |
"Created: / 26-05-2008 / 12:05:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
287 |
!
|
|
288 |
|
|
289 |
repositoryManager
|
|
290 |
|
|
291 |
^RepositoryManager current
|
|
292 |
|
|
293 |
"Created: / 26-05-2008 / 10:46:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
294 |
!
|
|
295 |
|
|
296 |
workingCopyBase
|
|
297 |
|
|
298 |
^self workingCopyBaseAspect value
|
|
299 |
|
|
300 |
"Created: / 26-05-2008 / 13:15:22 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
301 |
! !
|
|
302 |
|
|
303 |
!MCSettingsApp methodsFor:'actions'!
|
|
304 |
|
|
305 |
addRepositoryAction
|
|
306 |
|
|
307 |
| dialog class codeHolder repo |
|
|
308 |
class := Dialog
|
|
309 |
choose:'Select repository type'
|
|
310 |
fromList:#('HTTP repository' 'Local repository')
|
|
311 |
values:(Array with: MCHttpRepository with: MCDirectoryRepository)
|
|
312 |
lines:5 cancel:[^self].
|
|
313 |
|
|
314 |
codeHolder := ValueHolder new.
|
|
315 |
dialog := Dialog forRequestText:'Fill in data' lines:10 columns:40 initialAnswer: class creationTemplate model:codeHolder.
|
|
316 |
dialog open.
|
|
317 |
dialog accepted ifFalse:[^self].
|
|
318 |
repo := Compiler evaluate: codeHolder value.
|
|
319 |
self mcRepositories value add: repo.
|
|
320 |
self mcRepositories changed.
|
|
321 |
|
|
322 |
"Created: / 26-05-2008 / 12:04:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
323 |
"Modified: / 16-08-2009 / 17:24:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
324 |
"Modified: / 16-09-2010 / 14:33:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
325 |
!
|
|
326 |
|
|
327 |
flushCaches
|
|
328 |
<resource: #uiCallback>
|
|
329 |
|
|
330 |
"automatically generated by UIPainter..."
|
|
331 |
|
|
332 |
"*** the code below performs no action"
|
|
333 |
"*** (except for some feedback on the Transcript)"
|
|
334 |
"*** Please change as required and accept in the browser."
|
|
335 |
"*** (and replace this comment by something more useful ;-)"
|
|
336 |
|
|
337 |
"action to be defined here..."
|
|
338 |
|
|
339 |
Transcript showCR:self class name, ': action for flushCaches ...'.
|
|
340 |
!
|
|
341 |
|
|
342 |
removeRepositoryAction
|
|
343 |
self repositoryConfiguration ifNotNil:
|
|
344 |
[ self repositoryConfigurationList remove: self repositoryConfiguration ].
|
|
345 |
|
|
346 |
"Created: / 26-05-2008 / 12:04:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
347 |
! !
|
|
348 |
|
|
349 |
!MCSettingsApp methodsFor:'aspects'!
|
|
350 |
|
|
351 |
mcEnabled
|
|
352 |
|
|
353 |
^self settingsAspectFor: #mcEnabled
|
|
354 |
|
|
355 |
"Created: / 16-09-2010 / 14:14:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
356 |
!
|
|
357 |
|
|
358 |
mcRepositories
|
|
359 |
|
|
360 |
^self settingsAspectFor: #mcRepositories
|
|
361 |
|
|
362 |
"Created: / 16-09-2010 / 14:14:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
363 |
! !
|
|
364 |
|
|
365 |
!MCSettingsApp methodsFor:'helpers'!
|
|
366 |
|
|
367 |
settingsAspectFor: settingName
|
|
368 |
|
|
369 |
|holder|
|
|
370 |
|
|
371 |
self createBuilder.
|
|
372 |
|
|
373 |
(holder := builder bindingAt:settingName) ifNil:
|
|
374 |
[holder := (currentUserPrefs perform: settingName asSymbol)
|
|
375 |
asValue.
|
|
376 |
holder onChangeSend:#updateModifiedChannel to:self.
|
|
377 |
builder aspectAt:settingName put:holder
|
|
378 |
].
|
|
379 |
^ holder.
|
|
380 |
|
|
381 |
"Created: / 25-05-2009 / 18:43:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
382 |
! !
|
|
383 |
|
|
384 |
!MCSettingsApp methodsFor:'protocol'!
|
|
385 |
|
|
386 |
basicReadSettings
|
|
387 |
|
|
388 |
self
|
|
389 |
readAspects: #(mcEnabled mcRepositories)
|
|
390 |
from:currentUserPrefs.
|
|
391 |
|
|
392 |
"Modified: / 16-09-2010 / 14:14:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
393 |
!
|
|
394 |
|
|
395 |
basicSaveSettings
|
|
396 |
|
|
397 |
self
|
|
398 |
writeAspects: #(mcEnabled mcRepositories)
|
|
399 |
to:currentUserPrefs.
|
|
400 |
|
|
401 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
402 |
"Modified: / 25-05-2009 / 19:06:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
403 |
"Modified: / 16-09-2010 / 14:35:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
404 |
!
|
|
405 |
|
|
406 |
helpFilename
|
|
407 |
"subclasses must return the relative name of a helpFile
|
|
408 |
in the doc/online/<language>/help directory.
|
|
409 |
Or nil, if no help is available."
|
|
410 |
|
|
411 |
^nil
|
|
412 |
|
|
413 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
414 |
"Modified: / 26-05-2008 / 13:12:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
415 |
! !
|
|
416 |
|
|
417 |
!MCSettingsApp methodsFor:'queries'!
|
|
418 |
|
|
419 |
hasUnsavedChanges
|
|
420 |
|
|
421 |
(self
|
|
422 |
hasChangedAspectIn: #(mcEnabled mcRepositories)
|
|
423 |
asComparedTo:currentUserPrefs)
|
|
424 |
ifTrue:[^ true].
|
|
425 |
^false
|
|
426 |
|
|
427 |
"Created: / 28-05-2008 / 07:33:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
428 |
"Modified: / 19-08-2009 / 12:07:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
429 |
"Modified: / 16-09-2010 / 14:17:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
430 |
! !
|
|
431 |
|
|
432 |
!MCSettingsApp class methodsFor:'documentation'!
|
|
433 |
|
|
434 |
version
|
|
435 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSettingsApp.st,v 1.1 2011-08-20 12:26:34 cg Exp $'
|
|
436 |
!
|
|
437 |
|
|
438 |
version_CVS
|
|
439 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSettingsApp.st,v 1.1 2011-08-20 12:26:34 cg Exp $'
|
|
440 |
!
|
|
441 |
|
|
442 |
version_SVN
|
|
443 |
^ '§Id: MCSettingsApp.st 33 2011-07-21 11:26:12Z vranyj1 §'
|
|
444 |
! !
|