Allow adding / removing Monticello repositories in settings even if Monticello is disabled
...as in browser menus.
--- a/MCSettingsApp.st Mon Jun 29 23:17:32 2020 +0100
+++ b/MCSettingsApp.st Tue Jun 30 11:28:45 2020 +0100
@@ -1,5 +1,10 @@
+"
+COPYRIGHT (c) 2020 LabWare
+"
"{ Package: 'stx:goodies/monticello' }"
+"{ NameSpace: Smalltalk }"
+
AbstractSettingsApplication subclass:#MCSettingsApp
instanceVariableNames:'mcRepositories selectedRepositoryHolder'
classVariableNames:''
@@ -7,6 +12,15 @@
category:'SCM-Monticello-St/X UI'
!
+!MCSettingsApp class methodsFor:'documentation'!
+
+copyright
+"
+COPYRIGHT (c) 2020 LabWare
+
+
+"
+! !
!MCSettingsApp class methodsFor:'help specs'!
@@ -189,204 +203,196 @@
<resource: #canvas>
^
- #(FullSpec
- name: windowSpec
- window:
- (WindowSpec
- label: 'Monticello Settings'
- name: 'Monticello Settings'
- min: (Point 10 10)
- bounds: (Rectangle 0 0 647 627)
- )
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: ' Monticello Settings'
- name: 'Title'
- layout: (LayoutFrame 0 0 0 0 0 1 66 0)
- style: (FontDescription helvetica medium roman 18 #'iso10646-1')
- backgroundColor: (Color 100.0 100.0 100.0)
- translateLabel: true
- adjust: left
- )
- (LabelSpec
- label: 'Icon'
- name: 'Icon'
- layout: (LayoutFrame -75 1 0 0 0 1 66 0)
- initiallyInvisible: true
- hasCharacterOrientedLabel: false
- backgroundColor: (Color 100.0 100.0 100.0)
- translateLabel: true
- )
- (VerticalPanelViewSpec
- name: 'Controls'
- layout: (LayoutFrame 0 0 70 0 0 1 0 1)
- horizontalLayout: fit
- verticalLayout: topFit
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (HorizontalPanelViewSpec
- name: 'EnabledAndResetPanel'
- horizontalLayout: rightSpaceFit
- verticalLayout: fit
- horizontalSpace: 0
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (CheckBoxSpec
- label: 'Show in Browser Menus'
- name: 'Enabled'
- model: mcEnabled
- translateLabel: true
- useDefaultExtent: true
- )
- (ActionButtonSpec
- label: 'Flush caches'
- name: 'ResetCachedRepositoriesButton'
- translateLabel: true
- model: flushCaches
- enableChannel: mcEnabled
- useDefaultExtent: true
- )
- )
-
+ #(FullSpec
+ name: windowSpec
+ uuid: 'a78e4130-babb-11ea-9743-606720e43e2c'
+ window:
+ (WindowSpec
+ label: 'Monticello Settings'
+ name: 'Monticello Settings'
+ uuid: 'a78e4131-babb-11ea-9743-606720e43e2c'
+ min: (Point 10 10) bounds: (Rectangle 0 0 647 627)
+ ) component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: ' Monticello Settings'
+ name: 'Title'
+ 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'
+ backgroundColor: (Color 100.0 100.0 100.0) translateLabel: true
+ adjust: left
+ )
+ (LabelSpec
+ label: 'Icon'
+ name: 'Icon'
+ layout: (LayoutFrame -75 1 0 0 0 1 66 0) uuid: 'a78e4133-babb-11ea-9743-606720e43e2c'
+ initiallyInvisible: true
+ hasCharacterOrientedLabel: false
+ backgroundColor: (Color 100.0 100.0 100.0) translateLabel: true
+ )
+ (VerticalPanelViewSpec
+ name: 'Controls'
+ layout: (LayoutFrame 0 0 70 0 0 1 0 1) uuid: 'a78e4134-babb-11ea-9743-606720e43e2c'
+ horizontalLayout: fit
+ verticalLayout: topFit
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (HorizontalPanelViewSpec
+ name: 'EnabledAndResetPanel'
+ uuid: 'a78e4135-babb-11ea-9743-606720e43e2c'
+ horizontalLayout: rightSpaceFit
+ verticalLayout: topSpace
+ horizontalSpace: 0
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (CheckBoxSpec
+ label: 'Show in Browser Menus'
+ name: 'Enabled'
+ uuid: 'a78e4136-babb-11ea-9743-606720e43e2c'
+ model: mcEnabled
+ translateLabel: true
+ useDefaultExtent: true
+ )
+ (ActionButtonSpec
+ label: 'Flush caches'
+ name: 'ResetCachedRepositoriesButton'
+ uuid: 'a78e6840-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ model: flushCaches
+ useDefaultExtent: true
+ )
+ )
+ ) useDefaultExtent: true
+ )
+ (ViewSpec
+ name: 'Box1'
+ uuid: 'a78e6841-babb-11ea-9743-606720e43e2c'
+ component:
+ (SpecCollection
+ collection: (
+ (LabelSpec
+ label: 'Primary Repository: '
+ name: 'Label2'
+ layout: (LayoutFrame 7 0 0 0 150 0 22 0) activeHelpKey: primaryRepository
+ uuid: 'a78e6842-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ adjust: left
+ )
+ (LabelSpec
+ name: 'Label3'
+ layout: (LayoutFrame 150 0 0 0 0 1 22 0) activeHelpKey: primaryRepository
+ uuid: 'a78e6843-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ labelChannel: mcPrimaryRepository
+ adjust: left
+ )
)
- useDefaultExtent: true
- )
- (ViewSpec
- name: 'Box1'
- component:
- (SpecCollection
- collection: (
- (LabelSpec
- label: 'Primary Repository: '
- name: 'Label2'
- layout: (LayoutFrame 7 0 0 0 150 0 22 0)
- activeHelpKey: primaryRepository
- translateLabel: true
- adjust: left
- )
- (LabelSpec
- name: 'Label3'
- layout: (LayoutFrame 150 0 0 0 0 1 22 0)
- activeHelpKey: primaryRepository
- translateLabel: true
- labelChannel: mcPrimaryRepository
- adjust: left
- )
- )
-
- )
- extent: (Point 647 24)
- )
- (FramedBoxSpec
- label: 'Repositories'
- name: 'Repositories'
- labelPosition: topLeft
- translateLabel: true
- component:
- (SpecCollection
- collection: (
- (VerticalPanelViewSpec
- name: 'RepositoryConfigurations'
- layout: (LayoutFrame 0 0 0 0 0 1 0 1)
- horizontalLayout: fit
- verticalLayout: bottomFit
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (ViewSpec
- name: 'RepositoryConfigurationListBox'
- model: mcRepositories
- component:
- (SpecCollection
- collection: (
- (SelectionInListModelViewSpec
- name: 'RepositoryList'
- layout: (LayoutFrame 0 0 0 0 0 1 0 1)
- enableChannel: mcEnabled
- model: selectedRepositoryHolder
- hasHorizontalScrollBar: true
- hasVerticalScrollBar: true
- listModel: mcRepositories
- useIndex: false
- highlightMode: line
- )
- )
-
+ ) extent: (Point 647 24)
+ )
+ (FramedBoxSpec
+ label: 'Repositories'
+ name: 'Repositories'
+ uuid: 'a78e6844-babb-11ea-9743-606720e43e2c'
+ labelPosition: topLeft
+ translateLabel: true
+ component:
+ (SpecCollection
+ collection: (
+ (VerticalPanelViewSpec
+ name: 'RepositoryConfigurations'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1) uuid: 'a78e6845-babb-11ea-9743-606720e43e2c'
+ horizontalLayout: fit
+ verticalLayout: bottomFit
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (ViewSpec
+ name: 'RepositoryConfigurationListBox'
+ uuid: 'a78e6846-babb-11ea-9743-606720e43e2c'
+ model: mcRepositories
+ component:
+ (SpecCollection
+ collection: (
+ (SelectionInListModelViewSpec
+ name: 'RepositoryList'
+ layout: (LayoutFrame 0 0 0 0 0 1 0 1) uuid: 'a78e6847-babb-11ea-9743-606720e43e2c'
+ model: selectedRepositoryHolder
+ hasHorizontalScrollBar: true
+ hasVerticalScrollBar: true
+ listModel: mcRepositories
+ useIndex: false
+ highlightMode: line
+ )
)
- extent: (Point 613 437)
- )
- (HorizontalPanelViewSpec
- name: 'AddRemovePanel'
- horizontalLayout: fit
- verticalLayout: center
- horizontalSpace: 3
- verticalSpace: 3
- component:
- (SpecCollection
- collection: (
- (ActionButtonSpec
- label: 'Add Repository...'
- name: 'AddConfigurationAction'
- activeHelpKey: addRepository
- translateLabel: true
- model: addRepositoryAction
- enableChannel: mcEnabled
- extent: (Point 151 25)
- )
- (ActionButtonSpec
- label: 'Remove Repository...'
- name: 'RemoveConfigurationAction'
- activeHelpKey: removeRepository
- translateLabel: true
- model: removeRepositoryAction
- enableChannel: mcEnabledAndRepositorySelectedHolder
- extent: (Point 151 25)
- )
- (LabelSpec
- name: 'Label1'
- translateLabel: true
- extent: (Point 151 22)
- )
- (ActionButtonSpec
- label: 'Define as Primary'
- name: 'Button1'
- activeHelpKey: makePrimaryRepository
- translateLabel: true
- model: defineAsPrimaryRepositoryAction
- enableChannel: mcEnabledAndRepositorySelectedHolder
- extent: (Point 151 25)
- )
- )
-
+ ) extent: (Point 613 429)
+ )
+ (HorizontalPanelViewSpec
+ name: 'AddRemovePanel'
+ uuid: 'a78e6848-babb-11ea-9743-606720e43e2c'
+ horizontalLayout: fit
+ verticalLayout: center
+ horizontalSpace: 3
+ verticalSpace: 3
+ component:
+ (SpecCollection
+ collection: (
+ (ActionButtonSpec
+ label: 'Add...'
+ name: 'AddConfigurationAction'
+ activeHelpKey: addRepository
+ uuid: 'a78e6849-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ model: addRepositoryAction
+ extent: (Point 151 25)
+ )
+ (ActionButtonSpec
+ label: 'Remove...'
+ name: 'RemoveConfigurationAction'
+ activeHelpKey: removeRepository
+ uuid: 'a78e684a-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ model: removeRepositoryAction
+ enableChannel: repositorySelectedHolder
+ extent: (Point 151 25)
+ )
+ (LabelSpec
+ name: 'Label1'
+ uuid: 'a78e684b-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ extent: (Point 151 22)
+ )
+ (ActionButtonSpec
+ label: 'Define as Primary'
+ name: 'Button1'
+ activeHelpKey: makePrimaryRepository
+ uuid: 'a78e8f50-babb-11ea-9743-606720e43e2c'
+ translateLabel: true
+ model: defineAsPrimaryRepositoryAction
+ enableChannel: mcEnabledAndRepositorySelectedHolder
+ extent: (Point 151 25)
+ )
)
- extent: (Point 613 30)
- )
- )
-
+ ) extent: (Point 613 30)
+ )
)
)
- )
-
+ )
)
- extent: (Point 647 503)
- )
- )
-
+ ) extent: (Point 647 495)
+ )
)
)
- )
-
+ )
)
)
+ )
! !
!MCSettingsApp class methodsFor:'queries'!
@@ -552,10 +558,11 @@
mcEnabledAndRepositorySelectedHolder
^ BlockValue
- with:[:v | self mcEnabled value and:[ v notNil ]]
- argument:(self selectedRepositoryHolder)
+ forLogical: self mcEnabled
+ and: self repositorySelectedHolder
"Created: / 01-12-2011 / 19:58:57 / cg"
+ "Modified: / 30-06-2020 / 11:24:34 / Jan Vrany <jan.vrany@labware.com>"
!
mcPrimaryRepository
@@ -575,6 +582,14 @@
^ mcRepositories
!
+repositorySelectedHolder
+ ^ BlockValue
+ with:[:v | v value notNil ]
+ argument:(self selectedRepositoryHolder)
+
+ "Created: / 30-06-2020 / 11:23:26 / Jan Vrany <jan.vrany@labware.com>"
+!
+
selectedRepositoryHolder
selectedRepositoryHolder isNil ifTrue:[
selectedRepositoryHolder := nil asValue.
@@ -686,6 +701,11 @@
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSettingsApp.st,v 1.14 2014-03-01 09:40:15 cg Exp $'
!
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$Id: MCSettingsApp.st,v 1.14 2014-03-01 09:40:15 cg Exp $'
! !