AbstractSettingsApplication.st
changeset 14759 47e9d7d9bfed
parent 14745 7ac4401b840e
child 14771 65840e41c10f
--- a/AbstractSettingsApplication.st	Mon Oct 13 22:09:35 2014 +0200
+++ b/AbstractSettingsApplication.st	Tue Oct 14 16:10:39 2014 +0200
@@ -322,7 +322,8 @@
 		showEmbeddedTestRunnerInBrowser showBookmarkBar
 		webBrowserLikeLayout sortAndIndentClassesByInheritance
 		showLocalHistory showGlobalHistory useInPlaceSearchInBrowserLists
-		sourceCodeManagementMenuLayout confirmRefactorings'
+		sourceCodeManagementMenuLayout confirmRefactorings
+		smallLintRulesetDefault'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:AbstractSettingsApplication
@@ -441,6 +442,81 @@
 
 windowSpec
     self subclassResponsibility
+!
+
+windowSpecForDialog
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:AbstractSettingsApplication andSelector:#windowSpecForDialog
+     AbstractSettingsApplication new openInterface:#windowSpecForDialog
+    "
+
+    <resource: #canvas>
+
+    ^ 
+    #(FullSpec
+       name: windowSpecForDialog
+       window: 
+      (WindowSpec
+         label: 'NewApplication'
+         name: 'NewApplication'
+         labelChannel: settingsString
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 531 488)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (SubCanvasSpec
+             name: 'Content'
+             layout: (LayoutFrame 7 0 0 0 -7 1 -40 1)
+             level: 0
+             hasHorizontalScrollBar: true
+             hasVerticalScrollBar: true
+             minorKey: windowSpec
+             createNewBuilder: false
+           )
+          (HorizontalPanelViewSpec
+             name: 'BottonPanel'
+             layout: (LayoutFrame 5 0 -40 1 -7 1 0 1)
+             horizontalLayout: right
+             verticalLayout: center
+             horizontalSpace: 3
+             verticalSpace: 3
+             reverseOrderIfOKAtLeft: true
+             component: 
+            (SpecCollection
+               collection: (
+                (ActionButtonSpec
+                   label: 'Cancel'
+                   name: 'CancelButton'
+                   translateLabel: true
+                   model: doCancel
+                   extent: (Point 159 25)
+                 )
+                (ActionButtonSpec
+                   label: 'OK'
+                   name: 'OKButton'
+                   translateLabel: true
+                   model: doAccept
+                   enableChannel: modifiedChannel
+                   isDefault: true
+                   defaultable: true
+                   extent: (Point 159 25)
+                 )
+                )
+              
+             )
+           )
+          )
+        
+       )
+     )
 ! !
 
 !AbstractSettingsApplication class methodsFor:'queries'!
@@ -469,10 +545,20 @@
     settingsDialog := aSettingsDialog.
 
     "Modified: / 12-05-2010 / 18:44:09 / cg"
+!
+
+settingsString
+    ^ settingsString
 ! !
 
 !AbstractSettingsApplication methodsFor:'actions'!
 
+accept
+    self saveSettings
+
+    "Created: / 14-10-2014 / 09:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 evaluateModified
     <resource: #obsolete>
     self obsoleteMethodWarning.
@@ -649,6 +735,14 @@
     "Modified: / 24-08-2010 / 16:52:42 / sr"
 ! !
 
+!AbstractSettingsApplication methodsFor:'hooks'!
+
+preOpenWith: anUIBuilder
+    self readSettings
+
+    "Created: / 14-10-2014 / 09:16:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !AbstractSettingsApplication methodsFor:'initialization'!
 
 initialize
@@ -671,6 +765,17 @@
     ^ nil
 ! !
 
+!AbstractSettingsApplication methodsFor:'opening'!
+
+open
+    "open a standard interface.
+     Sorry, but for visualworks compatibility, the builder is returned"
+
+    ^ self openInterfaceModal: #windowSpecForDialog
+
+    "Created: / 14-10-2014 / 09:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !AbstractSettingsApplication methodsFor:'protocol'!
 
 askForChangeOnRelease
@@ -16199,11 +16304,11 @@
        name: windowSpec
        window: 
       (WindowSpec
-         label: 'Tool Settings'
-         name: 'Tool Settings'
+         label: 'System Browser Settings'
+         name: 'System Browser Settings'
          flags: 1
          min: (Point 10 10)
-         bounds: (Rectangle 0 0 617 487)
+         bounds: (Rectangle 0 0 617 659)
        )
        component: 
       (SpecCollection
@@ -16242,7 +16347,7 @@
                                activeHelpKey: useEmbeddedTestRunner
                                model: showEmbeddedTestRunnerInBrowser
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Web Browser Like Layout (Toolbars are Part of the Tab - experimental)'
@@ -16259,7 +16364,7 @@
                                activeHelpKey: showBookmarksBar
                                model: showBookmarkBar
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Sort and Indent Classes by Inheritance'
@@ -16267,7 +16372,7 @@
                                activeHelpKey: sortAndIndentClassesByInheritance
                                model: sortAndIndentClassesByInheritance
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Show Local Navigation History (Separate History per Browser Tab)'
@@ -16275,7 +16380,7 @@
                                activeHelpKey: showLocalHistory
                                model: showLocalHistory
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Show Global Navigation History (Global History for all Browsers)'
@@ -16283,7 +16388,7 @@
                                activeHelpKey: showGlobalHistory
                                model: showGlobalHistory
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Show Search Bar in Browser'
@@ -16291,7 +16396,7 @@
                                activeHelpKey: searchBarInBrowser
                                model: useSearchBarInBrowser
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Use in-place Search in Browser Lists (experimental)'
@@ -16299,7 +16404,7 @@
                                activeHelpKey: inPlaceSearch
                                model: useInPlaceSearchInBrowserLists
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (CheckBoxSpec
                                label: 'Show Method Template'
@@ -16307,7 +16412,7 @@
                                activeHelpKey: showMethodTemplate
                                model: showMethodTemplate
                                translateLabel: true
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             )
                           
@@ -16316,9 +16421,9 @@
                       )
                     
                    )
-                   extent: (Point 607 311)
+                   extent: (Point 607 308)
+                   useDynamicPreferredHeight: true
                    usePreferredHeight: true
-                   useDynamicPreferredHeight: true
                  )
                 (FramedBoxSpec
                    label: 'Sourcecode Management Menu Layout'
@@ -16346,7 +16451,7 @@
                                model: sourceCodeManagementMenuLayout
                                isTriggerOnDown: true
                                select: 'old'
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (RadioButtonSpec
                                label: 'Inline'
@@ -16356,7 +16461,7 @@
                                model: sourceCodeManagementMenuLayout
                                isTriggerOnDown: true
                                select: 'inline'
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             (RadioButtonSpec
                                label: 'Compact'
@@ -16366,7 +16471,7 @@
                                model: sourceCodeManagementMenuLayout
                                isTriggerOnDown: true
                                select: 'compact'
-                               extent: (Point 581 30)
+                               extent: (Point 583 30)
                              )
                             )
                           
@@ -16375,7 +16480,93 @@
                       )
                     
                    )
-                   extent: (Point 617 146)
+                   extent: (Point 617 143)
+                   useDynamicPreferredHeight: true
+                   usePreferredHeight: true
+                 )
+                (FramedBoxSpec
+                   label: 'Static Analysis (Lint)'
+                   name: 'LintPanel'
+                   labelPosition: topLeft
+                   translateLabel: true
+                   component: 
+                  (SpecCollection
+                     collection: (
+                      (VerticalPanelViewSpec
+                         name: 'LintPanelContent'
+                         layout: (LayoutFrame 0 0 0 0 0 1 53 0)
+                         horizontalLayout: fit
+                         verticalLayout: top
+                         horizontalSpace: 3
+                         verticalSpace: 3
+                         component: 
+                        (SpecCollection
+                           collection: (
+                            (ViewSpec
+                               name: 'DefaultRulesetBox'
+                               component: 
+                              (SpecCollection
+                                 collection: (
+                                  (LabelSpec
+                                     label: 'Default Rules:'
+                                     name: 'DefaultRulesetLabel'
+                                     layout: (LayoutFrame 0 0 0 0 120 0 0 1)
+                                     translateLabel: true
+                                     adjust: left
+                                   )
+                                  (InputFieldSpec
+                                     name: 'DefaultRuleset'
+                                     layout: (LayoutFrame 120 0 0 0 -70 1 0 1)
+                                     model: smallLintRulesetDefault
+                                     isReadOnly: true
+                                     acceptOnReturn: true
+                                     acceptOnTab: true
+                                     acceptOnPointerLeave: true
+                                     emptyFieldReplacementText: 'Default'
+                                   )
+                                  (ActionButtonSpec
+                                     label: 'Select'
+                                     name: 'DefaultRulesetSelectButton'
+                                     layout: (LayoutFrame -70 1 0 0 0 1 0 1)
+                                     translateLabel: true
+                                     model: doSelectDefaultRuleset
+                                   )
+                                  )
+                                
+                               )
+                               extent: (Point 583 25)
+                             )
+                            (ViewSpec
+                               name: 'Box1'
+                               component: 
+                              (SpecCollection
+                                 collection: (
+                                  (LinkButtonSpec
+                                     label: 'Configure Rule Sets...'
+                                     name: 'Button1'
+                                     layout: (LayoutFrame -150 1 -20 1 0 1 0 1)
+                                     foregroundColor: (Color 0.0 0.0 100.0)
+                                     translateLabel: true
+                                     adjust: right
+                                     model: doConfigureRulesets
+                                   )
+                                  )
+                                
+                               )
+                               extent: (Point 583 25)
+                             )
+                            )
+                          
+                         )
+                         useDynamicPreferredHeight: true
+                         usePreferredHeight: true
+                       )
+                      )
+                    
+                   )
+                   extent: (Point 617 100)
+                   useDynamicPreferredHeight: true
+                   usePreferredHeight: true
                  )
                 )
               
@@ -16389,6 +16580,13 @@
 
 !AbstractSettingsApplication::SystemBrowserSettingsAppl methodsFor:'actions'!
 
+accept
+    self saveSettings.
+    self closeRequest.
+
+    "Created: / 14-10-2014 / 09:18:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 aspects
     ^ #(
         "/ showAcceptCancelBarInBrowser
@@ -16404,10 +16602,11 @@
         useInPlaceSearchInBrowserLists
         sourceCodeManagementMenuLayout
         confirmRefactorings
+        smallLintRulesetDefault
     )
 
     "Created: / 25-11-2011 / 15:09:28 / cg"
-    "Modified: / 04-04-2012 / 14:03:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 14-10-2014 / 08:19:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 basicReadSettings
@@ -16426,6 +16625,26 @@
 
     "Modified: / 06-10-2011 / 18:57:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 25-11-2011 / 15:09:49 / cg"
+!
+
+doConfigureRulesets
+    Tools::LintRuleSettingsApplication open
+
+    "Modified: / 14-10-2014 / 09:28:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+doSelectDefaultRuleset
+    <resource: #uiCallback>
+
+    | dialog |
+
+    dialog := Tools::LintRuleSelectionDialog new.
+    dialog open.
+    dialog accepted ifTrue:[
+        smallLintRulesetDefault value: dialog selectionAsRule name.
+    ]
+
+    "Modified: / 13-10-2014 / 22:23:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !AbstractSettingsApplication::SystemBrowserSettingsAppl methodsFor:'aspects'!
@@ -16509,6 +16728,27 @@
     "Modified: / 11-03-2010 / 10:08:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+smallLintRulesetDefault
+    <resource: #uiAspect>
+
+    "automatically generated by UIPainter ..."
+
+    "*** the code below creates a default model when invoked."
+    "*** (which may not be the one you wanted)"
+    "*** Please change as required and accept it in the browser."
+    "*** (and replace this comment by something more useful ;-)"
+
+    smallLintRulesetDefault isNil ifTrue:[
+        smallLintRulesetDefault := ValueHolder new.
+"/ if your app needs to be notified of changes, uncomment one of the lines below:
+"/       smallLintRulesetNameDefault addDependent:self.
+"/       smallLintRulesetNameDefault onChangeSend:#smallLintRulesetNameDefaultChanged to:self.
+    ].
+    ^ smallLintRulesetDefault.
+
+    "Created: / 14-10-2014 / 08:19:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 sortAndIndentClassesByInheritance
 
     sortAndIndentClassesByInheritance isNil ifTrue:[
@@ -18550,10 +18790,10 @@
 !AbstractSettingsApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.562 2014-09-25 19:46:59 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.563 2014-10-14 14:10:39 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.562 2014-09-25 19:46:59 stefan Exp $'
-! !
-
+    ^ '$Header: /cvs/stx/stx/libtool/AbstractSettingsApplication.st,v 1.563 2014-10-14 14:10:39 vrany Exp $'
+! !
+