author | Claus Gittinger <cg@exept.de> |
Fri, 25 Nov 2011 15:25:45 +0100 | |
changeset 923 | ac7536589a25 |
parent 920 | 26b894d9cc79 |
child 927 | 99a7de38fdc3 |
permissions | -rw-r--r-- |
635 | 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:libsvn' }" |
|
27 |
||
28 |
"{ NameSpace: SVN }" |
|
29 |
||
30 |
AbstractSettingsApplication subclass:#ConfigurationApp |
|
923 | 31 |
instanceVariableNames:'currentProfileHolder availableProfilesHolder svnConfigurations2 |
32 |
svnCurrentConfiguration configurationSelectedHolder |
|
33 |
newConfigurationCount' |
|
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
category:'SVN-UI-Configuration' |
|
635 | 37 |
! |
38 |
||
39 |
!ConfigurationApp class methodsFor:'documentation'! |
|
40 |
||
41 |
copyright |
|
42 |
" |
|
43 |
Copyright (c) 2007-2010 Jan Vrany |
|
44 |
Copyright (c) 2009-2010 eXept Software AG |
|
45 |
||
46 |
Permission is hereby granted, free of charge, to any person |
|
47 |
obtaining a copy of this software and associated documentation |
|
48 |
files (the 'Software'), to deal in the Software without |
|
49 |
restriction, including without limitation the rights to use, |
|
50 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
51 |
copies of the Software, and to permit persons to whom the |
|
52 |
Software is furnished to do so, subject to the following |
|
53 |
conditions: |
|
54 |
||
55 |
The above copyright notice and this permission notice shall be |
|
56 |
included in all copies or substantial portions of the Software. |
|
57 |
||
58 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
59 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
60 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
61 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
62 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
63 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
64 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
65 |
OTHER DEALINGS IN THE SOFTWARE. |
|
66 |
||
67 |
" |
|
68 |
! ! |
|
69 |
||
70 |
!ConfigurationApp class methodsFor:'help specs'! |
|
71 |
||
72 |
flyByHelpSpec |
|
73 |
||
74 |
<resource: #help> |
|
75 |
||
76 |
^self helpSpec |
|
77 |
||
78 |
"Created: / 26-05-2008 / 14:25:31 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
79 |
! |
|
80 |
||
81 |
helpSpec |
|
82 |
"This resource specification was automatically generated |
|
83 |
by the UIHelpTool of ST/X." |
|
84 |
||
85 |
"Do not manually edit this!! If it is corrupted, |
|
86 |
the UIHelpTool may not be able to read the specification." |
|
87 |
||
88 |
" |
|
89 |
UIHelpTool openOnClass:SVN::SettingsApp |
|
90 |
" |
|
91 |
||
92 |
<resource: #help> |
|
93 |
||
94 |
^ super helpSpec addPairsFrom:#( |
|
95 |
||
96 |
#Package |
|
97 |
'' |
|
98 |
||
99 |
) |
|
100 |
||
101 |
"Modified: / 26-05-2008 / 14:24:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
102 |
! ! |
|
103 |
||
104 |
!ConfigurationApp class methodsFor:'image specs'! |
|
105 |
||
106 |
defaultIcon |
|
107 |
||
108 |
^SVN::IconLibrary svn_wizban2 magnifiedTo: 24@24 |
|
109 |
||
110 |
"Created: / 26-05-2008 / 14:55:55 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
111 |
! |
|
112 |
||
113 |
svnIcon |
|
114 |
^ IconLibrary svn_wizban |
|
115 |
||
116 |
"Created: / 24-05-2008 / 01:44:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
117 |
! ! |
|
118 |
||
119 |
!ConfigurationApp class methodsFor:'interface opening'! |
|
120 |
||
121 |
open |
|
122 |
||
123 |
| settingsApp | |
|
124 |
||
125 |
settingsApp := SettingsDialog new. |
|
126 |
settingsApp addApplClass:self fullName |
|
127 |
withName:'Subversion'. |
|
128 |
settingsApp showRoot: false. |
|
129 |
settingsApp selectedItem value: |
|
130 |
(settingsApp applicationList root children anyOne). |
|
131 |
settingsApp open. |
|
132 |
||
133 |
"Created: / 26-05-2008 / 12:17:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
134 |
"Modified: / 27-02-2010 / 17:07:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
135 |
! ! |
|
136 |
||
137 |
!ConfigurationApp class methodsFor:'interface specs'! |
|
138 |
||
139 |
basicTabSpec |
|
140 |
"This resource specification was automatically generated |
|
141 |
by the UIPainter of ST/X." |
|
142 |
||
143 |
"Do not manually edit this!! If it is corrupted, |
|
144 |
the UIPainter may not be able to read the specification." |
|
145 |
||
146 |
" |
|
147 |
UIPainter new openOnClass:SVN::ConfigurationApp andSelector:#basicTabSpec |
|
148 |
SVN::ConfigurationApp new openInterface:#basicTabSpec |
|
149 |
" |
|
150 |
||
151 |
<resource: #canvas> |
|
152 |
||
153 |
^ |
|
154 |
#(FullSpec |
|
155 |
name: basicTabSpec |
|
156 |
window: |
|
157 |
(WindowSpec |
|
158 |
label: 'Basic Settings' |
|
159 |
name: 'Basic Settings' |
|
160 |
bounds: (Rectangle 0 0 611 309) |
|
161 |
) |
|
162 |
component: |
|
163 |
(SpecCollection |
|
164 |
collection: ( |
|
165 |
(VerticalPanelViewSpec |
|
166 |
name: 'GeneralSettingsPanel' |
|
167 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
168 |
horizontalLayout: fit |
|
169 |
verticalLayout: top |
|
170 |
horizontalSpace: 3 |
|
171 |
verticalSpace: 3 |
|
172 |
component: |
|
173 |
(SpecCollection |
|
174 |
collection: ( |
|
175 |
(MultiColumnPanelViewSpec |
|
176 |
name: 'Grid' |
|
177 |
horizontalLayout: fit |
|
178 |
verticalLayout: top |
|
179 |
columnWidths: |
|
180 |
(OrderedCollection |
|
181 |
0.25 0.7 |
|
182 |
) |
|
183 |
component: |
|
184 |
(SpecCollection |
|
185 |
collection: ( |
|
186 |
(LabelSpec |
|
187 |
label: 'Working Copy:' |
|
188 |
name: 'WorkingCopyBaseLabel' |
|
189 |
translateLabel: true |
|
190 |
adjust: leftRight |
|
191 |
extent: (Point 154 25) |
|
192 |
) |
|
193 |
(FilenameInputFieldSpec |
|
194 |
name: 'WorkingCopyBase' |
|
195 |
enableChannel: svnEnabled |
|
196 |
model: workingCopyBaseAspect |
|
197 |
modifiedChannel: modifiedChannel |
|
198 |
acceptOnPointerLeave: false |
|
199 |
extent: (Point 454 25) |
|
200 |
viewClassName: 'FilenameWidgetWithHistory' |
|
201 |
postBuildCallback: postBuildWorkingCopyField: |
|
202 |
) |
|
203 |
) |
|
204 |
||
205 |
) |
|
206 |
useDefaultExtent: true |
|
207 |
) |
|
208 |
(DividerSpec |
|
209 |
name: 'Separator' |
|
210 |
extent: (Point 611 5) |
|
211 |
) |
|
212 |
(CheckBoxSpec |
|
213 |
label: 'Verbose (Traces svn commands to Transcript)' |
|
214 |
name: 'Verbose' |
|
215 |
enableChannel: svnEnabled |
|
216 |
model: svnVerbose |
|
217 |
translateLabel: true |
|
218 |
useDefaultExtent: true |
|
219 |
) |
|
220 |
) |
|
221 |
||
222 |
) |
|
223 |
) |
|
224 |
) |
|
225 |
||
226 |
) |
|
227 |
) |
|
228 |
! |
|
229 |
||
230 |
profilesTabSpec |
|
231 |
"This resource specification was automatically generated |
|
232 |
by the UIPainter of ST/X." |
|
233 |
||
234 |
"Do not manually edit this!! If it is corrupted, |
|
235 |
the UIPainter may not be able to read the specification." |
|
236 |
||
237 |
" |
|
238 |
UIPainter new openOnClass:SVN::ConfigurationApp andSelector:#profilesTabSpec |
|
239 |
SVN::ConfigurationApp new openInterface:#profilesTabSpec |
|
240 |
" |
|
241 |
||
242 |
<resource: #canvas> |
|
243 |
||
244 |
^ |
|
245 |
#(FullSpec |
|
246 |
name: profilesTabSpec |
|
247 |
window: |
|
248 |
(WindowSpec |
|
249 |
label: 'Profiles' |
|
250 |
name: 'Profiles' |
|
251 |
min: (Point 10 10) |
|
252 |
bounds: (Rectangle 0 0 782 552) |
|
253 |
) |
|
254 |
component: |
|
255 |
(SpecCollection |
|
256 |
collection: ( |
|
257 |
(LabelSpec |
|
258 |
label: 'Current profile:' |
|
259 |
name: 'CurrentProfileLabel' |
|
260 |
layout: (LayoutFrame 0 0 0 0 102 0 30 0) |
|
261 |
translateLabel: true |
|
262 |
adjust: leftRight |
|
263 |
useDynamicPreferredWidth: true |
|
264 |
usePreferredWidth: true |
|
265 |
) |
|
266 |
(ComboListSpec |
|
267 |
name: 'CurrentConfiguration' |
|
268 |
layout: (LayoutFrame 103 0 3 0 0 1 28 0) |
|
269 |
model: svnCurrentConfiguration |
|
270 |
comboList: svnConfigurations2 |
|
271 |
useIndex: false |
|
272 |
) |
|
273 |
(DividerSpec |
|
274 |
name: 'Separator1' |
|
275 |
layout: (LayoutFrame 0 0 30 0 0 1 35 0) |
|
276 |
) |
|
277 |
(LabelSpec |
|
278 |
label: 'Available profiles:' |
|
279 |
name: 'AvailableProfiles' |
|
280 |
layout: (LayoutFrame 0 0 35 0 0 1 65 0) |
|
281 |
translateLabel: true |
|
282 |
adjust: left |
|
283 |
) |
|
284 |
(SelectionInListModelViewSpec |
|
285 |
name: 'ProfileList' |
|
286 |
layout: (LayoutFrame 0 0 65 0 -100 1 0 1) |
|
287 |
model: selectedProfileIndexHolder |
|
288 |
hasHorizontalScrollBar: true |
|
289 |
hasVerticalScrollBar: true |
|
290 |
listModel: svnConfigurations2 |
|
291 |
highlightMode: line |
|
292 |
doubleClickSelector: doConfigurationEdit |
|
293 |
) |
|
294 |
(VerticalPanelViewSpec |
|
295 |
name: 'Buttons1' |
|
296 |
layout: (LayoutFrame -95 1 65 0 0 1 0 0.7) |
|
297 |
horizontalLayout: fit |
|
298 |
verticalLayout: top |
|
299 |
horizontalSpace: 5 |
|
300 |
verticalSpace: 3 |
|
301 |
component: |
|
302 |
(SpecCollection |
|
303 |
collection: ( |
|
304 |
(ActionButtonSpec |
|
305 |
label: 'Add' |
|
306 |
name: 'ButtonAdd' |
|
307 |
translateLabel: true |
|
308 |
model: doConfigurationAdd |
|
309 |
extent: (Point 95 22) |
|
310 |
) |
|
311 |
(ActionButtonSpec |
|
312 |
label: 'Remove' |
|
313 |
name: 'ButtonRemove' |
|
314 |
translateLabel: true |
|
315 |
model: doConfigurationRemove |
|
316 |
enableChannel: configurationSelectedHolder |
|
317 |
extent: (Point 95 22) |
|
318 |
) |
|
319 |
(ActionButtonSpec |
|
320 |
label: 'Edit' |
|
321 |
name: 'ButtonEdit' |
|
322 |
translateLabel: true |
|
323 |
model: doConfigurationEdit |
|
324 |
enableChannel: configurationSelectedHolder |
|
325 |
extent: (Point 95 22) |
|
326 |
) |
|
327 |
) |
|
328 |
||
329 |
) |
|
330 |
) |
|
331 |
(VerticalPanelViewSpec |
|
332 |
name: 'Buttons2' |
|
333 |
layout: (LayoutFrame -95 1 0 0.7 0 1 0 1) |
|
334 |
horizontalLayout: fit |
|
335 |
verticalLayout: bottom |
|
336 |
horizontalSpace: 5 |
|
337 |
verticalSpace: 3 |
|
338 |
component: |
|
339 |
(SpecCollection |
|
340 |
collection: ( |
|
341 |
(ActionButtonSpec |
|
342 |
label: 'Export' |
|
343 |
name: 'Button2' |
|
344 |
translateLabel: true |
|
345 |
model: doConfigurationExport |
|
346 |
enableChannel: configurationSelectedHolder |
|
347 |
extent: (Point 95 22) |
|
348 |
) |
|
349 |
(ActionButtonSpec |
|
350 |
label: 'Import' |
|
351 |
name: 'Button3' |
|
352 |
translateLabel: true |
|
353 |
model: doConfigurationImport |
|
354 |
extent: (Point 95 22) |
|
355 |
) |
|
356 |
) |
|
357 |
||
358 |
) |
|
359 |
) |
|
360 |
) |
|
361 |
||
362 |
) |
|
363 |
) |
|
364 |
! |
|
365 |
||
366 |
windowSpec |
|
367 |
"This resource specification was automatically generated |
|
368 |
by the UIPainter of ST/X." |
|
369 |
||
370 |
"Do not manually edit this!! If it is corrupted, |
|
371 |
the UIPainter may not be able to read the specification." |
|
372 |
||
373 |
" |
|
374 |
UIPainter new openOnClass:SVN::ConfigurationApp andSelector:#windowSpec |
|
375 |
SVN::ConfigurationApp new openInterface:#windowSpec |
|
376 |
SVN::ConfigurationApp open |
|
377 |
" |
|
378 |
||
379 |
<resource: #canvas> |
|
380 |
||
381 |
^ |
|
382 |
#(FullSpec |
|
383 |
name: windowSpec |
|
384 |
window: |
|
385 |
(WindowSpec |
|
386 |
label: 'SubVersion Settings' |
|
387 |
name: 'SubVersion Settings' |
|
388 |
min: (Point 10 10) |
|
389 |
bounds: (Rectangle 0 0 695 627) |
|
390 |
) |
|
391 |
component: |
|
392 |
(SpecCollection |
|
393 |
collection: ( |
|
394 |
(LabelSpec |
|
395 |
label: ' Subversion Settings' |
|
396 |
name: 'SubVersionSettingsTitle' |
|
397 |
layout: (LayoutFrame 0 0 0 0 0 1 66 0) |
|
398 |
style: (FontDescription helvetica medium roman 18 #'iso10646-1') |
|
399 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
400 |
translateLabel: true |
|
401 |
adjust: left |
|
402 |
) |
|
403 |
(LabelSpec |
|
404 |
label: 'Icon' |
|
405 |
name: 'SubVersionIcon' |
|
406 |
layout: (LayoutFrame -75 1 0 0 0 1 66 0) |
|
407 |
hasCharacterOrientedLabel: false |
|
408 |
backgroundColor: (Color 100.0 100.0 100.0) |
|
409 |
translateLabel: true |
|
410 |
labelChannel: svnIcon |
|
411 |
) |
|
412 |
(VerticalPanelViewSpec |
|
413 |
name: 'Controls' |
|
414 |
layout: (LayoutFrame 0 0 70 0 0 1 0 1) |
|
415 |
horizontalLayout: fit |
|
416 |
verticalLayout: topFit |
|
417 |
horizontalSpace: 3 |
|
418 |
verticalSpace: 3 |
|
419 |
component: |
|
420 |
(SpecCollection |
|
421 |
collection: ( |
|
422 |
(HorizontalPanelViewSpec |
|
423 |
name: 'SVNEnabledAndResetPanel' |
|
424 |
horizontalLayout: rightSpaceFit |
|
425 |
verticalLayout: fit |
|
426 |
horizontalSpace: 0 |
|
427 |
verticalSpace: 3 |
|
428 |
component: |
|
429 |
(SpecCollection |
|
430 |
collection: ( |
|
431 |
(CheckBoxSpec |
|
432 |
label: 'Enable SubVersion Manager' |
|
433 |
name: 'Enabled' |
|
434 |
model: svnEnabled |
|
435 |
translateLabel: true |
|
436 |
extent: (Point 521 30) |
|
437 |
) |
|
438 |
(ActionButtonSpec |
|
439 |
label: 'Reset cached repositories' |
|
440 |
name: 'ResetCachedRepositoriesButton' |
|
441 |
translateLabel: true |
|
442 |
model: resetCachedRepositories |
|
443 |
enableChannel: svnEnabled |
|
444 |
extent: (Point 175 30) |
|
445 |
) |
|
446 |
) |
|
447 |
||
448 |
) |
|
449 |
extent: (Point 695 30) |
|
450 |
) |
|
451 |
(NoteBookViewSpec |
|
452 |
name: 'NoteBook' |
|
453 |
menu: tabList |
|
454 |
useDefaultExtent: true |
|
455 |
) |
|
456 |
) |
|
457 |
||
458 |
) |
|
459 |
) |
|
460 |
) |
|
461 |
||
462 |
) |
|
463 |
) |
|
464 |
! ! |
|
465 |
||
466 |
!ConfigurationApp class methodsFor:'list specs'! |
|
467 |
||
468 |
tabList |
|
469 |
"This resource specification was automatically generated |
|
470 |
by the TabListEditor of ST/X." |
|
471 |
||
472 |
"Do not manually edit this!! If it is corrupted, |
|
473 |
the TabListEditor may not be able to read the specification." |
|
474 |
||
475 |
" |
|
476 |
TabListEditor new openOnClass: self andSelector:#tabList |
|
477 |
" |
|
478 |
||
479 |
<resource: #tabList> |
|
480 |
||
481 |
^ #( |
|
482 |
(TabItem |
|
483 |
label: 'Profiles' |
|
484 |
minorKey: profilesTabSpec |
|
485 |
createNewBuilder: false |
|
486 |
) |
|
487 |
(TabItem |
|
488 |
label: 'Settings' |
|
489 |
minorKey: basicTabSpec |
|
490 |
createNewBuilder: false |
|
491 |
) |
|
492 |
) |
|
493 |
||
494 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
495 |
! ! |
|
496 |
||
497 |
!ConfigurationApp class methodsFor:'queries'! |
|
498 |
||
499 |
managerTypeName |
|
500 |
||
501 |
^SVNSourceCodeManager managerTypeName |
|
502 |
||
503 |
"Created: / 07-07-2011 / 23:13:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
504 |
! ! |
|
505 |
||
506 |
!ConfigurationApp class methodsFor:'tableColumns specs'! |
|
507 |
||
508 |
configurationListColumns |
|
509 |
"This resource specification was automatically generated |
|
510 |
by the DataSetBuilder of ST/X." |
|
511 |
||
512 |
"Do not manually edit this!! If it is corrupted, |
|
513 |
the DataSetBuilder may not be able to read the specification." |
|
514 |
||
515 |
" |
|
516 |
DataSetBuilder new openOnClass:SVN::SettingsApp andSelector:#configurationListColumns |
|
517 |
" |
|
518 |
||
519 |
<resource: #tableColumns> |
|
520 |
||
521 |
^#( |
|
522 |
(DataSetColumnSpec |
|
523 |
activeHelpKey: '' |
|
524 |
labelButtonType: Button |
|
525 |
rendererType: rowSelector |
|
526 |
showRowSeparator: false |
|
527 |
showColSeparator: false |
|
528 |
) |
|
529 |
(DataSetColumnSpec |
|
530 |
label: 'Package' |
|
531 |
labelAlignment: left |
|
532 |
activeHelpKey: '' |
|
533 |
labelButtonType: Button |
|
534 |
model: package |
|
535 |
canSelect: false |
|
536 |
showRowSeparator: false |
|
537 |
showColSeparator: false |
|
538 |
) |
|
539 |
(DataSetColumnSpec |
|
540 |
label: 'URL' |
|
541 |
labelAlignment: left |
|
542 |
activeHelpKey: '' |
|
543 |
labelButtonType: Button |
|
544 |
model: urlString |
|
545 |
canSelect: false |
|
546 |
showRowSeparator: false |
|
547 |
showColSeparator: false |
|
548 |
) |
|
549 |
) |
|
550 |
||
551 |
"Modified: / 16-08-2009 / 17:28:28 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
552 |
! ! |
|
553 |
||
554 |
!ConfigurationApp methodsFor:'accessing'! |
|
555 |
||
556 |
repositoryConfiguration |
|
557 |
||
789
241a6bd83db1
comment/format in: #repositoryConfiguration
Claus Gittinger <cg@exept.de>
parents:
635
diff
changeset
|
558 |
^ self repositoryConfigurationAspect value |
635 | 559 |
|
560 |
"Created: / 26-05-2008 / 12:04:54 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
789
241a6bd83db1
comment/format in: #repositoryConfiguration
Claus Gittinger <cg@exept.de>
parents:
635
diff
changeset
|
561 |
"Modified (format): / 19-08-2011 / 12:57:10 / cg" |
635 | 562 |
! |
563 |
||
564 |
repositoryConfiguration: anObject |
|
565 |
||
566 |
self repositoryConfigurationAspect value: anObject |
|
567 |
||
568 |
"Created: / 26-05-2008 / 12:12:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
569 |
! |
|
570 |
||
571 |
repositoryConfigurationList |
|
572 |
||
573 |
^self repositoryConfigurationListAspect value |
|
574 |
||
575 |
"Created: / 26-05-2008 / 12:05:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
576 |
! |
|
577 |
||
578 |
repositoryManager |
|
579 |
||
580 |
^RepositoryManager current |
|
581 |
||
582 |
"Created: / 26-05-2008 / 10:46:30 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
583 |
! |
|
584 |
||
585 |
selectedConfiguration |
|
586 |
||
587 |
| index config | |
|
588 |
(index := self selectedProfileIndexHolder value) ifNil:[^self]. |
|
589 |
config := self svnConfigurations2 value at: index. |
|
590 |
^config |
|
591 |
||
592 |
"Created: / 25-03-2010 / 16:44:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
593 |
! |
|
594 |
||
595 |
workingCopyBase |
|
596 |
||
597 |
^self workingCopyBaseAspect value |
|
598 |
||
599 |
"Created: / 26-05-2008 / 13:15:22 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
600 |
! ! |
|
601 |
||
602 |
!ConfigurationApp methodsFor:'actions'! |
|
603 |
||
604 |
doConfigurationAdd |
|
605 |
<resource: #uiCallback> |
|
606 |
|config| |
|
607 |
||
608 |
config := SVN::Configuration new. |
|
609 |
config name:((newConfigurationCount == 0) |
|
610 |
ifTrue:[ '<new profile>' ] |
|
611 |
ifFalse:[ '<new profile %1>' bindWith:newConfigurationCount ]). |
|
612 |
(self doConfigurationEdit:config) ifTrue:[ |
|
613 |
self doConfigurationAdd:config. |
|
614 |
newConfigurationCount := newConfigurationCount + 1. |
|
615 |
]. |
|
616 |
||
617 |
"Modified: / 26-03-2010 / 20:34:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
618 |
! |
|
619 |
||
620 |
doConfigurationAdd:config |
|
621 |
self svnConfigurations2 |
|
622 |
value:(self svnConfigurations2 value copyWith:config). |
|
623 |
self selectedProfileIndexHolder value:self svnConfigurations2 value size. |
|
624 |
self updateModifiedChannel. |
|
625 |
||
626 |
"Modified: / 26-03-2010 / 20:38:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
627 |
! |
|
628 |
||
629 |
doConfigurationEdit |
|
630 |
||
631 |
| config | |
|
632 |
||
633 |
(config := self selectedConfiguration) ifNil:[^self]. |
|
634 |
self doConfigurationEdit: config. |
|
635 |
||
636 |
"Modified: / 25-03-2010 / 16:45:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
637 |
! |
|
638 |
||
639 |
doConfigurationEdit: config |
|
640 |
||
641 |
^(ConfigurationDialog openOn: config) |
|
642 |
ifTrue: |
|
790 | 643 |
[self svnCurrentConfiguration value: |
644 |
(svnConfigurations2 value |
|
645 |
detect:[:c|c name = self svnCurrentConfiguration value name]). |
|
635 | 646 |
self updateModifiedChannel. |
647 |
true] |
|
648 |
ifFalse: |
|
649 |
[false] |
|
650 |
||
651 |
"Created: / 25-03-2010 / 08:28:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
790 | 652 |
"Modified: / 19-08-2011 / 12:04:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
635 | 653 |
! |
654 |
||
655 |
doConfigurationExport |
|
656 |
||
657 |
| config name s | |
|
658 |
config := self selectedConfiguration. |
|
659 |
name := (Smalltalk::Dialog |
|
660 |
requestFileName:'Enter a filename' |
|
661 |
default: (config name) , '.rc' |
|
662 |
ifFail:[^self]) asFilename. |
|
663 |
[s := name writeStream. |
|
664 |
config literalArrayEncoding storeOn: s] |
|
665 |
ensure:[s close]. |
|
666 |
||
667 |
"Modified: / 26-03-2010 / 20:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
668 |
! |
|
669 |
||
670 |
doConfigurationImport |
|
671 |
||
672 |
| config name | |
|
673 |
config := self selectedConfiguration. |
|
674 |
name := (Smalltalk::Dialog |
|
675 |
requestFileName:'Enter a filename' |
|
676 |
pattern: '*.rc'). |
|
677 |
name isNilOrEmptyCollection ifTrue:[^self]. |
|
678 |
name := name asFilename. |
|
679 |
[ |
|
680 |
config := Compiler evaluate: name contents asString. |
|
681 |
config := config decodeAsLiteralArray. |
|
682 |
(config isKindOf: SVN::Configuration) ifFalse: |
|
683 |
[self error:'File does not contain serialized SVN configuration']. |
|
684 |
self doConfigurationAdd: config. |
|
685 |
] on: Smalltalk::Error do: |
|
686 |
[:ex| |
|
687 |
Smalltalk::Dialog warn: |
|
688 |
('Failed to read profile from %1' bindWith: name asString). |
|
689 |
ex pass. |
|
690 |
] |
|
691 |
||
692 |
"Modified: / 26-03-2010 / 20:36:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
693 |
! |
|
694 |
||
695 |
doConfigurationRemove |
|
696 |
||
697 |
| config | |
|
698 |
||
699 |
(config := self selectedConfiguration) ifNil:[^self]. |
|
700 |
self svnConfigurations2 value: (self svnConfigurations2 value copyWithout: config). |
|
701 |
self updateModifiedChannel. |
|
702 |
||
703 |
"Modified: / 26-03-2010 / 20:39:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
704 |
! |
|
705 |
||
706 |
postBuildWorkingCopyField: aView |
|
707 |
||
708 |
aView |
|
709 |
directoriesOnly: true; |
|
710 |
historyList: Smalltalk packagePath |
|
711 |
||
712 |
"Modified: / 27-11-2009 / 13:02:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
713 |
! |
|
714 |
||
715 |
resetCachedRepositories |
|
716 |
||
717 |
RepositoryManager reset |
|
718 |
||
719 |
"Created: / 20-03-2009 / 10:30:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
720 |
"Modified: / 02-04-2009 / 22:53:19 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
721 |
! ! |
|
722 |
||
723 |
!ConfigurationApp methodsFor:'aspects'! |
|
724 |
||
725 |
aspects |
|
726 |
^ #( #svnEnabled #svnVerbose svnCurrentConfiguration) |
|
727 |
||
728 |
"Modified: / 31-03-2011 / 14:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
729 |
! |
|
730 |
||
731 |
configurationSelectedHolder |
|
732 |
"return/create the valueHolder 'repositorySelectedHolder'" |
|
733 |
||
734 |
configurationSelectedHolder isNil ifTrue:[ |
|
735 |
configurationSelectedHolder := |
|
736 |
BlockValue |
|
737 |
with:[:model|model value notNil and:[model value ~= 0]] |
|
738 |
argument: self selectedProfileIndexHolder |
|
739 |
]. |
|
740 |
^ configurationSelectedHolder |
|
741 |
||
742 |
"Created: / 25-03-2010 / 08:27:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
743 |
! |
|
744 |
||
745 |
selectedProfileIndexHolder |
|
746 |
||
747 |
|holder| |
|
748 |
||
749 |
(holder := builder bindingAt:#selectedProfileIndexHolder) isNil ifTrue:[ |
|
750 |
holder := ValueHolder new. |
|
751 |
builder aspectAt:#selectedProfileIndexHolder put:holder. |
|
752 |
]. |
|
753 |
^ holder. |
|
754 |
||
755 |
"Created: / 09-03-2010 / 13:30:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
756 |
! |
|
757 |
||
758 |
svnConfigurations2 |
|
759 |
<resource: #uiAspect> |
|
760 |
||
761 |
"automatically generated by UIPainter ..." |
|
762 |
||
763 |
"*** the code below creates a default model when invoked." |
|
764 |
"*** (which may not be the one you wanted)" |
|
765 |
"*** Please change as required and accept it in the browser." |
|
766 |
"*** (and replace this comment by something more useful ;-)" |
|
767 |
||
768 |
svnConfigurations2 isNil ifTrue:[ |
|
769 |
svnConfigurations2 := ValueHolder new. |
|
770 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
771 |
"/ svnConfigurations2 addDependent:self. |
|
772 |
"/ svnConfigurations2 onChangeSend:#svnConfigurations2Changed to:self. |
|
773 |
]. |
|
774 |
^ svnConfigurations2. |
|
775 |
! |
|
776 |
||
777 |
svnCurrentConfiguration |
|
778 |
^self settingsAspectFor: #svnCurrentConfiguration |
|
779 |
||
780 |
"Modified: / 31-03-2011 / 14:01:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
781 |
! |
|
782 |
||
783 |
svnEnabled |
|
784 |
||
785 |
^self settingsAspectFor: #svnEnabled |
|
786 |
||
787 |
"Created: / 25-05-2009 / 18:48:17 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
788 |
! |
|
789 |
||
790 |
svnIcon |
|
791 |
||
792 |
^self class svnIcon |
|
793 |
||
794 |
"Created: / 24-05-2008 / 01:44:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
795 |
! |
|
796 |
||
797 |
svnVerbose |
|
798 |
||
799 |
^self settingsAspectFor: #svnVerbose |
|
800 |
||
801 |
"Created: / 25-05-2009 / 19:10:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
802 |
! |
|
803 |
||
804 |
tabList |
|
805 |
"Generated by the TabListEditor" |
|
806 |
||
807 |
|list| |
|
808 |
||
809 |
(list := builder bindingAt:#tabList) isNil ifTrue:[ |
|
810 |
builder aspectAt:#tabList put:(list := self class tabList). |
|
811 |
]. |
|
812 |
^ list |
|
813 |
! |
|
814 |
||
815 |
workingCopyBaseAspect |
|
816 |
||
817 |
|holder| |
|
818 |
||
819 |
(holder := builder bindingAt:#workingCopyBaseAspect) ifNil:[ |
|
820 |
holder := self repositoryManager workingCopyBase asValue. |
|
821 |
holder onChangeSend:#updateModifiedChannel to:self. |
|
822 |
builder aspectAt:#workingCopyBaseAspect put: holder |
|
823 |
]. |
|
824 |
^ holder. |
|
825 |
||
826 |
"Created: / 26-05-2008 / 10:41:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
827 |
"Modified: / 25-05-2009 / 18:50:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
828 |
! ! |
|
829 |
||
830 |
!ConfigurationApp methodsFor:'helpers'! |
|
831 |
||
832 |
settingsAspectFor: settingName |
|
833 |
||
834 |
|holder| |
|
835 |
||
836 |
self createBuilder. |
|
837 |
||
838 |
(holder := builder bindingAt:settingName) ifNil: |
|
839 |
[holder := (currentUserPrefs perform: settingName asSymbol) |
|
840 |
asValue. |
|
841 |
holder onChangeSend:#updateModifiedChannel to:self. |
|
842 |
builder aspectAt:settingName put:holder |
|
843 |
]. |
|
844 |
^ holder. |
|
845 |
||
846 |
"Created: / 25-05-2009 / 18:43:42 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
847 |
! ! |
|
848 |
||
849 |
!ConfigurationApp methodsFor:'initialization'! |
|
850 |
||
851 |
initialize |
|
852 |
||
853 |
super initialize. |
|
854 |
newConfigurationCount := 1. |
|
855 |
||
856 |
"Created: / 25-03-2010 / 08:31:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
857 |
! ! |
|
858 |
||
859 |
!ConfigurationApp methodsFor:'protocol'! |
|
860 |
||
861 |
basicReadSettings |
|
862 |
||
863 |
| confs | |
|
864 |
||
865 |
self readAspects: self aspects from:currentUserPrefs. |
|
866 |
self svnConfigurations2 value: (confs := SVN::Configuration configurations deepCopy asList). |
|
867 |
||
868 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
869 |
"Modified: / 25-05-2009 / 19:05:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
870 |
"Modified: / 31-03-2011 / 14:17:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
871 |
! |
|
872 |
||
873 |
basicSaveSettings |
|
874 |
||
875 |
self writeAspects: self aspects to:currentUserPrefs. |
|
876 |
SVN::Configuration configurations: self svnConfigurations2 value. |
|
877 |
self resetCachedRepositories |
|
878 |
||
879 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
880 |
"Modified: / 25-05-2009 / 19:06:45 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
881 |
"Modified: / 31-03-2011 / 14:11:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
882 |
! |
|
883 |
||
884 |
helpFilename |
|
885 |
"subclasses must return the relative name of a helpFile |
|
886 |
in the doc/online/<language>/help directory. |
|
887 |
Or nil, if no help is available." |
|
888 |
||
889 |
^nil |
|
890 |
||
891 |
"Created: / 19-04-2008 / 09:42:59 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
892 |
"Modified: / 26-05-2008 / 13:12:53 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
893 |
! ! |
|
894 |
||
895 |
!ConfigurationApp methodsFor:'queries'! |
|
896 |
||
897 |
hasUnsavedChanges |
|
790 | 898 |
|
899 |
SVN::Configuration configurations asArray = svnConfigurations2 value asArray |
|
900 |
ifFalse:[^true]. |
|
923 | 901 |
^ self |
902 |
hasChangedAspectIn:self aspects |
|
903 |
asComparedTo:currentUserPrefs |
|
635 | 904 |
|
905 |
"Created: / 28-05-2008 / 07:33:26 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
906 |
"Modified: / 19-08-2009 / 12:07:01 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
790 | 907 |
"Modified: / 19-08-2011 / 11:48:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
923 | 908 |
"Modified: / 25-11-2011 / 15:25:06 / cg" |
635 | 909 |
! ! |
910 |
||
911 |
!ConfigurationApp class methodsFor:'documentation'! |
|
912 |
||
913 |
version |
|
914 |
^ '$Header$' |
|
790 | 915 |
|
635 | 916 |
! |
917 |
||
918 |
version_CVS |
|
919 |
^ '$Header$' |
|
790 | 920 |
|
635 | 921 |
! |
922 |
||
923 |
version_SVN |
|
891
a4f5e33dc88b
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
924 |
|
a4f5e33dc88b
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
790
diff
changeset
|
925 |
^ '§Id: SVN__ConfigurationApp.st 372 2011-09-29 10:47:58Z vranyj1 §' |
635 | 926 |
! ! |