MCSettingsApp.st
branchjv
changeset 1106 3699dacedeab
parent 918 1ad5002700d8
equal deleted inserted replaced
1105:ae0f60d861ca 1106:3699dacedeab
       
     1 "
       
     2 COPYRIGHT (c) 2020 LabWare
       
     3 "
     1 "{ Package: 'stx:goodies/monticello' }"
     4 "{ Package: 'stx:goodies/monticello' }"
       
     5 
       
     6 "{ NameSpace: Smalltalk }"
     2 
     7 
     3 AbstractSettingsApplication subclass:#MCSettingsApp
     8 AbstractSettingsApplication subclass:#MCSettingsApp
     4 	instanceVariableNames:'mcRepositories selectedRepositoryHolder'
     9 	instanceVariableNames:'mcRepositories selectedRepositoryHolder'
     5 	classVariableNames:''
    10 	classVariableNames:''
     6 	poolDictionaries:''
    11 	poolDictionaries:''
     7 	category:'SCM-Monticello-St/X UI'
    12 	category:'SCM-Monticello-St/X UI'
     8 !
    13 !
     9 
    14 
       
    15 !MCSettingsApp class methodsFor:'documentation'!
       
    16 
       
    17 copyright
       
    18 "
       
    19 COPYRIGHT (c) 2020 LabWare
       
    20 
       
    21 
       
    22 "
       
    23 ! !
    10 
    24 
    11 !MCSettingsApp class methodsFor:'help specs'!
    25 !MCSettingsApp class methodsFor:'help specs'!
    12 
    26 
    13 flyByHelpSpec
    27 flyByHelpSpec
    14 
    28 
   187     "
   201     "
   188 
   202 
   189     <resource: #canvas>
   203     <resource: #canvas>
   190 
   204 
   191     ^ 
   205     ^ 
   192      #(FullSpec
   206     #(FullSpec
   193         name: windowSpec
   207        name: windowSpec
   194         window: 
   208        uuid: 'a78e4130-babb-11ea-9743-606720e43e2c'
   195        (WindowSpec
   209        window: 
   196           label: 'Monticello Settings'
   210       (WindowSpec
   197           name: 'Monticello Settings'
   211          label: 'Monticello Settings'
   198           min: (Point 10 10)
   212          name: 'Monticello Settings'
   199           bounds: (Rectangle 0 0 647 627)
   213          uuid: 'a78e4131-babb-11ea-9743-606720e43e2c'
   200         )
   214          min: (Point 10 10) bounds: (Rectangle 0 0 647 627)
   201         component: 
   215       ) component: 
   202        (SpecCollection
   216       (SpecCollection
   203           collection: (
   217          collection: (
   204            (LabelSpec
   218           (LabelSpec
   205               label: ' Monticello Settings'
   219              label: ' Monticello Settings'
   206               name: 'Title'
   220              name: 'Title'
   207               layout: (LayoutFrame 0 0 0 0 0 1 66 0)
   221              layout: (LayoutFrame 0 0 0 0 0 1 66 0) style: (FontDescription helvetica medium roman 18 #'iso10646-1' nil nil) uuid: 'a78e4132-babb-11ea-9743-606720e43e2c'
   208               style: (FontDescription helvetica medium roman 18 #'iso10646-1')
   222              backgroundColor: (Color 100.0 100.0 100.0) translateLabel: true
   209               backgroundColor: (Color 100.0 100.0 100.0)
   223              adjust: left
   210               translateLabel: true
   224           )
   211               adjust: left
   225           (LabelSpec
   212             )
   226              label: 'Icon'
   213            (LabelSpec
   227              name: 'Icon'
   214               label: 'Icon'
   228              layout: (LayoutFrame -75 1 0 0 0 1 66 0) uuid: 'a78e4133-babb-11ea-9743-606720e43e2c'
   215               name: 'Icon'
   229              initiallyInvisible: true
   216               layout: (LayoutFrame -75 1 0 0 0 1 66 0)
   230              hasCharacterOrientedLabel: false
   217               initiallyInvisible: true
   231              backgroundColor: (Color 100.0 100.0 100.0) translateLabel: true
   218               hasCharacterOrientedLabel: false
   232           )
   219               backgroundColor: (Color 100.0 100.0 100.0)
   233           (VerticalPanelViewSpec
   220               translateLabel: true
   234              name: 'Controls'
   221             )
   235              layout: (LayoutFrame 0 0 70 0 0 1 0 1) uuid: 'a78e4134-babb-11ea-9743-606720e43e2c'
   222            (VerticalPanelViewSpec
   236              horizontalLayout: fit
   223               name: 'Controls'
   237              verticalLayout: topFit
   224               layout: (LayoutFrame 0 0 70 0 0 1 0 1)
   238              horizontalSpace: 3
   225               horizontalLayout: fit
   239              verticalSpace: 3
   226               verticalLayout: topFit
   240              component: 
   227               horizontalSpace: 3
   241             (SpecCollection
   228               verticalSpace: 3
   242                collection: (
   229               component: 
   243                 (HorizontalPanelViewSpec
   230              (SpecCollection
   244                    name: 'EnabledAndResetPanel'
   231                 collection: (
   245                    uuid: 'a78e4135-babb-11ea-9743-606720e43e2c'
   232                  (HorizontalPanelViewSpec
   246                    horizontalLayout: rightSpaceFit
   233                     name: 'EnabledAndResetPanel'
   247                    verticalLayout: topSpace
   234                     horizontalLayout: rightSpaceFit
   248                    horizontalSpace: 0
   235                     verticalLayout: fit
   249                    verticalSpace: 3
   236                     horizontalSpace: 0
   250                    component: 
   237                     verticalSpace: 3
   251                   (SpecCollection
   238                     component: 
   252                      collection: (
   239                    (SpecCollection
   253                       (CheckBoxSpec
   240                       collection: (
   254                          label: 'Show in Browser Menus'
   241                        (CheckBoxSpec
   255                          name: 'Enabled'
   242                           label: 'Show in Browser Menus'
   256                          uuid: 'a78e4136-babb-11ea-9743-606720e43e2c'
   243                           name: 'Enabled'
   257                          model: mcEnabled
   244                           model: mcEnabled
   258                          translateLabel: true
   245                           translateLabel: true
   259                          useDefaultExtent: true
   246                           useDefaultExtent: true
   260                       )
   247                         )
   261                       (ActionButtonSpec
   248                        (ActionButtonSpec
   262                          label: 'Flush caches'
   249                           label: 'Flush caches'
   263                          name: 'ResetCachedRepositoriesButton'
   250                           name: 'ResetCachedRepositoriesButton'
   264                          uuid: 'a78e6840-babb-11ea-9743-606720e43e2c'
   251                           translateLabel: true
   265                          translateLabel: true
   252                           model: flushCaches
   266                          model: flushCaches
   253                           enableChannel: mcEnabled
   267                          useDefaultExtent: true
   254                           useDefaultExtent: true
   268                       )
   255                         )
       
   256                        )
       
   257                      
       
   258                     )
   269                     )
   259                     useDefaultExtent: true
   270                   ) useDefaultExtent: true
   260                   )
   271                 )
   261                  (ViewSpec
   272                 (ViewSpec
   262                     name: 'Box1'
   273                    name: 'Box1'
   263                     component: 
   274                    uuid: 'a78e6841-babb-11ea-9743-606720e43e2c'
   264                    (SpecCollection
   275                    component: 
   265                       collection: (
   276                   (SpecCollection
   266                        (LabelSpec
   277                      collection: (
   267                           label: 'Primary Repository: '
   278                       (LabelSpec
   268                           name: 'Label2'
   279                          label: 'Primary Repository: '
   269                           layout: (LayoutFrame 7 0 0 0 150 0 22 0)
   280                          name: 'Label2'
   270                           activeHelpKey: primaryRepository
   281                          layout: (LayoutFrame 7 0 0 0 150 0 22 0) activeHelpKey: primaryRepository
   271                           translateLabel: true
   282                          uuid: 'a78e6842-babb-11ea-9743-606720e43e2c'
   272                           adjust: left
   283                          translateLabel: true
   273                         )
   284                          adjust: left
   274                        (LabelSpec
   285                       )
   275                           name: 'Label3'
   286                       (LabelSpec
   276                           layout: (LayoutFrame 150 0 0 0 0 1 22 0)
   287                          name: 'Label3'
   277                           activeHelpKey: primaryRepository
   288                          layout: (LayoutFrame 150 0 0 0 0 1 22 0) activeHelpKey: primaryRepository
   278                           translateLabel: true
   289                          uuid: 'a78e6843-babb-11ea-9743-606720e43e2c'
   279                           labelChannel: mcPrimaryRepository
   290                          translateLabel: true
   280                           adjust: left
   291                          labelChannel: mcPrimaryRepository
   281                         )
   292                          adjust: left
   282                        )
   293                       )
   283                      
       
   284                     )
   294                     )
   285                     extent: (Point 647 24)
   295                   ) extent: (Point 647 24)
   286                   )
   296                 )
   287                  (FramedBoxSpec
   297                 (FramedBoxSpec
   288                     label: 'Repositories'
   298                    label: 'Repositories'
   289                     name: 'Repositories'
   299                    name: 'Repositories'
   290                     labelPosition: topLeft
   300                    uuid: 'a78e6844-babb-11ea-9743-606720e43e2c'
   291                     translateLabel: true
   301                    labelPosition: topLeft
   292                     component: 
   302                    translateLabel: true
   293                    (SpecCollection
   303                    component: 
   294                       collection: (
   304                   (SpecCollection
   295                        (VerticalPanelViewSpec
   305                      collection: (
   296                           name: 'RepositoryConfigurations'
   306                       (VerticalPanelViewSpec
   297                           layout: (LayoutFrame 0 0 0 0 0 1 0 1)
   307                          name: 'RepositoryConfigurations'
   298                           horizontalLayout: fit
   308                          layout: (LayoutFrame 0 0 0 0 0 1 0 1) uuid: 'a78e6845-babb-11ea-9743-606720e43e2c'
   299                           verticalLayout: bottomFit
   309                          horizontalLayout: fit
   300                           horizontalSpace: 3
   310                          verticalLayout: bottomFit
   301                           verticalSpace: 3
   311                          horizontalSpace: 3
   302                           component: 
   312                          verticalSpace: 3
   303                          (SpecCollection
   313                          component: 
   304                             collection: (
   314                         (SpecCollection
   305                              (ViewSpec
   315                            collection: (
   306                                 name: 'RepositoryConfigurationListBox'
   316                             (ViewSpec
   307                                 model: mcRepositories
   317                                name: 'RepositoryConfigurationListBox'
   308                                 component: 
   318                                uuid: 'a78e6846-babb-11ea-9743-606720e43e2c'
   309                                (SpecCollection
   319                                model: mcRepositories
   310                                   collection: (
   320                                component: 
   311                                    (SelectionInListModelViewSpec
   321                               (SpecCollection
   312                                       name: 'RepositoryList'
   322                                  collection: (
   313                                       layout: (LayoutFrame 0 0 0 0 0 1 0 1)
   323                                   (SelectionInListModelViewSpec
   314                                       enableChannel: mcEnabled
   324                                      name: 'RepositoryList'
   315                                       model: selectedRepositoryHolder
   325                                      layout: (LayoutFrame 0 0 0 0 0 1 0 1) uuid: 'a78e6847-babb-11ea-9743-606720e43e2c'
   316                                       hasHorizontalScrollBar: true
   326                                      model: selectedRepositoryHolder
   317                                       hasVerticalScrollBar: true
   327                                      hasHorizontalScrollBar: true
   318                                       listModel: mcRepositories
   328                                      hasVerticalScrollBar: true
   319                                       useIndex: false
   329                                      listModel: mcRepositories
   320                                       highlightMode: line
   330                                      useIndex: false
   321                                     )
   331                                      highlightMode: line
   322                                    )
   332                                   )
   323                                  
       
   324                                 )
   333                                 )
   325                                 extent: (Point 613 437)
   334                               ) extent: (Point 613 429)
   326                               )
   335                             )
   327                              (HorizontalPanelViewSpec
   336                             (HorizontalPanelViewSpec
   328                                 name: 'AddRemovePanel'
   337                                name: 'AddRemovePanel'
   329                                 horizontalLayout: fit
   338                                uuid: 'a78e6848-babb-11ea-9743-606720e43e2c'
   330                                 verticalLayout: center
   339                                horizontalLayout: fit
   331                                 horizontalSpace: 3
   340                                verticalLayout: center
   332                                 verticalSpace: 3
   341                                horizontalSpace: 3
   333                                 component: 
   342                                verticalSpace: 3
   334                                (SpecCollection
   343                                component: 
   335                                   collection: (
   344                               (SpecCollection
   336                                    (ActionButtonSpec
   345                                  collection: (
   337                                       label: 'Add Repository...'
   346                                   (ActionButtonSpec
   338                                       name: 'AddConfigurationAction'
   347                                      label: 'Add...'
   339                                       activeHelpKey: addRepository
   348                                      name: 'AddConfigurationAction'
   340                                       translateLabel: true
   349                                      activeHelpKey: addRepository
   341                                       model: addRepositoryAction
   350                                      uuid: 'a78e6849-babb-11ea-9743-606720e43e2c'
   342                                       enableChannel: mcEnabled
   351                                      translateLabel: true
   343                                       extent: (Point 151 25)
   352                                      model: addRepositoryAction
   344                                     )
   353                                      extent: (Point 151 25)
   345                                    (ActionButtonSpec
   354                                   )
   346                                       label: 'Remove Repository...'
   355                                   (ActionButtonSpec
   347                                       name: 'RemoveConfigurationAction'
   356                                      label: 'Remove...'
   348                                       activeHelpKey: removeRepository
   357                                      name: 'RemoveConfigurationAction'
   349                                       translateLabel: true
   358                                      activeHelpKey: removeRepository
   350                                       model: removeRepositoryAction
   359                                      uuid: 'a78e684a-babb-11ea-9743-606720e43e2c'
   351                                       enableChannel: mcEnabledAndRepositorySelectedHolder
   360                                      translateLabel: true
   352                                       extent: (Point 151 25)
   361                                      model: removeRepositoryAction
   353                                     )
   362                                      enableChannel: repositorySelectedHolder
   354                                    (LabelSpec
   363                                      extent: (Point 151 25)
   355                                       name: 'Label1'
   364                                   )
   356                                       translateLabel: true
   365                                   (LabelSpec
   357                                       extent: (Point 151 22)
   366                                      name: 'Label1'
   358                                     )
   367                                      uuid: 'a78e684b-babb-11ea-9743-606720e43e2c'
   359                                    (ActionButtonSpec
   368                                      translateLabel: true
   360                                       label: 'Define as Primary'
   369                                      extent: (Point 151 22)
   361                                       name: 'Button1'
   370                                   )
   362                                       activeHelpKey: makePrimaryRepository
   371                                   (ActionButtonSpec
   363                                       translateLabel: true
   372                                      label: 'Define as Primary'
   364                                       model: defineAsPrimaryRepositoryAction
   373                                      name: 'Button1'
   365                                       enableChannel: mcEnabledAndRepositorySelectedHolder
   374                                      activeHelpKey: makePrimaryRepository
   366                                       extent: (Point 151 25)
   375                                      uuid: 'a78e8f50-babb-11ea-9743-606720e43e2c'
   367                                     )
   376                                      translateLabel: true
   368                                    )
   377                                      model: defineAsPrimaryRepositoryAction
   369                                  
   378                                      enableChannel: mcEnabledAndRepositorySelectedHolder
       
   379                                      extent: (Point 151 25)
       
   380                                   )
   370                                 )
   381                                 )
   371                                 extent: (Point 613 30)
   382                               ) extent: (Point 613 30)
   372                               )
   383                             )
   373                              )
       
   374                            
       
   375                           )
   384                           )
   376                         )
   385                         )
   377                        )
   386                       )
   378                      
       
   379                     )
   387                     )
   380                     extent: (Point 647 503)
   388                   ) extent: (Point 647 495)
   381                   )
   389                 )
   382                  )
       
   383                
       
   384               )
   390               )
   385             )
   391             )
   386            )
   392           )
   387          
       
   388         )
   393         )
   389       )
   394       )
       
   395     )
   390 ! !
   396 ! !
   391 
   397 
   392 !MCSettingsApp class methodsFor:'queries'!
   398 !MCSettingsApp class methodsFor:'queries'!
   393 
   399 
   394 managerTypeName
   400 managerTypeName
   550     "Modified: / 01-12-2011 / 20:08:10 / cg"
   556     "Modified: / 01-12-2011 / 20:08:10 / cg"
   551 !
   557 !
   552 
   558 
   553 mcEnabledAndRepositorySelectedHolder
   559 mcEnabledAndRepositorySelectedHolder
   554     ^ BlockValue
   560     ^ BlockValue
   555         with:[:v | self mcEnabled value and:[ v notNil ]]
   561         forLogical: self mcEnabled  
   556         argument:(self selectedRepositoryHolder)
   562                and: self repositorySelectedHolder
   557 
   563 
   558     "Created: / 01-12-2011 / 19:58:57 / cg"
   564     "Created: / 01-12-2011 / 19:58:57 / cg"
       
   565     "Modified: / 30-06-2020 / 11:24:34 / Jan Vrany <jan.vrany@labware.com>"
   559 !
   566 !
   560 
   567 
   561 mcPrimaryRepository
   568 mcPrimaryRepository
   562 
   569 
   563     ^self settingsAspectFor: #mcPrimaryRepository default:nil
   570     ^self settingsAspectFor: #mcPrimaryRepository default:nil
   571 
   578 
   572     mcRepositories isNil ifTrue:[
   579     mcRepositories isNil ifTrue:[
   573         mcRepositories := ValueHolder new.
   580         mcRepositories := ValueHolder new.
   574     ].
   581     ].
   575     ^ mcRepositories
   582     ^ mcRepositories
       
   583 !
       
   584 
       
   585 repositorySelectedHolder
       
   586     ^ BlockValue
       
   587         with:[:v | v value notNil ]
       
   588         argument:(self selectedRepositoryHolder)
       
   589 
       
   590     "Created: / 30-06-2020 / 11:23:26 / Jan Vrany <jan.vrany@labware.com>"
   576 !
   591 !
   577 
   592 
   578 selectedRepositoryHolder
   593 selectedRepositoryHolder
   579     selectedRepositoryHolder isNil ifTrue:[
   594     selectedRepositoryHolder isNil ifTrue:[
   580         selectedRepositoryHolder := nil asValue.
   595         selectedRepositoryHolder := nil asValue.
   684 
   699 
   685 version_CVS
   700 version_CVS
   686     ^ '$Header: /cvs/stx/stx/goodies/monticello/MCSettingsApp.st,v 1.14 2014-03-01 09:40:15 cg Exp $'
   701     ^ '$Header: /cvs/stx/stx/goodies/monticello/MCSettingsApp.st,v 1.14 2014-03-01 09:40:15 cg Exp $'
   687 !
   702 !
   688 
   703 
       
   704 version_HG
       
   705 
       
   706     ^ '$Changeset: <not expanded> $'
       
   707 !
       
   708 
   689 version_SVN
   709 version_SVN
   690     ^ '$Id: MCSettingsApp.st,v 1.14 2014-03-01 09:40:15 cg Exp $'
   710     ^ '$Id: MCSettingsApp.st,v 1.14 2014-03-01 09:40:15 cg Exp $'
   691 ! !
   711 ! !
   692 
   712