7 inclusion of the above copyright notice. This software may not |
7 inclusion of the above copyright notice. This software may not |
8 be provided or otherwise made available to, or used by, any |
8 be provided or otherwise made available to, or used by, any |
9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 "{ Package: 'stx:libtool' }" |
|
13 |
|
14 AbstractSourceCodeManagementSettingsAppl subclass:#PerforceSourceCodeManagementSettingsAppl |
12 AbstractSourceCodeManagementSettingsAppl subclass:#PerforceSourceCodeManagementSettingsAppl |
15 instanceVariableNames:'selectedPerModuleRoot perforceExecutableHolder |
13 instanceVariableNames:'selectedPerModuleRoot perforceExecutableHolder |
16 listOfPerforceModules defaultSettingsHolder tableColumns |
14 listOfPerforceModules defaultSettingsHolder tableColumns |
17 defaultSettingsPrototypeList' |
15 defaultSettingsPrototypeList' |
18 classVariableNames:'RecentlyUsedCVSRoots RecentlyUsedStoreHosts |
16 classVariableNames:'RecentlyUsedCVSRoots RecentlyUsedStoreHosts |
19 RecentlyUsedSmallTeamHosts LastStoreHost LastStoreUser |
17 RecentlyUsedSmallTeamHosts LastStoreHost LastStoreUser |
20 LastStorePassword' |
18 LastStorePassword' |
21 poolDictionaries:'' |
19 poolDictionaries:'' |
22 category:'System-SourceCodeManagement' |
20 category:'System-SourceCodeManagement' |
23 ! |
21 ! |
24 |
22 |
25 ApplicationModel subclass:#ManagerPerModuleApp |
23 ApplicationModel subclass:#ManagerPerModuleApp |
26 instanceVariableNames:'moduleHolder acceptChannel settingsHolder |
24 instanceVariableNames:'moduleHolder acceptChannel settingsHolder |
27 sourceCodeManagementSettingsApp acceptEnableChannel canceled |
25 sourceCodeManagementSettingsApp acceptEnableChannel canceled |
28 defaultSettingsPrototypeList' |
26 defaultSettingsPrototypeList' |
29 classVariableNames:'' |
27 classVariableNames:'' |
30 poolDictionaries:'' |
28 poolDictionaries:'' |
31 privateIn:PerforceSourceCodeManagementSettingsAppl |
29 privateIn:PerforceSourceCodeManagementSettingsAppl |
32 ! |
30 ! |
33 |
31 |
34 Object subclass:#ModuleManager |
32 Object subclass:#ModuleManager |
35 instanceVariableNames:'manager module settings app' |
33 instanceVariableNames:'manager module settings app check checkIcon' |
36 classVariableNames:'' |
34 classVariableNames:'' |
37 poolDictionaries:'' |
35 poolDictionaries:'' |
38 privateIn:PerforceSourceCodeManagementSettingsAppl |
36 privateIn:PerforceSourceCodeManagementSettingsAppl |
39 ! |
37 ! |
40 |
38 |
41 !PerforceSourceCodeManagementSettingsAppl class methodsFor:'documentation'! |
39 !PerforceSourceCodeManagementSettingsAppl class methodsFor:'documentation'! |
42 |
40 |
43 copyright |
41 copyright |
214 (SpecCollection |
212 (SpecCollection |
215 collection: ( |
213 collection: ( |
216 (CheckBoxSpec |
214 (CheckBoxSpec |
217 label: 'Show in Browser Menus' |
215 label: 'Show in Browser Menus' |
218 name: 'CheckBox1' |
216 name: 'CheckBox1' |
219 layout: (LayoutFrame 0 0 5 0 0 1 27 0) |
217 layout: (LayoutFrame 0 0 5 0 -150 1 27 0) |
|
218 activeHelpKey: shownInBrowserMenus |
220 model: shownInBrowserMenusHolder |
219 model: shownInBrowserMenusHolder |
221 activeHelpKey: shownInBrowserMenus |
|
222 translateLabel: true |
220 translateLabel: true |
|
221 ) |
|
222 (ActionButtonSpec |
|
223 label: 'Check' |
|
224 name: 'Button6' |
|
225 layout: (LayoutFrame -150 1 5 0 -5 1 27 0) |
|
226 translateLabel: true |
|
227 labelChannel: checkLabel |
|
228 model: checkPerforceSettings |
223 ) |
229 ) |
224 (ViewSpec |
230 (ViewSpec |
225 name: 'Box3' |
231 name: 'Box3' |
226 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
232 layout: (LayoutFrame 0 0 36 0 0 1 0 1) |
227 component: |
233 component: |
401 label: 'Flush Cache now' |
407 label: 'Flush Cache now' |
402 name: 'Button4' |
408 name: 'Button4' |
403 translateLabel: true |
409 translateLabel: true |
404 tabable: true |
410 tabable: true |
405 model: flushSourceCache |
411 model: flushSourceCache |
406 extent: (Point 238 22) |
412 extent: (Point 250 22) |
407 ) |
413 ) |
408 (ActionButtonSpec |
414 (ActionButtonSpec |
409 label: 'Condense Cache now' |
415 label: 'Condense Cache now' |
410 name: 'Button5' |
416 name: 'Button5' |
411 translateLabel: true |
417 translateLabel: true |
412 tabable: true |
418 tabable: true |
413 model: condenseSourceCache |
419 model: condenseSourceCache |
414 extent: (Point 239 22) |
420 extent: (Point 250 22) |
415 ) |
421 ) |
416 ) |
422 ) |
417 |
423 |
418 ) |
424 ) |
419 ) |
425 ) |
420 ) |
426 ) |
421 |
427 |
422 ) |
428 ) |
423 extent: (Point 740 95) |
429 extent: (Point 767 95) |
424 ) |
430 ) |
425 (ViewSpec |
431 (ViewSpec |
426 name: 'VerboseBox' |
432 name: 'VerboseBox' |
427 component: |
433 component: |
428 (SpecCollection |
434 (SpecCollection |
435 translateLabel: true |
441 translateLabel: true |
436 ) |
442 ) |
437 ) |
443 ) |
438 |
444 |
439 ) |
445 ) |
440 extent: (Point 740 25) |
446 extent: (Point 767 25) |
441 ) |
447 ) |
442 ) |
448 ) |
443 |
449 |
444 ) |
450 ) |
445 ) |
451 ) |
446 ) |
452 ) |
447 |
453 |
448 ) |
454 ) |
449 ) |
455 ) |
450 |
456 ! ! |
451 "Modified: / 11-01-2012 / 15:39:42 / cg" |
457 |
|
458 !PerforceSourceCodeManagementSettingsAppl class methodsFor:'menu specs'! |
|
459 |
|
460 menuPerModule |
|
461 "This resource specification was automatically generated |
|
462 by the MenuEditor of ST/X." |
|
463 |
|
464 "Do not manually edit this!! If it is corrupted, |
|
465 the MenuEditor may not be able to read the specification." |
|
466 |
|
467 |
|
468 " |
|
469 MenuEditor new openOnClass:PerforceSourceCodeManagementSettingsAppl andSelector:#menuPerModule |
|
470 (Menu new fromLiteralArrayEncoding:(PerforceSourceCodeManagementSettingsAppl menuPerModule)) startUp |
|
471 " |
|
472 |
|
473 <resource: #menu> |
|
474 |
|
475 ^ |
|
476 #(Menu |
|
477 ( |
|
478 (MenuItem |
|
479 label: 'Check' |
|
480 itemValue: checkPerforceSettings |
|
481 translateLabel: true |
|
482 ) |
|
483 ) |
|
484 nil |
|
485 nil |
|
486 ) |
452 ! ! |
487 ! ! |
453 |
488 |
454 !PerforceSourceCodeManagementSettingsAppl class methodsFor:'queries'! |
489 !PerforceSourceCodeManagementSettingsAppl class methodsFor:'queries'! |
455 |
490 |
456 managerClass |
491 managerClass |
469 |
504 |
470 "Do not manually edit this!! If it is corrupted, |
505 "Do not manually edit this!! If it is corrupted, |
471 the DataSetBuilder may not be able to read the specification." |
506 the DataSetBuilder may not be able to read the specification." |
472 |
507 |
473 " |
508 " |
474 DataSetBuilder new openOnClass:P4SourceCodeManagementSettingsAppl andSelector:#tableColumns |
509 DataSetBuilder new openOnClass:PerforceSourceCodeManagementSettingsAppl andSelector:#tableColumns |
475 " |
510 " |
476 |
511 |
477 <resource: #tableColumns> |
512 <resource: #tableColumns> |
478 |
513 |
479 ^#( |
514 ^#( |
480 (DataSetColumnSpec |
515 (DataSetColumnSpec |
481 label: 'Module' |
516 label: 'Module' |
482 labelButtonType: Button |
517 labelButtonType: Button |
483 usePreferredWidth: true |
518 usePreferredWidth: true |
|
519 width: 100 |
|
520 minWidth: 100 |
484 model: module |
521 model: module |
|
522 menuFromApplication: false |
485 ) |
523 ) |
486 (DataSetColumnSpec |
524 (DataSetColumnSpec |
487 label: 'Settings' |
525 label: 'Settings' |
488 labelButtonType: Button |
526 labelButtonType: Button |
489 editorType: InputField |
527 editorType: InputField |
490 model: settings |
528 model: settings |
|
529 menuFromApplication: false |
|
530 isResizeable: false |
|
531 ) |
|
532 (DataSetColumnSpec |
|
533 label: 'Check' |
|
534 labelButtonType: Button |
|
535 model: check |
|
536 menuFromApplication: false |
|
537 doubleClickedSelector: doubleClick |
491 isResizeable: false |
538 isResizeable: false |
492 ) |
539 ) |
493 ) |
540 ) |
494 |
541 |
495 ! ! |
542 ! ! |
496 |
543 |
497 !PerforceSourceCodeManagementSettingsAppl methodsFor:'actions'! |
544 !PerforceSourceCodeManagementSettingsAppl methodsFor:'actions'! |
498 |
545 |
499 addModule:aModuleManager |
546 addModule:aModuleManager |
532 app moduleHolder value isEmptyOrNil ifTrue:[ |
579 app moduleHolder value isEmptyOrNil ifTrue:[ |
533 self information:'Adding without module name not allowed'. |
580 self information:'Adding without module name not allowed'. |
534 ^ self. |
581 ^ self. |
535 ]. |
582 ]. |
536 moduleManager module:app moduleHolder value. |
583 moduleManager module:app moduleHolder value. |
537 moduleManager settings:app settingsHolder value. |
|
538 moduleManager settings:app settingsHolder value. |
584 moduleManager settings:app settingsHolder value. |
539 self listOfModules add:moduleManager. |
585 self listOfModules add:moduleManager. |
540 self updateModifiedChannel. |
586 self updateModifiedChannel. |
541 ]. |
587 ]. |
542 "Modified: / 08-11-2006 / 19:27:39 / cg" |
588 "Modified: / 08-11-2006 / 19:27:39 / cg" |
603 ]. |
649 ]. |
604 |
650 |
605 PerforceSourceCodeManager repositoryInfoPerModule:repositoryInfoPerModule. |
651 PerforceSourceCodeManager repositoryInfoPerModule:repositoryInfoPerModule. |
606 PerforceSourceCodeManager perforceExecutable:((self perforceExecutableHolder value ? '') withoutSeparators). |
652 PerforceSourceCodeManager perforceExecutable:((self perforceExecutableHolder value ? '') withoutSeparators). |
607 client := self defaultSettingsHolder value. |
653 client := self defaultSettingsHolder value. |
608 client notNil ifTrue:[ |
654 PerforceSourceCodeManager setDefaultPerforceSettingsFromString:client. |
609 settings := PerforceSourceCodeManager getPerforceSettingsFromString:client. |
|
610 PerforceSourceCodeManager perforceClient:(settings at:#client ifAbsent:nil). |
|
611 PerforceSourceCodeManager perforceUser:(settings at:#user ifAbsent:nil). |
|
612 PerforceSourceCodeManager perforcePort:(settings at:#port ifAbsent:nil). |
|
613 PerforceSourceCodeManager perforcePassword:(settings at:#password ifAbsent:nil). |
|
614 ]. |
|
615 PerforceSourceCodeManager verboseSourceCodeAccess:self verboseSourceCodeAccess value. |
655 PerforceSourceCodeManager verboseSourceCodeAccess:self verboseSourceCodeAccess value. |
616 PerforceSourceCodeManager shownInBrowserMenus:self shownInBrowserMenusHolder value. |
656 PerforceSourceCodeManager shownInBrowserMenus:self shownInBrowserMenusHolder value. |
617 ]. |
657 ]. |
618 |
658 |
619 self acceptChannel value. |
659 self acceptChannel value. |
620 |
660 |
621 "Modified: / 10-01-2012 / 00:21:59 / cg" |
661 "Modified: / 10-01-2012 / 00:21:59 / cg" |
|
662 ! |
|
663 |
|
664 checkPerforceSettings |
|
665 |
|
666 |result icon| |
|
667 |
|
668 PerforceSourceCodeManager perforceError handle:[:ex| |
|
669 self warn:ex description. |
|
670 ^false |
|
671 ] do:[ |
|
672 result := PerforceSourceCodeManager checkPerforceSettings:(self defaultSettingsHolder value) forPackage:nil. |
|
673 result ifTrue:[ |
|
674 icon := GenericToolbarIconLibrary ledGreen14x14. |
|
675 ] ifFalse:[ |
|
676 icon := GenericToolbarIconLibrary ledRed14x14. |
|
677 ]. |
|
678 self checkLabel value:(LabelAndIcon label:'Check' icon:icon). |
|
679 ]. |
|
680 ^false |
|
681 ! |
|
682 |
|
683 condenseSourceCache |
|
684 self withWaitCursorDo:[ AbstractSourceCodeManager condenseSourceCache ]. |
|
685 Method flushSourceStreamCache. |
|
686 |
|
687 "Modified: / 28-11-2006 / 12:21:33 / cg" |
|
688 ! |
|
689 |
|
690 flushSourceCache |
|
691 self withWaitCursorDo:[ AbstractSourceCodeManager flushSourceCache ]. |
|
692 |
|
693 "Modified: / 30-09-2011 / 13:33:51 / cg" |
622 ! |
694 ! |
623 |
695 |
624 removePerModuleRoot |
696 removePerModuleRoot |
625 |
697 |
626 |module| |
698 |module| |
630 self listOfModules remove:module ifAbsent:nil. |
702 self listOfModules remove:module ifAbsent:nil. |
631 self updateModifiedChannel. |
703 self updateModifiedChannel. |
632 ! ! |
704 ! ! |
633 |
705 |
634 !PerforceSourceCodeManagementSettingsAppl methodsFor:'aspects'! |
706 !PerforceSourceCodeManagementSettingsAppl methodsFor:'aspects'! |
|
707 |
|
708 checkLabel |
|
709 <resource: #uiAspect> |
|
710 |
|
711 "automatically generated by UIPainter ..." |
|
712 |
|
713 "*** the code below creates a default model when invoked." |
|
714 "*** (which may not be the one you wanted)" |
|
715 "*** Please change as required and accept it in the browser." |
|
716 "*** (and replace this comment by something more useful ;-)" |
|
717 |
|
718 checkLabel isNil ifTrue:[ |
|
719 checkLabel := 'Check' asValue. |
|
720 "/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
721 "/ checkLabel addDependent:self. |
|
722 "/ checkLabel onChangeSend:#checkLabelChanged to:self. |
|
723 ]. |
|
724 ^ checkLabel. |
|
725 ! |
635 |
726 |
636 defaultSettingsHolder |
727 defaultSettingsHolder |
637 |
728 |
638 defaultSettingsHolder isNil ifTrue:[ |
729 defaultSettingsHolder isNil ifTrue:[ |
639 defaultSettingsHolder := ValueHolder new. |
730 defaultSettingsHolder := ValueHolder new. |
871 |
962 |
872 "Do not manually edit this!! If it is corrupted, |
963 "Do not manually edit this!! If it is corrupted, |
873 the UIPainter may not be able to read the specification." |
964 the UIPainter may not be able to read the specification." |
874 |
965 |
875 " |
966 " |
876 UIPainter new openOnClass:P4SourceCodeManagementSettingsAppl::ManagerPerModuleApp andSelector:#windowSpec |
967 UIPainter new openOnClass:PerforceSourceCodeManagementSettingsAppl::ManagerPerModuleApp andSelector:#windowSpec |
877 P4SourceCodeManagementSettingsAppl::ManagerPerModuleApp new openInterface:#windowSpec |
968 PerforceSourceCodeManagementSettingsAppl::ManagerPerModuleApp new openInterface:#windowSpec |
878 P4SourceCodeManagementSettingsAppl::ManagerPerModuleApp open |
969 PerforceSourceCodeManagementSettingsAppl::ManagerPerModuleApp open |
879 " |
970 " |
880 |
971 |
881 <resource: #canvas> |
972 <resource: #canvas> |
882 |
973 |
883 ^ |
974 ^ |
969 extent: (Point 180 35) |
1060 extent: (Point 180 35) |
970 ) |
1061 ) |
971 (ComboBoxSpec |
1062 (ComboBoxSpec |
972 name: 'ComboBox1' |
1063 name: 'ComboBox1' |
973 model: settingsHolder |
1064 model: settingsHolder |
|
1065 immediateAccept: false |
|
1066 acceptOnLostFocus: true |
974 acceptOnPointerLeave: false |
1067 acceptOnPointerLeave: false |
975 comboList: defaultSettingsPrototypeList |
1068 comboList: defaultSettingsPrototypeList |
976 extent: (Point 465 20) |
1069 extent: (Point 465 20) |
977 ) |
1070 ) |
978 ) |
1071 ) |
1194 app notNil ifTrue:[ |
1315 app notNil ifTrue:[ |
1195 app listOfModules changed. |
1316 app listOfModules changed. |
1196 ]. |
1317 ]. |
1197 ! ! |
1318 ! ! |
1198 |
1319 |
|
1320 !PerforceSourceCodeManagementSettingsAppl::ModuleManager methodsFor:'actions'! |
|
1321 |
|
1322 doubleClick |
|
1323 |
|
1324 PerforceSourceCodeManager perforceError handle:[:ex| |
|
1325 self warn:ex description. |
|
1326 check := false. |
|
1327 ] do:[ |
|
1328 check := PerforceSourceCodeManager checkPerforceSettings:settings forPackage:module. |
|
1329 ]. |
|
1330 self changed. |
|
1331 ! ! |
|
1332 |
1199 !PerforceSourceCodeManagementSettingsAppl::ModuleManager methodsFor:'comparing'! |
1333 !PerforceSourceCodeManagementSettingsAppl::ModuleManager methodsFor:'comparing'! |
1200 |
1334 |
1201 < aModuleManager |
1335 < aModuleManager |
1202 |
1336 |
1203 ^ self module < aModuleManager module |
1337 ^ self module < aModuleManager module |