author | Claus Gittinger <cg@exept.de> |
Mon, 14 May 2018 02:21:18 +0200 | |
changeset 1048 | 582b3a028cbc |
parent 1018 | 273b4c403604 |
permissions | -rw-r--r-- |
320 | 1 |
"{ Package: 'stx:goodies/monticello' }" |
2 |
||
3 |
AbstractSettingsApplication subclass:#MCSettingsApp |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
4 |
instanceVariableNames:'mcRepositories selectedRepositoryHolder' |
553 | 5 |
classVariableNames:'' |
6 |
poolDictionaries:'' |
|
588 | 7 |
category:'SCM-Monticello-St/X UI' |
320 | 8 |
! |
9 |
||
10 |
||
11 |
!MCSettingsApp class methodsFor:'help specs'! |
|
12 |
||
13 |
helpSpec |
|
14 |
"This resource specification was automatically generated |
|
15 |
by the UIHelpTool of ST/X." |
|
16 |
||
17 |
"Do not manually edit this!! If it is corrupted, |
|
18 |
the UIHelpTool may not be able to read the specification." |
|
19 |
||
20 |
" |
|
1018 | 21 |
UIHelpTool openOnClass:MCSettingsApp |
320 | 22 |
" |
23 |
||
24 |
<resource: #help> |
|
25 |
||
26 |
^ super helpSpec addPairsFrom:#( |
|
27 |
||
524 | 28 |
#addRepository |
29 |
'Add another monticello repository to the list' |
|
30 |
||
31 |
#makePrimaryRepository |
|
32 |
'Checkin from the browser will go into this repository by default' |
|
33 |
||
538 | 34 |
#primaryRepository |
35 |
'Checkin from the browser will go into this repository by default' |
|
36 |
||
524 | 37 |
#removeRepository |
38 |
'Remove the selected repository from the list' |
|
320 | 39 |
|
40 |
) |
|
41 |
||
538 | 42 |
"Modified: / 03-12-2011 / 11:35:51 / cg" |
320 | 43 |
! ! |
44 |
||
45 |
!MCSettingsApp class methodsFor:'image specs'! |
|
46 |
||
47 |
defaultIcon |
|
553 | 48 |
"/ ^ self repositoryIcon. |
49 |
^ self squeakRepositoryIcon24x24 |
|
50 |
||
51 |
"Created: / 26-05-2008 / 14:55:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
52 |
"Modified: / 16-09-2010 / 14:02:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
53 |
"Modified: / 15-01-2012 / 10:34:53 / cg" |
|
54 |
! |
|
55 |
||
56 |
repositoryIcon |
|
518 | 57 |
"This resource specification was automatically generated |
58 |
by the ImageEditor of ST/X." |
|
320 | 59 |
|
518 | 60 |
"Do not manually edit this!! If it is corrupted, |
61 |
the ImageEditor may not be able to read the specification." |
|
62 |
||
63 |
" |
|
64 |
self defaultIcon inspect |
|
65 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
66 |
Icon flushCachedIcons |
|
67 |
" |
|
68 |
||
69 |
<resource: #image> |
|
70 |
||
71 |
^Icon |
|
1018 | 72 |
constantNamed:#'MCSettingsApp class repositoryIcon' |
73 |
ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
518 | 74 |
@@@@@@@@@@@A@PHB@0P@@@@@@@@@@@@@@@@@@@HEA \HA $JB0HD@@@@@@@@@@@@@@HLA04NC0HD@@L@@ P@@@@@@@@@@@@ED@ NDP@@@@@@@@@D@@@@@@@@ |
75 |
@@@BA \FAPP@@@@@@@@@@@P@@@@@@@@@AQ@RC0@@@@@@@@@@@@@@@@@@@@@@@@TGA!!DD@@@@@@@@@@@@@@@@@@@D@PDIA08OA@@@@@@@@@@@@@@@@@@@AP S |
|
76 |
A0XIBPXGC0P@@@@@@@@@@@@@@@@ECAPLBPXOAP@@@@@@EQX@@@@@@@@@@@TIE@XOAP@@@@@@EQ\XE @@@@@@@@@@AP$OAP@@@@@@FQ\ZE!! V@@@@@@@@@@@E |
|
77 |
F0@@@@@@EQ\ZF!!(VFAX@@@@@@@@@@@@@@@@ZEQ\VE!!(ZF!!XWF @@@@@@@@@@@@@@@@@@@A\ZE!!(@@@@@@@@@@@@@@@@@@@@@@@@XE!!XZ@@@@@@@@@@@@@@@@ |
|
78 |
@@@@@@@@EQ(V@@@@@@@@@@@@@@@@@@@@@@@@EQ\VE @@@@@@@@@@@@@@@@@@@@@@EQ VE @@@@@@@@@@@@@@F @@@@@WEQ VE!!(@@@@@@@@@@@@@@@@@E!!\W |
|
79 |
EQXVE @@@@@@@@@@@@@@@@@@@@@@@A(Z@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 32 64 0 0 64 0 32 32 0 0 32 0 32 96 32 96 192 128 192 224 192 160 224 160 32 128 64 64 96 64 64 96 32 32 160 64 160 224 192 64 160 96 32 128 32 224 224 224 64 128 64 160 192 160 224 224 192 32 160 96 160 160 160 64 64 64 96 96 96 128 128 128 192 192 192 32 32 32 32 64 32]; mask:((ImageMask new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@O8@@?>@A??@A?C C<@0C8@PC8@@??@@??F@_>O@O<_ G8?0C1?8A#?<@C?<@@_@H@_@L@?@GC>@C?>@A?<@@_0@') ; yourself); yourself] |
|
320 | 80 |
|
81 |
"Created: / 26-05-2008 / 14:55:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
82 |
"Modified: / 16-09-2010 / 14:02:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
518 | 83 |
"Modified: / 25-11-2011 / 15:46:41 / cg" |
553 | 84 |
"Created: / 15-01-2012 / 10:34:23 / cg" |
85 |
! |
|
86 |
||
87 |
squeakIcon |
|
88 |
"This resource specification was automatically generated |
|
89 |
by the ImageEditor of ST/X." |
|
90 |
||
91 |
"Do not manually edit this!! If it is corrupted, |
|
92 |
the ImageEditor may not be able to read the specification." |
|
93 |
||
94 |
" |
|
95 |
self squeakIcon inspect |
|
96 |
ImageEditor openOnClass:self andSelector:#squeakIcon |
|
97 |
Icon flushCachedIcons |
|
98 |
" |
|
99 |
||
100 |
<resource: #image> |
|
101 |
||
102 |
^Icon |
|
1018 | 103 |
constantNamed:'SVN::ConfigurationApp class squeakIcon' |
104 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 18; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
553 | 105 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@DB@0@@@@@@@@@@@@@@A@TF@@@@@@@@@@\@@ D@@@@@@@@@@@@C |
106 |
@ @F@@@@@@@@@@ @@@H@@@@@@@@@@@@B@@@F@@@@@@@@@@$@@@@J@@@@@@@@@@H@@@@F@@@@@@@@@@,@@@@@@@@@@@@@@@@@@@@K@@@@@@@@@@0@@@@@@@@@ |
|
107 |
@@@@@@@@@@@K@@@@@@@@@@DM@@@@@04@@@@@CP@@@@,A@@@@@@@@@@@N@@@@C0<M@@@OC04@@@,@@@@@@@@@@@@K@@@@C1@Q@@@ODAD@@AH@@@@@@@@@@@@@ |
|
108 |
@@@@DQLM@@@QC04@@@@@@@@@@@@@B@@@@@ @@@@@@P@@@@@@B@@@@@@@@@@KB0@@@@@F@@@QC0<Q@@@@@@@@@@@@@@@@@@@KB0,@@@@QC0<Q@@@@B0,KB0@@ |
|
109 |
@@@@@@@@@@@K@@@@@0@@@@@KB0@@@@,@@@@@@@@@B0@@@@@@@@@@@@@@@@,K@@@K@@@@@@X@@@@@@@@@@@@@@@@@@@@@B0@@') ; colorMapFromArray:#[164 164 164 232 232 232 102 102 102 233 233 233 236 236 236 143 143 143 161 161 161 110 110 110 190 190 190 163 163 163 97 97 97 169 169 169 124 124 124 185 185 185 155 155 155 0 0 0 255 255 255 139 139 139 118 118 118 4 4 4]; mask:((Depth1Image new) width: 24; height: 18; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@C @8B0A(BPAHBHBHB@@HB@@HCFDXAGNPAGNP@GN@G0 <LI9CC18<DX!!"I @YB@@D') ; yourself); yourself] |
|
110 |
! |
|
111 |
||
112 |
squeakRepositoryIcon24x24 |
|
113 |
"This resource specification was automatically generated |
|
114 |
by the ImageEditor of ST/X." |
|
115 |
||
116 |
"Do not manually edit this!! If it is corrupted, |
|
117 |
the ImageEditor may not be able to read the specification." |
|
118 |
||
119 |
" |
|
120 |
self squeakRepositoryIcon24x24 inspect |
|
121 |
ImageEditor openOnClass:self andSelector:#squeakRepositoryIcon24x24 |
|
122 |
Icon flushCachedIcons |
|
123 |
" |
|
124 |
||
125 |
<resource: #image> |
|
126 |
||
127 |
^Icon |
|
1018 | 128 |
constantNamed:'SVN::ConfigurationApp class squeakRepositoryIcon24x24' |
129 |
ifAbsentPut:[(Depth8Image new) width: 24; height: 24; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
553 | 130 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@DB@0@@@@@@@@@@@@@@A@TF@@@@@@@@@@\@@ D@@@@@@@@@@@@C |
131 |
@ @F@@@@@@@@@@ @@@H@@@@@@@@@@@@B@@@F@@@@@@@@@@$@@@@J@@@@@@@@@@H@@@@F@@@@@@@@@@,@@@@@@@@@@@@@@@@@@@@K@@@@@@@@@@0@@@@@@@@@ |
|
132 |
@@@@@@@@@@@K@@@@@@@@@@DM@@@@@04@@@@@CP@@@@,A@@@@@@@@@@@N@@@@C0<M@@@OC04@@@,@@@@@@@@@@@@K@@@@C1@Q@@@ODAD@@AH@@@@@@@@@@@@@ |
|
133 |
@@@@DQLM@@@QC04@@@@@@@@@@@@@B@@ZF!!\W@@@@@P@@@@@@B@@@@@@@@@@KB1\ZF!!(ZE0@QC0<Q@@@@@@@@@@@@@@@@E!!(ZB0,@@A\QC0<Q@@@@B0,KB0@@ |
|
134 |
@@@@E1 W@@@K@@@@@0@@@@@KB0@@@@,@@A\WF!!$ZF0@@G@@@@@@@@@@@@@,K@@@K@@@WFQ(W@@@\GA0@@@@@@@@@@@@@B0@@@@@@E2@@@A0_G18\@@@@@@@@ |
|
135 |
@@@@@@@@@@@@@@@@GA0]GA0\@@@@@@@@@@@@@@@@@@@\@@@@@@@\G@@@@@@@@@@@@@@@@@@@@@@@GA0\GA0\C0@@@@@@@@@@@@@@@@@@@@@@@A4\GA0O@@@@ |
|
136 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[164 164 164 232 232 232 102 102 102 233 233 233 236 236 236 143 143 143 161 161 161 110 110 110 190 190 190 163 163 163 97 97 97 169 169 169 124 124 124 185 185 185 155 155 155 0 0 0 255 255 255 139 139 139 118 118 118 4 4 4 229 229 229 214 214 214 0 64 0 32 96 32 96 192 128 32 128 64 32 160 64 32 128 32 64 64 64 96 96 96 128 128 128 32 32 32 32 64 32]; mask:((Depth1Image new) width: 24; height: 24; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@C @8B0A(BPAHBHBHB@@HB@@HCFDXAGNPAGNP@GN@G8 <O=9CG38<GX!!"_$@YON@DF_@@@?@@HL@@G<@@C8@@@@@@') ; yourself); yourself] |
|
320 | 137 |
! |
138 |
||
139 |
svnIcon |
|
140 |
"^ IconLibrary svn_wizban" |
|
141 |
^nil |
|
142 |
||
143 |
"Created: / 24-05-2008 / 01:44:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
144 |
"Modified: / 16-09-2010 / 14:02:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
145 |
! ! |
|
146 |
||
147 |
!MCSettingsApp class methodsFor:'interface opening'! |
|
148 |
||
1018 | 149 |
open |
320 | 150 |
|
151 |
| settingsApp | |
|
152 |
||
153 |
settingsApp := SettingsDialog new. |
|
154 |
settingsApp addApplClass:self fullName |
|
1018 | 155 |
withName:'Monticello'. |
320 | 156 |
settingsApp showRoot: false. |
157 |
settingsApp selectedItem value: |
|
1018 | 158 |
(settingsApp applicationList root children anyOne). |
320 | 159 |
settingsApp open. |
160 |
||
161 |
"Created: / 26-05-2008 / 12:17:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
162 |
"Modified: / 04-04-2012 / 11:17:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
320 | 163 |
! ! |
164 |
||
165 |
!MCSettingsApp class methodsFor:'interface specs'! |
|
166 |
||
167 |
windowSpec |
|
168 |
"This resource specification was automatically generated |
|
169 |
by the UIPainter of ST/X." |
|
170 |
||
171 |
"Do not manually edit this!! If it is corrupted, |
|
172 |
the UIPainter may not be able to read the specification." |
|
173 |
||
174 |
" |
|
175 |
UIPainter new openOnClass:MCSettingsApp andSelector:#windowSpec |
|
176 |
MCSettingsApp new openInterface:#windowSpec |
|
177 |
MCSettingsApp open |
|
178 |
" |
|
179 |
||
180 |
<resource: #canvas> |
|
181 |
||
1018 | 182 |
^ |
320 | 183 |
#(FullSpec |
1018 | 184 |
name: windowSpec |
185 |
window: |
|
320 | 186 |
(WindowSpec |
1018 | 187 |
label: 'Monticello Settings' |
188 |
name: 'Monticello Settings' |
|
189 |
min: (Point 10 10) |
|
190 |
bounds: (Rectangle 0 0 647 627) |
|
191 |
) |
|
192 |
component: |
|
320 | 193 |
(SpecCollection |
1018 | 194 |
collection: ( |
195 |
(LabelSpec |
|
196 |
label: ' Monticello Settings' |
|
197 |
name: 'Title' |
|
198 |
layout: (LayoutFrame 0 0 0 0 0 1 66 0) |
|
199 |
style: (FontDescription helvetica medium roman 18 #'iso10646-1') |
|
200 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
201 |
translateLabel: true |
|
202 |
adjust: left |
|
203 |
) |
|
204 |
(LabelSpec |
|
205 |
label: 'Icon' |
|
206 |
name: 'Icon' |
|
207 |
layout: (LayoutFrame -75 1 0 0 0 1 66 0) |
|
208 |
initiallyInvisible: true |
|
209 |
hasCharacterOrientedLabel: false |
|
210 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
211 |
translateLabel: true |
|
212 |
) |
|
213 |
(VerticalPanelViewSpec |
|
214 |
name: 'Controls' |
|
215 |
layout: (LayoutFrame 0 0 70 0 0 1 0 1) |
|
216 |
horizontalLayout: fit |
|
217 |
verticalLayout: topFit |
|
218 |
horizontalSpace: 3 |
|
219 |
verticalSpace: 3 |
|
220 |
component: |
|
221 |
(SpecCollection |
|
222 |
collection: ( |
|
223 |
(HorizontalPanelViewSpec |
|
224 |
name: 'EnabledAndResetPanel' |
|
225 |
horizontalLayout: rightSpaceFit |
|
226 |
verticalLayout: fit |
|
227 |
horizontalSpace: 0 |
|
228 |
verticalSpace: 3 |
|
229 |
component: |
|
230 |
(SpecCollection |
|
231 |
collection: ( |
|
232 |
(CheckBoxSpec |
|
233 |
label: 'Show in Browser Menus' |
|
234 |
name: 'Enabled' |
|
235 |
model: mcEnabled |
|
236 |
translateLabel: true |
|
237 |
useDefaultExtent: true |
|
238 |
) |
|
239 |
(ActionButtonSpec |
|
240 |
label: 'Flush caches' |
|
241 |
name: 'ResetCachedRepositoriesButton' |
|
242 |
translateLabel: true |
|
243 |
model: flushCaches |
|
244 |
enableChannel: mcEnabled |
|
245 |
useDefaultExtent: true |
|
246 |
) |
|
247 |
) |
|
248 |
||
249 |
) |
|
250 |
useDefaultExtent: true |
|
251 |
) |
|
252 |
(ViewSpec |
|
253 |
name: 'Box1' |
|
254 |
component: |
|
255 |
(SpecCollection |
|
256 |
collection: ( |
|
257 |
(LabelSpec |
|
258 |
label: 'Primary Repository: ' |
|
259 |
name: 'Label2' |
|
260 |
layout: (LayoutFrame 7 0 0 0 150 0 22 0) |
|
261 |
activeHelpKey: primaryRepository |
|
262 |
translateLabel: true |
|
263 |
adjust: left |
|
264 |
) |
|
265 |
(LabelSpec |
|
266 |
name: 'Label3' |
|
267 |
layout: (LayoutFrame 150 0 0 0 0 1 22 0) |
|
268 |
activeHelpKey: primaryRepository |
|
269 |
translateLabel: true |
|
270 |
labelChannel: mcPrimaryRepository |
|
271 |
adjust: left |
|
272 |
) |
|
273 |
) |
|
274 |
||
275 |
) |
|
276 |
extent: (Point 647 24) |
|
277 |
) |
|
278 |
(FramedBoxSpec |
|
279 |
label: 'Repositories' |
|
280 |
name: 'Repositories' |
|
281 |
labelPosition: topLeft |
|
282 |
translateLabel: true |
|
283 |
component: |
|
284 |
(SpecCollection |
|
285 |
collection: ( |
|
286 |
(VerticalPanelViewSpec |
|
287 |
name: 'RepositoryConfigurations' |
|
288 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
289 |
horizontalLayout: fit |
|
290 |
verticalLayout: bottomFit |
|
291 |
horizontalSpace: 3 |
|
292 |
verticalSpace: 3 |
|
293 |
component: |
|
294 |
(SpecCollection |
|
295 |
collection: ( |
|
296 |
(ViewSpec |
|
297 |
name: 'RepositoryConfigurationListBox' |
|
298 |
model: mcRepositories |
|
299 |
component: |
|
300 |
(SpecCollection |
|
301 |
collection: ( |
|
302 |
(SelectionInListModelViewSpec |
|
303 |
name: 'RepositoryList' |
|
304 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
305 |
enableChannel: mcEnabled |
|
306 |
model: selectedRepositoryHolder |
|
307 |
hasHorizontalScrollBar: true |
|
308 |
hasVerticalScrollBar: true |
|
309 |
listModel: mcRepositories |
|
310 |
useIndex: false |
|
311 |
highlightMode: line |
|
312 |
) |
|
313 |
) |
|
314 |
||
315 |
) |
|
316 |
extent: (Point 613 437) |
|
317 |
) |
|
318 |
(HorizontalPanelViewSpec |
|
319 |
name: 'AddRemovePanel' |
|
320 |
horizontalLayout: fit |
|
321 |
verticalLayout: center |
|
322 |
horizontalSpace: 3 |
|
323 |
verticalSpace: 3 |
|
324 |
component: |
|
325 |
(SpecCollection |
|
326 |
collection: ( |
|
327 |
(ActionButtonSpec |
|
328 |
label: 'Add Repository...' |
|
329 |
name: 'AddConfigurationAction' |
|
330 |
activeHelpKey: addRepository |
|
331 |
translateLabel: true |
|
332 |
model: addRepositoryAction |
|
333 |
enableChannel: mcEnabled |
|
334 |
extent: (Point 151 25) |
|
335 |
) |
|
336 |
(ActionButtonSpec |
|
337 |
label: 'Remove Repository...' |
|
338 |
name: 'RemoveConfigurationAction' |
|
339 |
activeHelpKey: removeRepository |
|
340 |
translateLabel: true |
|
341 |
model: removeRepositoryAction |
|
342 |
enableChannel: mcEnabledAndRepositorySelectedHolder |
|
343 |
extent: (Point 151 25) |
|
344 |
) |
|
345 |
(LabelSpec |
|
346 |
name: 'Label1' |
|
347 |
translateLabel: true |
|
348 |
extent: (Point 151 22) |
|
349 |
) |
|
350 |
(ActionButtonSpec |
|
351 |
label: 'Define as Primary' |
|
352 |
name: 'Button1' |
|
353 |
activeHelpKey: makePrimaryRepository |
|
354 |
translateLabel: true |
|
355 |
model: defineAsPrimaryRepositoryAction |
|
356 |
enableChannel: mcEnabledAndRepositorySelectedHolder |
|
357 |
extent: (Point 151 25) |
|
358 |
) |
|
359 |
) |
|
360 |
||
361 |
) |
|
362 |
extent: (Point 613 30) |
|
363 |
) |
|
364 |
) |
|
365 |
||
366 |
) |
|
367 |
) |
|
368 |
) |
|
369 |
||
370 |
) |
|
371 |
extent: (Point 647 503) |
|
372 |
) |
|
373 |
) |
|
374 |
||
375 |
) |
|
376 |
) |
|
377 |
) |
|
378 |
||
379 |
) |
|
320 | 380 |
) |
381 |
! ! |
|
382 |
||
524 | 383 |
!MCSettingsApp class methodsFor:'queries'! |
384 |
||
385 |
managerTypeName |
|
386 |
||
387 |
^ 'Monticello' |
|
388 |
||
389 |
"Created: / 21-07-2011 / 11:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
390 |
! ! |
|
391 |
||
320 | 392 |
!MCSettingsApp methodsFor:'accessing'! |
393 |
||
394 |
repositoryConfiguration |
|
395 |
||
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
396 |
^self selectedRepositoryHolder value |
320 | 397 |
|
398 |
"Created: / 26-05-2008 / 12:04:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
399 |
"Modified: / 27-09-2011 / 11:55:22 / cg" |
320 | 400 |
! |
401 |
||
402 |
repositoryConfiguration: anObject |
|
403 |
||
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
404 |
self selectedRepositoryHolder value: anObject |
320 | 405 |
|
406 |
"Created: / 26-05-2008 / 12:12:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
407 |
"Modified: / 27-09-2011 / 11:55:24 / cg" |
320 | 408 |
! |
409 |
||
410 |
repositoryConfigurationList |
|
411 |
||
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
412 |
^self mcRepositories value |
320 | 413 |
|
414 |
"Created: / 26-05-2008 / 12:05:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
415 |
"Modified: / 27-09-2011 / 11:50:53 / cg" |
320 | 416 |
! |
417 |
||
418 |
repositoryManager |
|
419 |
||
420 |
^RepositoryManager current |
|
421 |
||
422 |
"Created: / 26-05-2008 / 10:46:30 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
423 |
! |
|
424 |
||
425 |
workingCopyBase |
|
426 |
||
427 |
^self workingCopyBaseAspect value |
|
428 |
||
429 |
"Created: / 26-05-2008 / 13:15:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
430 |
! ! |
|
431 |
||
432 |
!MCSettingsApp methodsFor:'actions'! |
|
433 |
||
434 |
addRepositoryAction |
|
782 | 435 |
| dialog class codeHolder repo lastInput asking | |
320 | 436 |
|
1018 | 437 |
class := Dialog |
438 |
choose:'Select repository type' |
|
439 |
fromList:#('HTTP Repository' 'FTP Repository' 'Local Repository') |
|
440 |
values:(Array |
|
441 |
with: MCHttpRepository |
|
442 |
with: MCFtpRepository |
|
443 |
with: MCDirectoryRepository) |
|
444 |
lines:5 cancel:[^self]. |
|
320 | 445 |
|
446 |
codeHolder := ValueHolder new. |
|
782 | 447 |
|
448 |
asking := true. |
|
449 |
[asking] whileTrue:[ |
|
1018 | 450 |
class == MCDirectoryRepository ifTrue:[ |
451 |
|dir| |
|
452 |
dir := Dialog requestDirectoryName:'MC Repository Directory'. |
|
453 |
dir isEmptyOrNil ifTrue:[^ self]. |
|
454 |
repo := MCDirectoryRepository directory:dir. |
|
455 |
] ifFalse:[ |
|
456 |
dialog := Dialog |
|
457 |
forRequestText:'Please Fill in Data:' |
|
458 |
lines:10 columns:60 |
|
459 |
initialAnswer: (lastInput ? class creationTemplate) |
|
460 |
model:codeHolder. |
|
461 |
dialog open. |
|
462 |
dialog accepted ifFalse:[^self]. |
|
463 |
lastInput := codeHolder value. |
|
464 |
repo := Compiler evaluate: codeHolder value. |
|
465 |
]. |
|
782 | 466 |
|
1018 | 467 |
repo isValid ifTrue:[ |
468 |
asking := false |
|
469 |
] ifFalse:[ |
|
470 |
|answer| |
|
782 | 471 |
|
1018 | 472 |
repo class == MCDirectoryRepository ifTrue:[ |
473 |
answer := Dialog confirmWithCancel:'Invalid repository. Create?'. |
|
474 |
answer == nil ifTrue:[ |
|
475 |
^ self |
|
476 |
]. |
|
477 |
answer == true ifTrue:[ |
|
478 |
repo directory asFilename recursiveMakeDirectory |
|
479 |
]. |
|
480 |
asking := false |
|
481 |
] ifFalse:[ |
|
482 |
answer := Dialog confirmWithCancel:'Invalid repository. Try again?'. |
|
483 |
answer == nil ifTrue:[ |
|
484 |
^ self |
|
485 |
]. |
|
486 |
answer == false ifTrue:[ |
|
487 |
asking := false |
|
488 |
]. |
|
489 |
] |
|
490 |
]. |
|
782 | 491 |
]. |
320 | 492 |
self mcRepositories value add: repo. |
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
493 |
self mcRepositories changed:#value. |
555 | 494 |
self updateModifiedChannel |
320 | 495 |
|
496 |
"Created: / 26-05-2008 / 12:04:30 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
497 |
"Modified: / 16-08-2009 / 17:24:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
524 | 498 |
"Modified (format): / 01-12-2011 / 20:31:10 / cg" |
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
499 |
"Modified: / 04-04-2012 / 11:14:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
524 | 500 |
! |
501 |
||
502 |
defineAsPrimaryRepositoryAction |
|
503 |
self mcPrimaryRepository value:(self selectedRepositoryHolder value) |
|
504 |
||
505 |
"Created: / 01-12-2011 / 20:33:16 / cg" |
|
320 | 506 |
! |
507 |
||
508 |
flushCaches |
|
509 |
<resource: #uiCallback> |
|
510 |
||
511 |
"automatically generated by UIPainter..." |
|
512 |
||
513 |
"*** the code below performs no action" |
|
514 |
"*** (except for some feedback on the Transcript)" |
|
515 |
"*** Please change as required and accept in the browser." |
|
516 |
"*** (and replace this comment by something more useful ;-)" |
|
517 |
||
518 |
"action to be defined here..." |
|
519 |
||
520 |
Transcript showCR:self class name, ': action for flushCaches ...'. |
|
521 |
! |
|
522 |
||
523 |
removeRepositoryAction |
|
1018 | 524 |
self repositoryConfiguration notNil ifTrue:[ |
525 |
self mcRepositories value remove: self repositoryConfiguration. |
|
526 |
self mcRepositories changed:#value. |
|
527 |
self updateModifiedChannel |
|
524 | 528 |
]. |
320 | 529 |
|
530 |
"Created: / 26-05-2008 / 12:04:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
524 | 531 |
"Modified: / 01-12-2011 / 20:50:08 / cg" |
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
532 |
"Modified: / 04-04-2012 / 11:15:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
320 | 533 |
! ! |
534 |
||
535 |
!MCSettingsApp methodsFor:'aspects'! |
|
536 |
||
537 |
mcEnabled |
|
524 | 538 |
^self settingsAspectFor: #mcEnabled default:false |
320 | 539 |
|
540 |
"Created: / 16-09-2010 / 14:14:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
524 | 541 |
"Modified: / 01-12-2011 / 20:08:10 / cg" |
542 |
! |
|
543 |
||
544 |
mcEnabledAndRepositorySelectedHolder |
|
545 |
^ BlockValue |
|
1018 | 546 |
with:[:v | self mcEnabled value and:[ v notNil ]] |
547 |
argument:(self selectedRepositoryHolder) |
|
524 | 548 |
|
549 |
"Created: / 01-12-2011 / 19:58:57 / cg" |
|
550 |
! |
|
551 |
||
552 |
mcPrimaryRepository |
|
553 |
||
554 |
^self settingsAspectFor: #mcPrimaryRepository default:nil |
|
555 |
||
556 |
"Created: / 16-09-2010 / 14:14:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
557 |
"Created: / 01-12-2011 / 20:06:36 / cg" |
|
320 | 558 |
! |
559 |
||
560 |
mcRepositories |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
561 |
"return/create the 'mcRepositories' value holder (automatically generated)" |
320 | 562 |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
563 |
mcRepositories isNil ifTrue:[ |
1018 | 564 |
mcRepositories := ValueHolder new. |
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
565 |
]. |
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
566 |
^ mcRepositories |
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
567 |
! |
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
568 |
|
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
569 |
selectedRepositoryHolder |
524 | 570 |
selectedRepositoryHolder isNil ifTrue:[ |
1018 | 571 |
selectedRepositoryHolder := nil asValue. |
524 | 572 |
]. |
573 |
^ selectedRepositoryHolder |
|
504
9cd65fe6164f
added: #selectedRepositoryHolder
Claus Gittinger <cg@exept.de>
parents:
461
diff
changeset
|
574 |
|
524 | 575 |
"Created: / 01-12-2011 / 20:19:36 / cg" |
320 | 576 |
! ! |
577 |
||
578 |
!MCSettingsApp methodsFor:'helpers'! |
|
579 |
||
524 | 580 |
settingsAspectFor:settingName default:default |
320 | 581 |
|holder| |
582 |
||
583 |
self createBuilder. |
|
584 |
||
524 | 585 |
(holder := builder bindingAt:settingName) isNil ifTrue:[ |
1018 | 586 |
holder := (currentUserPrefs at:settingName asSymbol ifAbsent:default) asValue. |
587 |
builder aspectAt:settingName put:holder. |
|
588 |
holder onChangeSend:#updateModifiedChannel to:self. |
|
320 | 589 |
]. |
590 |
^ holder. |
|
591 |
||
592 |
"Created: / 25-05-2009 / 18:43:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
524 | 593 |
"Created: / 01-12-2011 / 20:07:59 / cg" |
320 | 594 |
! ! |
595 |
||
596 |
!MCSettingsApp methodsFor:'protocol'! |
|
597 |
||
598 |
basicReadSettings |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
599 |
|
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
600 |
self mcRepositories value: MCRepositoryGroup default repositories copy. |
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
601 |
|
524 | 602 |
"/ special case, because default value of false is not ok here !! |
603 |
(currentUserPrefs includesKey:#mcPrimaryRepository) ifTrue:[ |
|
1018 | 604 |
self |
605 |
readAspects: #(mcPrimaryRepository) |
|
606 |
from:currentUserPrefs. |
|
524 | 607 |
]. |
320 | 608 |
|
609 |
self |
|
1018 | 610 |
readAspects: #(mcEnabled) |
611 |
from:currentUserPrefs. |
|
320 | 612 |
|
524 | 613 |
"Modified: / 01-12-2011 / 20:26:23 / cg" |
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
614 |
"Modified: / 04-04-2012 / 11:11:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
320 | 615 |
! |
616 |
||
617 |
basicSaveSettings |
|
618 |
||
619 |
self |
|
1018 | 620 |
writeAspects: #(mcEnabled mcPrimaryRepository) |
621 |
to:currentUserPrefs. |
|
320 | 622 |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
623 |
MCRepositoryGroup default repositories: self mcRepositories value copy |
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
624 |
|
320 | 625 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
626 |
"Modified: / 25-05-2009 / 19:06:45 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
524 | 627 |
"Modified: / 01-12-2011 / 20:06:01 / cg" |
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
628 |
"Modified: / 04-04-2012 / 11:24:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
320 | 629 |
! |
630 |
||
631 |
helpFilename |
|
632 |
"subclasses must return the relative name of a helpFile |
|
633 |
in the doc/online/<language>/help directory. |
|
634 |
Or nil, if no help is available." |
|
635 |
||
636 |
^nil |
|
637 |
||
638 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
639 |
"Modified: / 26-05-2008 / 13:12:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
640 |
! ! |
|
641 |
||
642 |
!MCSettingsApp methodsFor:'queries'! |
|
643 |
||
644 |
hasUnsavedChanges |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
645 |
|
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
646 |
self mcRepositories value = MCRepositoryGroup default repositories ifFalse:[^true]. |
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
647 |
|
524 | 648 |
"/ special case, because default value of false is not ok here !! |
649 |
(currentUserPrefs includesKey:#mcPrimaryRepository) ifTrue:[ |
|
1018 | 650 |
(self |
651 |
hasChangedAspectIn: #(mcPrimaryRepository) |
|
652 |
asComparedTo:currentUserPrefs) ifTrue:[^ true]. |
|
555 | 653 |
] ifFalse:[ |
1018 | 654 |
self mcRepositories value notNil ifTrue:[ |
655 |
self mcRepositories value ~= MCRepositoryGroup default repositories ifTrue:[ |
|
656 |
^ true |
|
657 |
] |
|
658 |
] |
|
524 | 659 |
]. |
517 | 660 |
^ self |
1018 | 661 |
hasChangedAspectIn: #(mcEnabled) |
662 |
asComparedTo:currentUserPrefs |
|
320 | 663 |
|
664 |
"Created: / 28-05-2008 / 07:33:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
665 |
"Modified: / 19-08-2009 / 12:07:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
560
86b316aba34b
Fixes in reading/storing MC preferences
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
555
diff
changeset
|
666 |
"Modified: / 04-04-2012 / 11:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
567 | 667 |
"Modified: / 24-07-2012 / 15:50:53 / cg" |
320 | 668 |
! ! |
669 |
||
670 |
!MCSettingsApp class methodsFor:'documentation'! |
|
671 |
||
672 |
version |
|
1018 | 673 |
^ '$Header$' |
320 | 674 |
! |
675 |
||
676 |
version_CVS |
|
1018 | 677 |
^ '$Header$' |
320 | 678 |
! |
679 |
||
680 |
version_SVN |
|
1018 | 681 |
^ '$Id$' |
320 | 682 |
! ! |