author | vrany |
Sat, 09 Jul 2011 15:53:19 +0200 | |
changeset 10300 | 5ed6f3d35cbb |
parent 10031 | ab9f8be764b6 |
child 10481 | d92bb3c471e7 |
permissions | -rw-r--r-- |
9824 | 1 |
" |
10031 | 2 |
COPYRIGHT (c) 2011 by eXept Software AG |
9824 | 3 |
All Rights Reserved |
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
9857 | 14 |
AbstractSourceCodeManagementSettingsAppl subclass:#StoreSourceCodeManagementSettingsAppl |
9824 | 15 |
instanceVariableNames:'sourceCacheDir useManager availableManagers condenseSourceCache |
16 |
setupSourceCodeManager checkClassesWhenCheckingIn |
|
17 |
formattingConfiguration flushSourceCache localSourceFirst |
|
18 |
repositoryHolder manager repository listOfModules |
|
19 |
cvsRootPrototypeList addPerModuleRoot removeEnabled |
|
20 |
perModuleRootModule acceptChannel removePerModuleRoot |
|
21 |
perModuleRoot cvsRootHolder selectedPerModuleRoot |
|
22 |
cvsBinDirectoryHolder cvsExecutableHolder rootsPerModule |
|
23 |
cvsLoginInModuleEnabled cvsLoginEnabled |
|
24 |
selectedManagerTypeIndexHolder managerIsCVSSourceCodeManager |
|
25 |
managerIsStoreSourceCodeManager storeLoginEnabled |
|
26 |
storeHostPrototypeList storeHostnameHolder storeUsernameHolder |
|
27 |
storePasswordHolder perStoreModuleHostnameHolder |
|
28 |
perStoreModuleUsernameHolder perStoreModulePasswordHolder |
|
29 |
perStoreModuleRoot perStoreModuleRootModule |
|
30 |
selectedPerStoreModuleRoot storeConnectEnabled |
|
31 |
storeConnectInModuleEnabled perModuleFieldsEnableHolder |
|
32 |
managerIsSmallTeamSourceCodeManager |
|
33 |
selectedPerSmallTeamModuleRoot |
|
34 |
perSmallTeamModuleFieldsEnableHolder perSmallTeamModuleRoot |
|
35 |
perSmallTeamModuleRootModule perSmallTeamModuleHostnameHolder |
|
36 |
smallTeamHostnameHolder verboseSourceCodeAccess keepMethodSource' |
|
37 |
classVariableNames:'RecentlyUsedCVSRoots RecentlyUsedStoreHosts |
|
38 |
RecentlyUsedSmallTeamHosts LastStoreHost LastStoreUser |
|
39 |
LastStorePassword' |
|
40 |
poolDictionaries:'' |
|
41 |
category:'System-SourceCodeManagement' |
|
42 |
! |
|
43 |
||
44 |
!StoreSourceCodeManagementSettingsAppl class methodsFor:'documentation'! |
|
45 |
||
46 |
copyright |
|
47 |
" |
|
10031 | 48 |
COPYRIGHT (c) 2011 by eXept Software AG |
9824 | 49 |
All Rights Reserved |
50 |
||
51 |
This software is furnished under a license and may be used |
|
52 |
only in accordance with the terms of that license and with the |
|
53 |
inclusion of the above copyright notice. This software may not |
|
54 |
be provided or otherwise made available to, or used by, any |
|
55 |
other person. No title to or ownership of the software is |
|
56 |
hereby transferred. |
|
57 |
" |
|
58 |
! |
|
59 |
||
60 |
documentation |
|
61 |
" |
|
62 |
Store (visualWorks repository access) source code settings - highly experimental and unsupported. |
|
63 |
" |
|
64 |
! ! |
|
65 |
||
66 |
!StoreSourceCodeManagementSettingsAppl class methodsFor:'image specs'! |
|
67 |
||
68 |
defaultIcon |
|
69 |
"This resource specification was automatically generated |
|
70 |
by the ImageEditor of ST/X." |
|
71 |
||
72 |
"Do not manually edit this!! If it is corrupted, |
|
73 |
the ImageEditor may not be able to read the specification." |
|
74 |
||
75 |
" |
|
76 |
self defaultIcon inspect |
|
77 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
78 |
Icon flushCachedIcons |
|
79 |
" |
|
80 |
||
81 |
<resource: #image> |
|
82 |
||
83 |
^Icon |
|
84 |
constantNamed:#'AbstractSettingsApplication::SourceCodeManagementSettingsAppl class defaultIcon' |
|
85 |
ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(8 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
86 |
@@@@@@@@@@@A@PHB@0P@@@@@@@@@@@@@@@@@@@HEA \HA $JB0HD@@@@@@@@@@@@@@HLA04NC0HD@@L@@ P@@@@@@@@@@@@ED@ NDP@@@@@@@@@D@@@@@@@@ |
|
87 |
@@@BA \FAPP@@@@@@@@@@@P@@@@@@@@@AQ@RC0@@@@@@@@@@@@@@@@@@@@@@@@TGA!!DD@@@@@@@@@@@@@@@@@@@D@PDIA08OA@@@@@@@@@@@@@@@@@@@AP S |
|
88 |
A0XIBPXGC0P@@@@@@@@@@@@@@@@ECAPLBPXOAP@@@@@@EQX@@@@@@@@@@@TIE@XOAP@@@@@@EQ\XE @@@@@@@@@@AP$OAP@@@@@@FQ\ZE!! V@@@@@@@@@@@E |
|
89 |
F0@@@@@@EQ\ZF!!(VFAX@@@@@@@@@@@@@@@@ZEQ\VE!!(ZF!!XWF @@@@@@@@@@@@@@@@@@@A\ZE!!(@@@@@@@@@@@@@@@@@@@@@@@@XE!!XZ@@@@@@@@@@@@@@@@ |
|
90 |
@@@@@@@@EQ(V@@@@@@@@@@@@@@@@@@@@@@@@EQ\VE @@@@@@@@@@@@@@@@@@@@@@EQ VE @@@@@@@@@@@@@@F @@@@@WEQ VE!!(@@@@@@@@@@@@@@@@@E!!\W |
|
91 |
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] |
|
92 |
! ! |
|
93 |
||
94 |
!StoreSourceCodeManagementSettingsAppl class methodsFor:'interface specs'! |
|
95 |
||
96 |
windowSpec |
|
97 |
"This resource specification was automatically generated |
|
98 |
by the UIPainter of ST/X." |
|
99 |
||
100 |
"Do not manually edit this!! If it is corrupted, |
|
101 |
the UIPainter may not be able to read the specification." |
|
102 |
||
103 |
" |
|
104 |
UIPainter new openOnClass:StoreSourceCodeManagementSettingsAppl andSelector:#windowSpec |
|
105 |
StoreSourceCodeManagementSettingsAppl new openInterface:#windowSpec |
|
106 |
StoreSourceCodeManagementSettingsAppl open |
|
107 |
" |
|
108 |
||
109 |
<resource: #canvas> |
|
110 |
||
111 |
^ |
|
112 |
#(FullSpec |
|
113 |
name: windowSpec |
|
114 |
window: |
|
115 |
(WindowSpec |
|
116 |
label: 'Source Code Manager Settings' |
|
117 |
name: 'Source Code Manager Settings' |
|
118 |
min: (Point 10 10) |
|
119 |
bounds: (Rectangle 0 0 659 580) |
|
120 |
) |
|
121 |
component: |
|
122 |
(SpecCollection |
|
123 |
collection: ( |
|
124 |
(VerticalPanelViewSpec |
|
125 |
name: 'VerticalPanel2' |
|
126 |
layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
127 |
horizontalLayout: fit |
|
128 |
verticalLayout: topSpace |
|
129 |
horizontalSpace: 3 |
|
130 |
verticalSpace: 20 |
|
131 |
component: |
|
132 |
(SpecCollection |
|
133 |
collection: ( |
|
134 |
(VerticalPanelViewSpec |
|
135 |
name: 'VerticalPanel3' |
|
136 |
horizontalLayout: fit |
|
137 |
verticalLayout: top |
|
138 |
horizontalSpace: 3 |
|
139 |
verticalSpace: 4 |
|
140 |
component: |
|
141 |
(SpecCollection |
|
142 |
collection: ( |
|
143 |
(ViewSpec |
|
144 |
name: 'ManagerSetupBoxx' |
|
145 |
component: |
|
146 |
(SpecCollection |
|
147 |
collection: ( |
|
148 |
(FramedBoxSpec |
|
9871
9acc0cd1aff9
changed: #settingsApplicationClass
Claus Gittinger <cg@exept.de>
parents:
9857
diff
changeset
|
149 |
label: 'Store-DB Source Repository Settings' |
9824 | 150 |
name: 'StoreSetupBox' |
151 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
152 |
labelPosition: topLeft |
|
153 |
translateLabel: true |
|
154 |
component: |
|
155 |
(SpecCollection |
|
156 |
collection: ( |
|
157 |
(ViewSpec |
|
158 |
name: 'HostBox' |
|
159 |
layout: (LayoutFrame 0 0 0 0 0 1 25 0) |
|
160 |
component: |
|
161 |
(SpecCollection |
|
162 |
collection: ( |
|
163 |
(LabelSpec |
|
164 |
label: 'DB or DB@Host:' |
|
165 |
name: 'StoreHostLabel' |
|
166 |
layout: (LayoutFrame 0 0.0 0 0 40 0.25 22 0) |
|
167 |
level: 0 |
|
168 |
translateLabel: true |
|
169 |
adjust: right |
|
170 |
) |
|
171 |
(ComboBoxSpec |
|
172 |
name: 'StoreHostComboBox' |
|
173 |
layout: (LayoutFrame 44 0.25 0 0 0 1 22 0) |
|
174 |
tabable: true |
|
175 |
model: storeHostnameHolder |
|
176 |
immediateAccept: true |
|
177 |
acceptOnLeave: true |
|
178 |
acceptOnReturn: true |
|
179 |
acceptOnTab: true |
|
180 |
acceptOnLostFocus: true |
|
181 |
acceptChannel: acceptChannel |
|
182 |
acceptOnPointerLeave: true |
|
183 |
comboList: storeHostPrototypeList |
|
184 |
) |
|
185 |
) |
|
186 |
||
187 |
) |
|
188 |
) |
|
189 |
(ViewSpec |
|
190 |
name: 'UserBox' |
|
191 |
layout: (LayoutFrame 0 0.0 27 0 0 1 52 0) |
|
192 |
component: |
|
193 |
(SpecCollection |
|
194 |
collection: ( |
|
195 |
(LabelSpec |
|
196 |
label: 'Username:' |
|
197 |
name: 'StoreUserLabel' |
|
198 |
layout: (LayoutFrame 0 0.0 0 0 40 0.25 22 0) |
|
199 |
level: 0 |
|
200 |
translateLabel: true |
|
201 |
adjust: right |
|
202 |
) |
|
203 |
(InputFieldSpec |
|
204 |
name: 'StoreUserEntryField' |
|
205 |
layout: (LayoutFrame 44 0.25 0 0 0 1 22 0) |
|
206 |
tabable: true |
|
207 |
model: storeUsernameHolder |
|
208 |
acceptChannel: acceptChannel |
|
209 |
acceptOnPointerLeave: true |
|
210 |
) |
|
211 |
) |
|
212 |
||
213 |
) |
|
214 |
) |
|
215 |
(ViewSpec |
|
216 |
name: 'PasswordBox' |
|
217 |
layout: (LayoutFrame 0 0.0 54 0 0 1 79 0) |
|
218 |
component: |
|
219 |
(SpecCollection |
|
220 |
collection: ( |
|
221 |
(LabelSpec |
|
222 |
label: 'Password:' |
|
223 |
name: 'Label7' |
|
224 |
layout: (LayoutFrame 0 0.0 0 0 40 0.25 22 0) |
|
225 |
level: 0 |
|
226 |
translateLabel: true |
|
227 |
adjust: right |
|
228 |
) |
|
229 |
(InputFieldSpec |
|
230 |
name: 'PasswordEntryField' |
|
231 |
layout: (LayoutFrame 44 0.25 0 0 -130 1 22 0) |
|
232 |
tabable: true |
|
233 |
model: storePasswordHolder |
|
234 |
type: password |
|
235 |
acceptChannel: acceptChannel |
|
236 |
acceptOnPointerLeave: true |
|
237 |
) |
|
238 |
) |
|
239 |
||
240 |
) |
|
241 |
) |
|
242 |
(HorizontalPanelViewSpec |
|
243 |
name: 'HorizontalPanel4' |
|
244 |
layout: (LayoutFrame -130 1 51 0 0 1 82 0) |
|
245 |
horizontalLayout: fitSpace |
|
246 |
verticalLayout: center |
|
247 |
horizontalSpace: 3 |
|
248 |
verticalSpace: 3 |
|
249 |
component: |
|
250 |
(SpecCollection |
|
251 |
collection: ( |
|
252 |
(ActionButtonSpec |
|
253 |
label: 'Try to Connect' |
|
254 |
name: 'TryConnectButton1' |
|
255 |
translateLabel: true |
|
256 |
tabable: true |
|
257 |
model: storeConnect |
|
258 |
enableChannel: storeConnectEnabled |
|
259 |
extent: (Point 124 22) |
|
260 |
) |
|
261 |
) |
|
262 |
||
263 |
) |
|
264 |
) |
|
265 |
(LabelSpec |
|
266 |
label: 'DB per Module:' |
|
267 |
name: 'Label4' |
|
268 |
layout: (LayoutFrame 0 0.0 82 0 40 0.25 104 0) |
|
269 |
translateLabel: true |
|
270 |
adjust: right |
|
271 |
) |
|
272 |
(SequenceViewSpec |
|
273 |
name: 'List2' |
|
274 |
layout: (LayoutFrame 44 0.25 82 0 0 1 180 0) |
|
275 |
tabable: true |
|
276 |
model: selectedPerStoreModuleRoot |
|
277 |
hasHorizontalScrollBar: true |
|
278 |
hasVerticalScrollBar: true |
|
279 |
miniScrollerHorizontal: true |
|
280 |
useIndex: false |
|
281 |
sequenceList: listOfModules |
|
282 |
) |
|
283 |
(LabelSpec |
|
284 |
label: 'Module:' |
|
285 |
name: 'perModuleModuleLabel' |
|
286 |
layout: (LayoutFrame 0 0.0 186 0 40 0.25 203 0) |
|
287 |
translateLabel: true |
|
288 |
adjust: right |
|
289 |
) |
|
290 |
(InputFieldSpec |
|
291 |
name: 'perModuleModuleEntryField' |
|
292 |
layout: (LayoutFrame 44 0.25 182 0 0 1 204 0) |
|
293 |
tabable: true |
|
294 |
model: perStoreModuleRoot |
|
295 |
acceptChannel: acceptChannel |
|
296 |
acceptOnPointerLeave: true |
|
297 |
) |
|
298 |
(LabelSpec |
|
299 |
label: 'DB:' |
|
300 |
name: 'perModuleDBLabel' |
|
301 |
layout: (LayoutFrame 0 0.0 211 0 40 0.25 228 0) |
|
302 |
translateLabel: true |
|
303 |
adjust: right |
|
304 |
) |
|
305 |
(ComboBoxSpec |
|
306 |
name: 'perModuleModuleHostComboBox2' |
|
307 |
layout: (LayoutFrame 44 0.25 207 0 0 1 229 0) |
|
308 |
tabable: true |
|
309 |
model: perStoreModuleHostnameHolder |
|
310 |
immediateAccept: true |
|
311 |
acceptOnLeave: true |
|
312 |
acceptOnReturn: true |
|
313 |
acceptOnTab: true |
|
314 |
acceptOnLostFocus: true |
|
315 |
acceptChannel: acceptChannel |
|
316 |
acceptOnPointerLeave: true |
|
317 |
comboList: storeHostPrototypeList |
|
318 |
) |
|
319 |
(LabelSpec |
|
320 |
label: 'User / Password:' |
|
321 |
name: 'perModuleUserPasswordLabel' |
|
322 |
layout: (LayoutFrame 0 0.0 236 0 40 0.25 253 0) |
|
323 |
translateLabel: true |
|
324 |
adjust: right |
|
325 |
) |
|
326 |
(InputFieldSpec |
|
327 |
name: 'perModuleUserEntryField' |
|
328 |
layout: (LayoutFrame 44 0.25 232 0 -2 0.65 254 0) |
|
329 |
tabable: true |
|
330 |
model: perStoreModuleUsernameHolder |
|
331 |
acceptChannel: acceptChannel |
|
332 |
acceptOnPointerLeave: true |
|
333 |
) |
|
334 |
(InputFieldSpec |
|
335 |
name: 'perModulePasswordEntryField' |
|
336 |
layout: (LayoutFrame 5 0.65 232 0 0 1 254 0) |
|
337 |
tabable: true |
|
338 |
model: perStoreModulePasswordHolder |
|
339 |
type: password |
|
340 |
acceptChannel: acceptChannel |
|
341 |
acceptOnPointerLeave: true |
|
342 |
) |
|
343 |
(HorizontalPanelViewSpec |
|
344 |
name: 'HorizontalPanel5' |
|
345 |
layout: (LayoutFrame 44 0.25 -25 1 -10 0.65 6 1) |
|
346 |
horizontalLayout: fit |
|
347 |
verticalLayout: center |
|
348 |
horizontalSpace: 3 |
|
349 |
verticalSpace: 3 |
|
350 |
component: |
|
351 |
(SpecCollection |
|
352 |
collection: ( |
|
353 |
(ActionButtonSpec |
|
354 |
label: 'Add/Apply' |
|
355 |
name: 'AddButton2' |
|
356 |
translateLabel: true |
|
357 |
tabable: true |
|
358 |
model: addPerStoreModuleDB |
|
359 |
extent: (Point 96 22) |
|
360 |
) |
|
361 |
(ActionButtonSpec |
|
362 |
label: 'Remove' |
|
363 |
name: 'RemoveButton3' |
|
364 |
translateLabel: true |
|
365 |
tabable: true |
|
366 |
model: removePerStoreModuleDB |
|
367 |
enableChannel: removeEnabled |
|
368 |
extent: (Point 97 22) |
|
369 |
) |
|
370 |
) |
|
371 |
||
372 |
) |
|
373 |
) |
|
374 |
(HorizontalPanelViewSpec |
|
375 |
name: 'HorizontalPanel6' |
|
376 |
layout: (LayoutFrame 10 0.65 -25 1 0 1 6 1) |
|
377 |
horizontalLayout: fit |
|
378 |
verticalLayout: center |
|
379 |
horizontalSpace: 3 |
|
380 |
verticalSpace: 3 |
|
381 |
component: |
|
382 |
(SpecCollection |
|
383 |
collection: ( |
|
384 |
(ActionButtonSpec |
|
385 |
label: 'Try to Connect' |
|
386 |
name: 'ConnectPerStoreModuleButton' |
|
387 |
translateLabel: true |
|
388 |
tabable: true |
|
389 |
model: connectPerStoreModuleDB |
|
390 |
enableChannel: storeConnectInModuleEnabled |
|
391 |
extent: (Point 103 22) |
|
392 |
) |
|
393 |
(ActionButtonSpec |
|
394 |
label: 'Browse' |
|
395 |
name: 'BrowsePerStoreModuleButton' |
|
396 |
translateLabel: true |
|
397 |
tabable: true |
|
398 |
model: browsePerStoreModuleDB |
|
399 |
enableChannel: storeConnectInModuleEnabled |
|
400 |
extent: (Point 103 22) |
|
401 |
) |
|
402 |
) |
|
403 |
||
404 |
) |
|
405 |
) |
|
406 |
) |
|
407 |
||
408 |
) |
|
409 |
) |
|
410 |
) |
|
411 |
||
412 |
) |
|
413 |
extent: (Point 659 327) |
|
414 |
) |
|
415 |
(FramedBoxSpec |
|
416 |
label: 'Source Cache' |
|
417 |
name: 'FramedBox1' |
|
418 |
labelPosition: topLeft |
|
419 |
translateLabel: true |
|
420 |
component: |
|
421 |
(SpecCollection |
|
422 |
collection: ( |
|
423 |
(ViewSpec |
|
424 |
name: 'SourceCacheDirBox' |
|
425 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
426 |
component: |
|
427 |
(SpecCollection |
|
428 |
collection: ( |
|
429 |
(LabelSpec |
|
430 |
label: 'Source Cache Dir:' |
|
431 |
name: 'SourceCacheDirLabel' |
|
432 |
layout: (LayoutFrame 0 0.0 0 0 60 0.25 22 0) |
|
433 |
translateLabel: true |
|
434 |
adjust: right |
|
435 |
) |
|
436 |
(InputFieldSpec |
|
437 |
name: 'SourceCacheDirEntryField' |
|
438 |
layout: (LayoutFrame 64 0.25 0 0 0 1 22 0) |
|
439 |
enableChannel: useManager |
|
440 |
model: sourceCacheDir |
|
441 |
immediateAccept: false |
|
442 |
acceptOnReturn: true |
|
443 |
acceptOnTab: true |
|
444 |
acceptOnLostFocus: true |
|
445 |
acceptOnPointerLeave: true |
|
446 |
) |
|
447 |
) |
|
448 |
||
449 |
) |
|
450 |
) |
|
451 |
(HorizontalPanelViewSpec |
|
452 |
name: 'CacheActionsHorizontalPanel' |
|
453 |
layout: (LayoutFrame 44 0.25 33 0 0 1 67 0) |
|
454 |
horizontalLayout: fitSpace |
|
455 |
verticalLayout: center |
|
456 |
horizontalSpace: 3 |
|
457 |
verticalSpace: 3 |
|
458 |
component: |
|
459 |
(SpecCollection |
|
460 |
collection: ( |
|
461 |
(ActionButtonSpec |
|
462 |
label: 'Flush Cache now' |
|
463 |
name: 'FlushCacheNowButton' |
|
464 |
translateLabel: true |
|
465 |
tabable: true |
|
466 |
model: flushSourceCache |
|
467 |
enableChannel: useManager |
|
468 |
extent: (Point 208 22) |
|
469 |
) |
|
470 |
(ActionButtonSpec |
|
471 |
label: 'Condense Cache now' |
|
472 |
name: 'CondenseCacheNowButton' |
|
473 |
translateLabel: true |
|
474 |
tabable: true |
|
475 |
model: condenseSourceCache |
|
476 |
enableChannel: useManager |
|
477 |
extent: (Point 208 22) |
|
478 |
) |
|
479 |
) |
|
480 |
||
481 |
) |
|
482 |
) |
|
483 |
) |
|
484 |
||
485 |
) |
|
486 |
extent: (Point 659 95) |
|
487 |
) |
|
488 |
) |
|
489 |
||
490 |
) |
|
491 |
extent: (Point 659 768) |
|
492 |
) |
|
493 |
) |
|
494 |
||
495 |
) |
|
496 |
) |
|
497 |
) |
|
498 |
||
499 |
) |
|
500 |
) |
|
501 |
! ! |
|
502 |
||
9857 | 503 |
!StoreSourceCodeManagementSettingsAppl class methodsFor:'queries'! |
504 |
||
505 |
managerClass |
|
506 |
"backlink to my manager class (needed by the settings app)" |
|
507 |
||
508 |
^ StoreSourceCodeManager |
|
509 |
||
510 |
"Created: / 19-04-2011 / 12:48:57 / cg" |
|
511 |
! ! |
|
512 |
||
9824 | 513 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'accessing'! |
514 |
||
515 |
manager |
|
516 |
||
517 |
^ Smalltalk at:#SourceCodeManager |
|
518 |
! ! |
|
519 |
||
520 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'actions'! |
|
521 |
||
522 |
addModule:module withData:data |
|
523 |
(self listOfModules includes:module) ifFalse:[ |
|
524 |
self listOfModules add:module; sort. |
|
525 |
]. |
|
526 |
rootsPerModule at:module put:data. |
|
527 |
||
528 |
self updateModifiedChannel. |
|
529 |
||
530 |
"Created: / 08-11-2006 / 19:25:21 / cg" |
|
531 |
! |
|
532 |
||
533 |
basicReadSettings |
|
534 |
self initialize. |
|
535 |
||
536 |
self sourceCacheDir value:(StoreSourceCodeManager cacheDirectoryName). |
|
537 |
||
538 |
"/ StoreSourceCodeManager forgetDisabledModules. |
|
539 |
self storeHostnameHolder value: (StoreSourceCodeManager hostAndDBName). |
|
540 |
self storeUsernameHolder value: (StoreSourceCodeManager userName). |
|
541 |
self storePasswordHolder value: (StoreSourceCodeManager password). |
|
542 |
||
543 |
(Array with:StoreSourceCodeManager) "self availableManagers" do:[:eachManager | |
|
544 |
|infoPerModule| |
|
545 |
||
546 |
infoPerModule := eachManager repositoryInfoPerModule. |
|
547 |
infoPerModule keysAndValuesDo:[:module :info | |
|
548 |
rootsPerModule at:module put:(Array with:eachManager with:info). |
|
549 |
]. |
|
550 |
]. |
|
551 |
||
552 |
"/ self updateSelectedManager. |
|
553 |
||
554 |
rootsPerModule notNil ifTrue:[ |
|
555 |
self listOfModules removeAll. |
|
556 |
listOfModules addAll:rootsPerModule keys asList. |
|
557 |
]. |
|
558 |
"/ self selectedPerModuleRootChanged. |
|
559 |
||
560 |
"Modified: / 18-04-2011 / 18:40:40 / cg" |
|
561 |
! |
|
562 |
||
563 |
basicSaveSettings |
|
564 |
|modules nm fn| |
|
565 |
||
566 |
nm := self sourceCacheDir value. |
|
567 |
nm notEmptyOrNil ifTrue:[ |
|
568 |
(fn := nm asFilename) exists ifFalse:[ |
|
569 |
(self confirm:('Cache directory ''' , nm , ''' does not exist\create ?' withCRs)) ifTrue:[ |
|
570 |
fn recursiveMakeDirectory; |
|
571 |
makeReadableForAll; |
|
572 |
makeWritableForAll; |
|
573 |
makeExecutableForAll. |
|
574 |
] |
|
575 |
]. |
|
576 |
(fn isDirectory |
|
577 |
and:[fn isReadable |
|
578 |
and:[fn isWritable]]) ifTrue:[ |
|
579 |
StoreSourceCodeManager cacheDirectoryName:nm. |
|
580 |
] ifFalse:[ |
|
581 |
self warn:'Invalid sourceCache directory.' |
|
582 |
] |
|
583 |
]. |
|
584 |
||
585 |
(Array with:StoreSourceCodeManager) "self availableManagers" do:[:eachManager | |
|
586 |
|infoPerModule| |
|
587 |
modules := rootsPerModule select:[:entry | entry first == eachManager]. |
|
588 |
infoPerModule := Dictionary new. |
|
589 |
modules keysAndValuesDo:[:module :entry | |
|
590 |
entry first == eachManager ifTrue:[ |
|
591 |
infoPerModule at:module put:(entry second). |
|
592 |
]. |
|
593 |
]. |
|
594 |
eachManager repositoryInfoPerModule:infoPerModule. |
|
595 |
]. |
|
596 |
||
597 |
self basicSaveStoreSettings. |
|
598 |
||
599 |
self sourceCacheDir value:(StoreSourceCodeManager cacheDirectoryName). |
|
600 |
||
601 |
DebugView newDebugger. "/ ??? |
|
602 |
||
603 |
self acceptChannel value. |
|
604 |
||
605 |
"Modified: / 18-04-2011 / 18:36:42 / cg" |
|
606 |
! |
|
607 |
||
608 |
condenseSourceCache |
|
609 |
self withWaitCursorDo:[ AbstractSourceCodeManager condenseSourceCache ]. |
|
610 |
Method flushSourceStreamCache. |
|
611 |
||
612 |
"Modified: / 28-11-2006 / 12:21:33 / cg" |
|
613 |
! |
|
614 |
||
615 |
flushSourceCache |
|
616 |
self withWaitCursorDo:[ AbstractSourceCodeManager flushSourceCache ]. |
|
617 |
Method flushSourceStreamCache. |
|
618 |
||
619 |
"Modified: / 28-11-2006 / 12:21:21 / cg" |
|
620 |
! |
|
621 |
||
622 |
removePerModuleRoot |
|
623 |
||
624 |
|module| |
|
625 |
||
626 |
acceptChannel value:true. |
|
627 |
module := self perModuleRootModule value. |
|
628 |
self listOfModules remove:module ifAbsent:nil. |
|
629 |
rootsPerModule removeKey:module ifAbsent:nil. |
|
630 |
self perModuleRootModule value:nil. |
|
631 |
self perModuleRoot value:nil. |
|
632 |
self updateModifiedChannel. |
|
633 |
! |
|
634 |
||
635 |
setupSourceCodeManager |
|
636 |
||
637 |
AbstractLauncherApplication::LauncherDialogs cvsConfigurationDialog. |
|
638 |
manager := (Smalltalk at:#SourceCodeManager). |
|
639 |
manager notNil ifTrue:[ |
|
640 |
repositoryHolder value: manager repositoryName. |
|
641 |
sourceCacheDir value:(AbstractSourceCodeManager cacheDirectoryName). |
|
642 |
]. |
|
643 |
||
644 |
"Modified: / 16-08-2006 / 11:07:51 / cg" |
|
645 |
! ! |
|
646 |
||
647 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'actions - store'! |
|
648 |
||
649 |
addPerStoreModuleDB |
|
650 |
|module info| |
|
651 |
||
652 |
acceptChannel value:true. |
|
653 |
||
654 |
module := self perStoreModuleRoot value. |
|
655 |
info := StoreSourceCodeManager newDBInfo. |
|
656 |
info hostAndDBName:perStoreModuleHostnameHolder value. |
|
657 |
info userName:perStoreModuleUsernameHolder value. |
|
658 |
info password:perStoreModulePasswordHolder value. |
|
659 |
||
660 |
self addModule:module withData:(Array with:StoreSourceCodeManager with:info). |
|
661 |
||
662 |
"Modified: / 08-11-2006 / 19:27:35 / cg" |
|
663 |
! |
|
664 |
||
665 |
basicSaveStoreSettings |
|
666 |
|storeHost| |
|
667 |
||
668 |
StoreSourceCodeManager hostAndDBName:(storeHost := self storeHostnameHolder value withoutSeparators). |
|
669 |
StoreSourceCodeManager userName:(self storeUsernameHolder value withoutSeparators). |
|
670 |
StoreSourceCodeManager password:(self storePasswordHolder value withoutSeparators). |
|
671 |
||
672 |
storeHost notEmptyOrNil ifTrue:[ |
|
673 |
StoreSourceCodeManager connectToDatabase. |
|
674 |
]. |
|
675 |
||
676 |
RecentlyUsedStoreHosts isNil ifTrue:[ |
|
677 |
RecentlyUsedStoreHosts := OrderedCollection new. |
|
678 |
]. |
|
679 |
(RecentlyUsedStoreHosts includes:storeHost) ifFalse:[ |
|
680 |
RecentlyUsedStoreHosts addFirst:storeHost. |
|
681 |
RecentlyUsedStoreHosts size > 20 ifTrue:[ |
|
682 |
RecentlyUsedStoreHosts removeLast. |
|
683 |
]. |
|
684 |
]. |
|
685 |
! |
|
686 |
||
687 |
browsePerStoreModuleDB |
|
688 |
|testInfo| |
|
689 |
||
690 |
testInfo := StoreSourceCodeManager newDBInfo. |
|
691 |
testInfo hostAndDBName:(perStoreModuleHostnameHolder value). |
|
692 |
testInfo userName:(perStoreModuleUsernameHolder value). |
|
693 |
testInfo password:(perStoreModulePasswordHolder value). |
|
694 |
self browseStoreDB:testInfo |
|
695 |
! |
|
696 |
||
697 |
browseStoreDB:dbInfo |
|
698 |
Tools::StoreProjectBrowser openOn:dbInfo |
|
699 |
! |
|
700 |
||
701 |
connectPerStoreModuleDB |
|
702 |
|testInfo| |
|
703 |
||
704 |
testInfo := StoreSourceCodeManager newDBInfo. |
|
705 |
testInfo hostAndDBName:(perStoreModuleHostnameHolder value). |
|
706 |
testInfo userName:(perStoreModuleUsernameHolder value). |
|
707 |
testInfo password:(perStoreModulePasswordHolder value). |
|
708 |
||
709 |
(self tryToConnectTo:testInfo) |
|
710 |
! |
|
711 |
||
712 |
storeConnect |
|
713 |
|testInfo| |
|
714 |
||
715 |
testInfo := StoreSourceCodeManager newDBInfo. |
|
716 |
testInfo hostAndDBName:(storeHostnameHolder value). |
|
717 |
testInfo userName:(storeUsernameHolder value). |
|
718 |
testInfo password:(storePasswordHolder value). |
|
719 |
||
720 |
(self tryToConnectTo:testInfo) ifTrue:[ |
|
721 |
LastStoreHost := storeHostnameHolder value. |
|
722 |
LastStoreUser := storeUsernameHolder value. |
|
723 |
LastStorePassword := storePasswordHolder value. |
|
724 |
]. |
|
725 |
! |
|
726 |
||
727 |
tryToConnectTo:dbInfo |
|
728 |
|session| |
|
729 |
||
730 |
SQL::SQLError handle:[:ex | |
|
731 |
self warn:('Failed to connect to Database:\\' withCRs,ex description). |
|
732 |
^ false. |
|
733 |
] do:[ |
|
734 |
self withWaitCursorDo:[ |
|
735 |
session := StoreSourceCodeManager tryToConnectToDatabase:dbInfo. |
|
736 |
] |
|
737 |
]. |
|
738 |
session isNil ifTrue:[ |
|
739 |
self warn:'OOPS - Failed to connect'. |
|
740 |
^ false. |
|
741 |
]. |
|
742 |
||
743 |
self information:('Successfully connected to ',dbInfo dbName,'.'). |
|
744 |
session disconnect. |
|
745 |
^ true |
|
746 |
! ! |
|
747 |
||
748 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'aspects'! |
|
749 |
||
750 |
acceptChannel |
|
751 |
||
752 |
acceptChannel isNil ifTrue:[ |
|
753 |
acceptChannel := TriggerValue new. |
|
754 |
]. |
|
755 |
^ acceptChannel. |
|
756 |
! |
|
757 |
||
758 |
checkClassesWhenCheckingIn |
|
759 |
||
760 |
checkClassesWhenCheckingIn isNil ifTrue:[ |
|
761 |
checkClassesWhenCheckingIn := (currentUserPrefs at:#checkClassesWhenCheckingIn ifAbsent:true) asValue. |
|
762 |
checkClassesWhenCheckingIn onChangeSend:#updateModifiedChannel to:self |
|
763 |
]. |
|
764 |
^ checkClassesWhenCheckingIn. |
|
765 |
! |
|
766 |
||
767 |
keepMethodSource |
|
768 |
||
769 |
keepMethodSource isNil ifTrue:[ |
|
770 |
keepMethodSource := ValueHolder new. |
|
771 |
keepMethodSource onChangeSend:#updateModifiedChannel to:self |
|
772 |
]. |
|
773 |
^ keepMethodSource. |
|
774 |
! |
|
775 |
||
776 |
listOfModules |
|
777 |
||
778 |
listOfModules isNil ifTrue:[ |
|
779 |
rootsPerModule notNil ifTrue:[ |
|
780 |
listOfModules := rootsPerModule keys asList. |
|
781 |
]. |
|
782 |
listOfModules sort. |
|
783 |
listOfModules onChangeSend:#updateModifiedChannel to:self |
|
784 |
]. |
|
785 |
^ listOfModules. |
|
786 |
! |
|
787 |
||
788 |
localSourceFirst |
|
789 |
||
790 |
localSourceFirst isNil ifTrue:[ |
|
791 |
localSourceFirst := ValueHolder new. |
|
792 |
localSourceFirst onChangeSend:#updateModifiedChannel to:self |
|
793 |
]. |
|
794 |
^ localSourceFirst. |
|
795 |
! |
|
796 |
||
797 |
managerIsCVSSourceCodeManager |
|
798 |
managerIsCVSSourceCodeManager isNil ifTrue:[ |
|
799 |
managerIsCVSSourceCodeManager := (SourceCodeManager notNil and: |
|
800 |
[SourceCodeManager isCVS]) asValue. |
|
801 |
]. |
|
802 |
^ managerIsCVSSourceCodeManager. |
|
803 |
||
804 |
"Created: / 16-08-2006 / 10:56:38 / cg" |
|
805 |
! |
|
806 |
||
807 |
managerIsSmallTeamSourceCodeManager |
|
808 |
managerIsSmallTeamSourceCodeManager isNil ifTrue:[ |
|
809 |
managerIsSmallTeamSourceCodeManager := (SourceCodeManager notNil and: |
|
810 |
[SourceCodeManager isSmallTeam]) asValue. |
|
811 |
]. |
|
812 |
^ managerIsSmallTeamSourceCodeManager. |
|
813 |
||
814 |
"Created: / 09-11-2006 / 14:33:53 / cg" |
|
815 |
! |
|
816 |
||
817 |
managerIsStoreSourceCodeManager |
|
818 |
managerIsStoreSourceCodeManager isNil ifTrue:[ |
|
819 |
managerIsStoreSourceCodeManager := (SourceCodeManager notNil and: |
|
820 |
[SourceCodeManager isStore]) asValue. |
|
821 |
]. |
|
822 |
^ managerIsStoreSourceCodeManager. |
|
823 |
||
824 |
"Created: / 16-08-2006 / 10:57:13 / cg" |
|
825 |
! |
|
826 |
||
827 |
perModuleFieldsEnableHolder |
|
828 |
||
829 |
perModuleFieldsEnableHolder isNil ifTrue:[ |
|
830 |
perModuleFieldsEnableHolder := true asValue. |
|
831 |
perModuleFieldsEnableHolder addDependent:self. |
|
832 |
]. |
|
833 |
^ perModuleFieldsEnableHolder. |
|
834 |
! |
|
835 |
||
836 |
perModuleRoot |
|
837 |
perModuleRoot isNil ifTrue:[ |
|
838 |
perModuleRoot := ValueHolder new. |
|
839 |
perModuleRoot addDependent:self. |
|
840 |
]. |
|
841 |
^ perModuleRoot. |
|
842 |
! |
|
843 |
||
844 |
perModuleRootModule |
|
845 |
perModuleRootModule isNil ifTrue:[ |
|
846 |
perModuleRootModule := ValueHolder new. |
|
847 |
]. |
|
848 |
^ perModuleRootModule. |
|
849 |
! |
|
850 |
||
851 |
perStoreModuleFieldsEnableHolder |
|
852 |
||
853 |
perSmallTeamModuleFieldsEnableHolder isNil ifTrue:[ |
|
854 |
perSmallTeamModuleFieldsEnableHolder := true asValue. |
|
855 |
perSmallTeamModuleFieldsEnableHolder addDependent:self. |
|
856 |
]. |
|
857 |
^ perSmallTeamModuleFieldsEnableHolder. |
|
858 |
! |
|
859 |
||
860 |
perStoreModuleHostnameHolder |
|
861 |
||
862 |
perStoreModuleHostnameHolder isNil ifTrue:[ |
|
863 |
perStoreModuleHostnameHolder := '' asValue. |
|
864 |
perStoreModuleHostnameHolder addDependent:self. |
|
865 |
]. |
|
866 |
^ perStoreModuleHostnameHolder. |
|
867 |
! |
|
868 |
||
869 |
perStoreModulePasswordHolder |
|
870 |
||
871 |
perStoreModulePasswordHolder isNil ifTrue:[ |
|
872 |
perStoreModulePasswordHolder := '' asValue. |
|
873 |
perStoreModulePasswordHolder addDependent:self. |
|
874 |
]. |
|
875 |
^ perStoreModulePasswordHolder. |
|
876 |
! |
|
877 |
||
878 |
perStoreModuleRoot |
|
879 |
perStoreModuleRoot isNil ifTrue:[ |
|
880 |
perStoreModuleRoot := ValueHolder new. |
|
881 |
perStoreModuleRoot addDependent:self. |
|
882 |
]. |
|
883 |
^ perStoreModuleRoot. |
|
884 |
! |
|
885 |
||
886 |
perStoreModuleRootModule |
|
887 |
perStoreModuleRootModule isNil ifTrue:[ |
|
888 |
perStoreModuleRootModule := ValueHolder new. |
|
889 |
]. |
|
890 |
^ perStoreModuleRootModule. |
|
891 |
! |
|
892 |
||
893 |
perStoreModuleUsernameHolder |
|
894 |
||
895 |
perStoreModuleUsernameHolder isNil ifTrue:[ |
|
896 |
perStoreModuleUsernameHolder := '' asValue. |
|
897 |
perStoreModuleUsernameHolder addDependent:self. |
|
898 |
]. |
|
899 |
^ perStoreModuleUsernameHolder. |
|
900 |
! |
|
901 |
||
902 |
removeEnabled |
|
903 |
||
904 |
removeEnabled isNil ifTrue:[ |
|
905 |
removeEnabled := false asValue. |
|
906 |
]. |
|
907 |
^ removeEnabled. |
|
908 |
! |
|
909 |
||
910 |
selectedPerModuleRoot |
|
911 |
selectedPerModuleRoot isNil ifTrue:[ |
|
912 |
selectedPerModuleRoot := ValueHolder new. |
|
913 |
selectedPerModuleRoot addDependent:self. |
|
914 |
]. |
|
915 |
^ selectedPerModuleRoot. |
|
916 |
! |
|
917 |
||
918 |
selectedPerStoreModuleRoot |
|
919 |
selectedPerStoreModuleRoot isNil ifTrue:[ |
|
920 |
selectedPerStoreModuleRoot := ValueHolder new. |
|
921 |
selectedPerStoreModuleRoot addDependent:self. |
|
922 |
]. |
|
923 |
^ selectedPerStoreModuleRoot. |
|
924 |
! |
|
925 |
||
926 |
sourceCacheDir |
|
927 |
sourceCacheDir isNil ifTrue:[ |
|
928 |
sourceCacheDir := ValueHolder new. |
|
929 |
sourceCacheDir onChangeSend:#updateModifiedChannel to:self |
|
930 |
]. |
|
931 |
^ sourceCacheDir. |
|
932 |
! |
|
933 |
||
934 |
storeConnectEnabled |
|
935 |
storeConnectEnabled isNil ifTrue:[ |
|
936 |
storeConnectEnabled := false asValue. |
|
937 |
]. |
|
938 |
^ storeConnectEnabled. |
|
939 |
! |
|
940 |
||
941 |
storeConnectInModuleEnabled |
|
942 |
storeConnectInModuleEnabled isNil ifTrue:[ |
|
943 |
storeConnectInModuleEnabled := false asValue. |
|
944 |
]. |
|
945 |
^ storeConnectInModuleEnabled. |
|
946 |
! |
|
947 |
||
948 |
storeHostPrototypeList |
|
949 |
|prototypeList| |
|
950 |
||
951 |
storeHostPrototypeList isNil ifTrue:[ |
|
952 |
prototypeList := OrderedSet new. |
|
953 |
||
954 |
prototypeList add:('public@store.smalltalk-x.de:5432'). |
|
955 |
prototypeList add:('public'). |
|
956 |
prototypeList add:('stx'). |
|
957 |
||
958 |
OperatingSystem getLoginName = 'cg' ifTrue:[ |
|
959 |
prototypeList add:('oyster@store.smalltalk-x.de:5432'). |
|
960 |
prototypeList add:('oyster'). |
|
961 |
]. |
|
962 |
||
963 |
OperatingSystem getDomainName = 'exept.de' ifTrue:[ |
|
964 |
prototypeList add:('stx@exept.exept.de:5432'). |
|
965 |
] ifFalse:[ |
|
966 |
prototypeList add:('db@host'). |
|
967 |
prototypeList add:('db@host:port'). |
|
968 |
]. |
|
969 |
storeHostPrototypeList := prototypeList asOrderedCollection. |
|
970 |
]. |
|
971 |
^ storeHostPrototypeList. |
|
972 |
! |
|
973 |
||
974 |
storeHostnameHolder |
|
975 |
||
976 |
storeHostnameHolder isNil ifTrue:[ |
|
977 |
storeHostnameHolder := ("LastStoreHost ?" '') asValue. |
|
978 |
storeHostnameHolder addDependent:self. |
|
979 |
]. |
|
980 |
^ storeHostnameHolder. |
|
981 |
! |
|
982 |
||
983 |
storeLoginEnabled |
|
984 |
storeLoginEnabled isNil ifTrue:[ |
|
985 |
storeLoginEnabled := false asValue. |
|
986 |
]. |
|
987 |
^ storeLoginEnabled. |
|
988 |
||
989 |
"Created: / 16-08-2006 / 11:11:15 / cg" |
|
990 |
! |
|
991 |
||
992 |
storePasswordHolder |
|
993 |
||
994 |
storePasswordHolder isNil ifTrue:[ |
|
995 |
storePasswordHolder := ("LastStorePassword ?" '') asValue. |
|
996 |
storePasswordHolder addDependent:self. |
|
997 |
]. |
|
998 |
^ storePasswordHolder. |
|
999 |
! |
|
1000 |
||
1001 |
storeUsernameHolder |
|
1002 |
||
1003 |
storeUsernameHolder isNil ifTrue:[ |
|
1004 |
storeUsernameHolder := ("LastStoreUser ?" '') asValue. |
|
1005 |
storeUsernameHolder addDependent:self. |
|
1006 |
]. |
|
1007 |
^ storeUsernameHolder. |
|
1008 |
! |
|
1009 |
||
1010 |
useManager |
|
1011 |
useManager isNil ifTrue:[ |
|
1012 |
useManager := ValueHolder new. |
|
1013 |
useManager onChangeSend:#updateModifiedChannel to:self |
|
1014 |
]. |
|
1015 |
^ useManager. |
|
1016 |
! |
|
1017 |
||
1018 |
verboseSourceCodeAccess |
|
1019 |
verboseSourceCodeAccess isNil ifTrue:[ |
|
1020 |
verboseSourceCodeAccess := false asValue. |
|
1021 |
verboseSourceCodeAccess onChangeSend:#updateModifiedChannel to:self |
|
1022 |
]. |
|
1023 |
^ verboseSourceCodeAccess. |
|
1024 |
! ! |
|
1025 |
||
1026 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'change & update'! |
|
1027 |
||
1028 |
selectedPerModuleRootChanged |
|
1029 |
|module entry| |
|
1030 |
||
1031 |
self acceptChannel value:true. |
|
1032 |
module := self selectedPerModuleRoot value. |
|
1033 |
module isNil ifTrue:[ |
|
1034 |
self removeEnabled value:false. |
|
1035 |
self perModuleRootModule value:' '. |
|
1036 |
self perModuleRoot value:''. |
|
1037 |
^ self |
|
1038 |
]. |
|
1039 |
||
1040 |
entry := rootsPerModule at:module ifAbsent:#(). |
|
1041 |
(entry first = CVSSourceCodeManager) ifTrue:[ |
|
1042 |
self removeEnabled value:true. |
|
1043 |
self perModuleRootModule value:module. |
|
1044 |
self perModuleRoot value:(entry at:2). |
|
1045 |
] ifFalse:[ |
|
1046 |
self removeEnabled value:false. |
|
1047 |
self perModuleRootModule value:module , ' ',('<<use ',entry first managerTypeName,'>>') allBold. |
|
1048 |
self perModuleRoot value:''. |
|
1049 |
]. |
|
1050 |
! |
|
1051 |
||
1052 |
selectedPerStoreModuleRootChanged |
|
1053 |
|module entry| |
|
1054 |
||
1055 |
self acceptChannel value:true. |
|
1056 |
||
1057 |
module := self selectedPerStoreModuleRoot value. |
|
1058 |
module isNil ifTrue:[ |
|
1059 |
self removeEnabled value:false. |
|
1060 |
self perStoreModuleRoot value:''. |
|
1061 |
self perStoreModuleHostnameHolder value:''. |
|
1062 |
self perStoreModuleUsernameHolder value:''. |
|
1063 |
self perStoreModulePasswordHolder value:''. |
|
1064 |
^ self |
|
1065 |
]. |
|
1066 |
||
1067 |
entry := rootsPerModule at:module ifAbsent:#(). |
|
1068 |
(entry first = StoreSourceCodeManager) ifTrue:[ |
|
1069 |
self removeEnabled value:true. |
|
1070 |
self perStoreModuleRoot value:module. |
|
1071 |
self perStoreModuleHostnameHolder value:(entry at:2) hostAndDBName. |
|
1072 |
self perStoreModuleUsernameHolder value:(entry at:2) userName. |
|
1073 |
self perStoreModulePasswordHolder value:(entry at:2) password. |
|
1074 |
] ifFalse:[ |
|
1075 |
self removeEnabled value:false. |
|
1076 |
self perStoreModuleRoot value:module , ' ',('<<use ',entry first managerTypeName,'>>') allBold. |
|
1077 |
self perStoreModuleHostnameHolder value:''. |
|
1078 |
self perStoreModuleUsernameHolder value:''. |
|
1079 |
self perStoreModulePasswordHolder value:''. |
|
1080 |
]. |
|
1081 |
! |
|
1082 |
||
1083 |
sourceDirChanged |
|
1084 |
|nm fn previousDir| |
|
1085 |
||
1086 |
manager isNil ifTrue:[^ self]. |
|
1087 |
||
1088 |
previousDir := AbstractSourceCodeManager cacheDirectoryName. |
|
1089 |
||
1090 |
nm := self sourceCacheDir value. |
|
1091 |
nm isEmptyOrNil ifTrue:[^ self]. |
|
1092 |
||
1093 |
(fn := nm asFilename) exists ifFalse:[ |
|
1094 |
(self confirm:(resources |
|
1095 |
stringWithCRs:'SourceCache directory "%1" does not exist.\Create ?' |
|
1096 |
with:nm) |
|
1097 |
) ifFalse:[ |
|
1098 |
self sourceCacheDir value:previousDir. |
|
1099 |
^ self. |
|
1100 |
]. |
|
1101 |
fn |
|
1102 |
recursiveMakeDirectory; |
|
1103 |
makeReadableForAll; |
|
1104 |
makeWritableForAll; |
|
1105 |
makeExecutableForAll. |
|
1106 |
^ self. |
|
1107 |
]. |
|
1108 |
||
1109 |
(fn isDirectory) ifFalse:[ |
|
1110 |
self warn:(resources |
|
1111 |
stringWithCRs:'Not a directory: "%1"' |
|
1112 |
with:nm). |
|
1113 |
self sourceCacheDir value:previousDir. |
|
1114 |
^ self. |
|
1115 |
]. |
|
1116 |
||
1117 |
(fn isReadable and:[fn isWritable]) ifFalse:[ |
|
1118 |
(self confirm:(resources |
|
1119 |
stringWithCRs:'SourceCache directory "%1" is not both readable and writable.\Change ?' |
|
1120 |
with:nm) |
|
1121 |
) ifFalse:[ |
|
1122 |
self sourceCacheDir value:previousDir. |
|
1123 |
^ self. |
|
1124 |
]. |
|
1125 |
fn |
|
1126 |
makeReadableForAll; |
|
1127 |
makeWritableForAll; |
|
1128 |
makeExecutableForAll. |
|
1129 |
]. |
|
1130 |
"/ (fn isReadableForAll and:[fn isWritableForAll]) ifFalse:[ |
|
1131 |
"/ (self confirm:(resources |
|
1132 |
"/ stringWithCRs:'SourceCache directory "%1" is not both readable and writable for other users.\Change ?' |
|
1133 |
"/ with:nm) |
|
1134 |
"/ ) ifTrue:[ |
|
1135 |
"/ fn |
|
1136 |
"/ makeReadableForAll; |
|
1137 |
"/ makeWritableForAll; |
|
1138 |
"/ makeExecutableForAll. |
|
1139 |
"/ ] |
|
1140 |
"/ ]. |
|
1141 |
! |
|
1142 |
||
1143 |
update:something with:aParameter from:changedObject |
|
1144 |
"/ common |
|
1145 |
changedObject == sourceCacheDir ifTrue:[ |
|
1146 |
self sourceDirChanged. |
|
1147 |
self updateModifiedChannel. |
|
1148 |
^ self |
|
1149 |
]. |
|
1150 |
||
1151 |
"/ store |
|
1152 |
changedObject == storeHostnameHolder ifTrue:[ |
|
1153 |
self updateConnectEnableHolders. |
|
1154 |
^ self |
|
1155 |
]. |
|
1156 |
changedObject == storeUsernameHolder ifTrue:[ |
|
1157 |
self updateConnectEnableHolders. |
|
1158 |
^ self |
|
1159 |
]. |
|
1160 |
changedObject == storePasswordHolder ifTrue:[ |
|
1161 |
self updateConnectEnableHolders. |
|
1162 |
^ self |
|
1163 |
]. |
|
1164 |
changedObject == perStoreModuleRoot ifTrue:[ |
|
1165 |
self updateConnectEnableHolders. |
|
1166 |
^ self |
|
1167 |
]. |
|
1168 |
changedObject == perStoreModuleHostnameHolder ifTrue:[ |
|
1169 |
self updateConnectEnableHolders. |
|
1170 |
^ self |
|
1171 |
]. |
|
1172 |
changedObject == perStoreModuleUsernameHolder ifTrue:[ |
|
1173 |
self updateConnectEnableHolders. |
|
1174 |
^ self |
|
1175 |
]. |
|
1176 |
changedObject == perStoreModulePasswordHolder ifTrue:[ |
|
1177 |
self updateConnectEnableHolders. |
|
1178 |
^ self |
|
1179 |
]. |
|
1180 |
changedObject == selectedPerStoreModuleRoot ifTrue:[ |
|
1181 |
self selectedPerStoreModuleRootChanged. |
|
1182 |
^ self |
|
1183 |
]. |
|
1184 |
||
1185 |
super update:something with:aParameter from:changedObject |
|
1186 |
||
1187 |
"Modified: / 18-04-2011 / 18:17:14 / cg" |
|
1188 |
! |
|
1189 |
||
1190 |
updateConnectEnableHolders |
|
1191 |
self storeConnectEnabled |
|
1192 |
value:(storeHostnameHolder value notEmptyOrNil |
|
1193 |
and:[ storeUsernameHolder value notEmptyOrNil |
|
1194 |
and:[ storePasswordHolder value notEmptyOrNil ]]). |
|
1195 |
||
1196 |
self storeConnectInModuleEnabled |
|
1197 |
value:(perStoreModuleHostnameHolder value notEmptyOrNil |
|
1198 |
and:[ perStoreModuleUsernameHolder value notEmptyOrNil |
|
1199 |
and:[ perStoreModulePasswordHolder value notEmptyOrNil ]]). |
|
1200 |
! ! |
|
1201 |
||
1202 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'help'! |
|
1203 |
||
1204 |
helpFilename |
|
1205 |
^ 'Launcher/cvsSetup.html' |
|
1206 |
! ! |
|
1207 |
||
1208 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'initialization & release'! |
|
1209 |
||
1210 |
initialize |
|
1211 |
(AbstractSourceCodeManager notNil) ifTrue:[ AbstractSourceCodeManager autoload ]. |
|
1212 |
||
1213 |
useManager := false asValue. |
|
1214 |
useManager onChangeSend:#updateModifiedChannel to:self. |
|
1215 |
||
1216 |
sourceCacheDir := nil asValue. |
|
1217 |
sourceCacheDir addDependent:self. |
|
1218 |
||
1219 |
repositoryHolder := '' asValue. |
|
1220 |
rootsPerModule := Dictionary new. |
|
1221 |
||
1222 |
(Array with:StoreSourceCodeManager) "self availableManagers" do:[:eachManager | |
|
1223 |
eachManager repositoryInfoPerModule |
|
1224 |
keysAndValuesDo:[:module :info | |
|
1225 |
module withoutSeparators ~= module ifTrue:[ |
|
1226 |
self halt:'should not happen any longer' |
|
1227 |
]. |
|
1228 |
rootsPerModule at:module put:(Array with:eachManager with:info) |
|
1229 |
]. |
|
1230 |
]. |
|
1231 |
||
1232 |
super initialize. |
|
1233 |
||
1234 |
"Modified: / 18-04-2011 / 18:38:02 / cg" |
|
1235 |
! ! |
|
1236 |
||
1237 |
!StoreSourceCodeManagementSettingsAppl methodsFor:'queries'! |
|
1238 |
||
1239 |
cvsRootFromCVSRootFileOrNil |
|
1240 |
|cvsDir cvsRootFile cvsRoot| |
|
1241 |
||
1242 |
cvsDir := 'CVS' asFilename. |
|
1243 |
cvsDir isDirectory ifTrue:[ |
|
1244 |
cvsRootFile := cvsDir construct:'Root'. |
|
1245 |
cvsRootFile isReadable ifTrue:[ |
|
1246 |
cvsRoot := cvsRootFile contents firstIfEmpty:nil. |
|
1247 |
]. |
|
1248 |
]. |
|
1249 |
^ cvsRoot |
|
1250 |
! |
|
1251 |
||
1252 |
hasManager |
|
1253 |
"true if ANY source code management class is available" |
|
1254 |
||
1255 |
^ AbstractSourceCodeManager notNil and:[AbstractSourceCodeManager isLoaded] |
|
1256 |
! |
|
1257 |
||
1258 |
hasUnsavedChanges |
|
1259 |
((StoreSourceCodeManager cacheDirectoryName ? '') ~= (self sourceCacheDir value ? '')) ifTrue:[^ true]. |
|
1260 |
||
1261 |
(Array with:StoreSourceCodeManager) "self availableManagers" do:[:mgr | |
|
1262 |
|modules| |
|
1263 |
||
1264 |
modules := rootsPerModule select:[:entry | entry first == mgr]. |
|
1265 |
||
1266 |
mgr repositoryInfoPerModule keysAndValuesDo:[:module :info | |
|
1267 |
((modules includesKey:module) and:[info = (modules at:module) second]) |
|
1268 |
ifFalse:[^ true]. |
|
1269 |
]. |
|
1270 |
modules keysAndValuesDo:[:module :info| |
|
1271 |
((mgr repositoryInfoPerModule includesKey:module) and:[(mgr repositoryInfoPerModule at:module) = info second]) |
|
1272 |
ifFalse:[^ true]. |
|
1273 |
]. |
|
1274 |
]. |
|
1275 |
||
1276 |
((StoreSourceCodeManager hostAndDBName ? '') ~= (self storeHostnameHolder value ? '') withoutSeparators) |
|
1277 |
ifTrue:[^ true]. |
|
1278 |
((StoreSourceCodeManager userName ? '') ~= (self storeUsernameHolder value ? '') withoutSeparators) |
|
1279 |
ifTrue:[^ true]. |
|
1280 |
((StoreSourceCodeManager password ? '') ~= (self storePasswordHolder value ? '') withoutSeparators) |
|
1281 |
ifTrue:[^ true]. |
|
1282 |
||
1283 |
^ false |
|
1284 |
||
1285 |
"Modified: / 18-04-2011 / 18:32:21 / cg" |
|
1286 |
! ! |
|
1287 |
||
1288 |
!StoreSourceCodeManagementSettingsAppl class methodsFor:'documentation'! |
|
1289 |
||
1290 |
version_CVS |
|
10031 | 1291 |
^ '$Header: /cvs/stx/stx/libtool/StoreSourceCodeManagementSettingsAppl.st,v 1.4 2011-07-01 15:00:21 cg Exp $' |
1292 |
! |
|
1293 |
||
1294 |
version_SVN |
|
1295 |
^ '§Id§' |
|
9824 | 1296 |
! ! |