AbstractLauncherApplication.st
branchjv
changeset 17136 cb908d2ba02e
parent 17134 c4cce8b7a95d
parent 17083 1cb0fa7c49c0
child 17163 4bf9cb558e1c
--- a/AbstractLauncherApplication.st	Thu Nov 24 22:03:16 2016 +0000
+++ b/AbstractLauncherApplication.st	Thu Nov 24 22:14:31 2016 +0000
@@ -434,6 +434,7 @@
     "/ settingsApp requestor:self.
     OpenSettingsDialog := settingsApp.
     settingsApp allButOpen.
+    "/ settingsApp showNonDefaultSettingsMenuItemVisibleHolder value:true.
     settingsApp window label:(self classResources string:'ST/X Settings').
     settingsApp openWindow.
 
@@ -2257,7 +2258,7 @@
     |allBounds bounds myDevice|
 
     myDevice := self device.
-    allBounds := myDevice monitorBoundsAt:aWindow center.
+    allBounds := myDevice monitorBounds. "At:aWindow center"
     allBounds notEmptyOrNil ifTrue:[
         bounds := allBounds 
                 detect:[:bounds | bounds containsPoint:self window center ]
@@ -3292,12 +3293,12 @@
     "open a dialog on compiler related settings.
      Obsoleted by the settings application"
 
-    |box warnings warnSTX warnUnderscore warnDollar warnOldStyle warnUnusedVars
-     allowDollar allowUnderscore allowSqueakExtensions allowQualifiedNames
+    |box warnings warnSTX warnUnderscore warnDollar warnParagraph warnOldStyle warnUnusedVars
+     allowDollar allowParagraph allowUnderscore allowSqueakExtensions allowQualifiedNames
      allowDolphinExtensions allowOldStyleAssignment allowReservedWordsAsSelectors
      immutableArrays
      warnSTXBox warnUnderscoreBox warnOldStyleBox warnCommonMistakes warnCommonMistakesBox
-     warnCompatibility warnCompatibilityBox warnDollarBox warnUnusedVarsBox
+     warnCompatibility warnCompatibilityBox warnDollarBox warnParagraphBox warnUnusedVarsBox
      stcCompilation compilationList stcCompilationOptions
      historyLines fullHistoryUpdate
      catchMethodRedefs catchClassRedefs keepSourceOptions keepSource
@@ -3318,12 +3319,14 @@
     warnSTX := ParserFlags warnSTXSpecials asValue.
     warnUnderscore := ParserFlags warnUnderscoreInIdentifier asValue.
     warnDollar := ParserFlags warnDollarInIdentifier asValue.
+    warnParagraph := ParserFlags warnParagraphInIdentifier asValue.
     warnOldStyle := ParserFlags warnOldStyleAssignment asValue.
     warnCommonMistakes := ParserFlags warnCommonMistakes asValue.
     warnCompatibility := ParserFlags warnPossibleIncompatibilities asValue.
     warnUnusedVars := ParserFlags warnUnusedVars asValue.
     allowUnderscore := ParserFlags allowUnderscoreInIdentifier asValue.
     allowDollar := ParserFlags allowDollarInIdentifier asValue.
+    allowParagraph := ParserFlags allowParagraphInIdentifier asValue.
     allowSqueakExtensions := ParserFlags allowSqueakExtensions asValue.
     allowDolphinExtensions := ParserFlags allowDolphinExtensions asValue.
     allowQualifiedNames := ParserFlags allowQualifiedNames asValue.
@@ -3377,6 +3380,7 @@
                 warnUnusedVarsBox enable.
                 warnUnderscoreBox enabled:allowUnderscore.
                 warnDollarBox enabled:allowDollar.
+                warnParagraphBox enabled:allowParagraph.
               ] ifFalse:[
                 warnSTXBox disable.
                 warnUnderscoreBox disable.
@@ -3385,11 +3389,13 @@
                 warnCommonMistakesBox disable.
                 warnCompatibilityBox disable.
                 warnUnusedVarsBox disable.
+                warnParagraphBox disable.
               ]].
 
     warnings onChangeEvaluate:warnEnabler.
     allowUnderscore onChangeEvaluate:warnEnabler.
     allowDollar onChangeEvaluate:warnEnabler.
+    allowParagraph onChangeEvaluate:warnEnabler.
 "/    allowSqueakExtensions onChangeEvaluate:warnEnabler.
 "/    allowQualifiedNames onChangeEvaluate:warnEnabler.
 
@@ -3459,6 +3465,9 @@
     component := box addCheckBox:(resources string:'Allow Dollar in Identifiers') on:allowDollar.
     component width:0.4.
 
+    component := box addCheckBox:(resources string:'Allow Paragraph in Identifiers') on:allowParagraph.
+    component width:0.4.
+
     component := box addCheckBox:(resources string:'Allow VW3 QualifiedNames') on:allowQualifiedNames.
     component width:0.4.
 
@@ -3510,6 +3519,9 @@
     warnDollarBox := box addCheckBox:(resources string:'Dollars in Identifiers') on:warnDollar.
     warnDollarBox width:0.4.
 
+    warnParagraphBox := box addCheckBox:(resources string:'Paragraphs in Identifiers') on:warnParagraph.
+    warnParagraphBox width:0.4.
+
     warnUnusedVarsBox := box addCheckBox:(resources string:'Unused Method Variables') on:warnUnusedVars.
     warnUnusedVarsBox width:0.4.
 
@@ -3590,7 +3602,7 @@
 
     "Modified: / 10-09-1995 / 19:19:18 / claus"
     "Modified: / 09-09-1996 / 22:42:47 / stefan"
-    "Modified: / 26-09-2012 / 14:16:39 / cg"
+    "Modified: / 16-11-2016 / 22:37:24 / cg"
 !
 
 displaySettings
@@ -7220,6 +7232,106 @@
     super release
 ! !
 
+!AbstractLauncherApplication::PackageLoadDialog methodsFor:'menu'!
+
+itemMenu
+    |item m itemType package defClass|
+
+    hierarchicalListView selectionValue notEmptyOrNil ifTrue:[
+        item := hierarchicalListView selectionValue first.
+
+        itemType := item type.
+        ( 
+            #( #localRoot #monticelloRoot #compiledPackagesRoot ) includes:itemType
+        ) ifFalse:[
+
+            package := packageIdByItem at:item ifAbsent:nil.
+            package notNil ifTrue:[
+                defClass := package asPackageId projectDefinitionClass.
+            ].
+
+            m := Menu new.
+            m addItem:(MenuItem 
+                        label: (resources string:'Load')
+                        itemValue: 
+                            [
+                                package notNil ifTrue:[
+                                    self loadPackageAndUpdate:package browse:false subPackages:false item:item.
+                                    "/ loadPackageAndUpdate value:package value:false value:item.
+                                ].
+                            ]
+                        enabled:package notNil).
+            m addItem:(MenuItem 
+                        label: (resources string:'Load with All Subpackages')
+                        itemValue: 
+                            [
+                                package notNil ifTrue:[
+                                    self loadPackageAndUpdate:package browse:false subPackages:true item:item.
+                                    "/ loadPackageAndUpdate value:package value:false value:item.
+                                ].
+                            ]
+                        enabled:package notNil).
+            m addItem:(MenuItem 
+                        label: (resources string:'Load PackageDefinition Only')
+                        itemValue: 
+                            [
+                                package notNil ifTrue:[
+                                    self loadPackageDefinition:package browse:false subPackages:false item:item.
+                                ].
+                            ]
+                        enabled:package notNil).
+            m addSeparator. 
+            m addItem:(MenuItem 
+                        label: (resources string:'Open File Browser on Package''s Folder')
+                        itemValue: 
+                            [
+                                |dir|
+
+                                package notNil ifTrue:[
+                                    dir := Smalltalk packageDirectoryForPackageId:package.
+                                    dir notNil ifTrue:[
+                                        FileBrowser default openOn:dir.
+                                    ] ifFalse:[
+                                        Dialog warn:(resources string:'Directory not present/readable: "%1"' with:dir)
+                                    ]
+                                ].
+                            ]
+                        enabled:package notNil).
+            m addSeparator. 
+            m addItem:(MenuItem 
+                        label: (resources string:'Browse Package Definition')
+                        itemValue: 
+                            [
+                                defClass notNil ifTrue:[
+                                    SystemBrowser default openInClass:defClass class
+                                ].
+                            ]
+                        enabled:defClass notNil).
+            m addItem:(MenuItem 
+                        label: (resources string:'Browse Package')
+                        itemValue: 
+                            [
+                                Tools::NewSystemBrowser openOnPackage:package
+                            ]
+                        enabled:defClass notNil).
+
+            item type == #monticelloPackage ifTrue:[
+                m addItem:(MenuItem 
+                            label: (resources string:'Browse Monticello Package')
+                            itemValue: [
+                                |repos|
+
+                                repos := item parent info.                    
+                                MCRepositoryBrowser openOnRepository:repos forPackage:item label.
+                            ]).
+            ].
+        ].
+    ].
+    ^ m
+
+    "Modified: / 18-11-2016 / 11:11:07 / cg"
+! !
+
 !AbstractLauncherApplication::PackageLoadDialog methodsFor:'opening'!
 
 openLoadPackageDialog
@@ -7521,95 +7633,8 @@
             ].
 !
 
-itemMenu
-    |item m itemType package defClass|
-
-    hierarchicalListView selectionValue notEmptyOrNil ifTrue:[
-        item := hierarchicalListView selectionValue first.
-
-        itemType := item type.
-        ( 
-            #( #localRoot #monticelloRoot #compiledPackagesRoot ) includes:itemType
-        ) ifFalse:[
-
-            package := packageIdByItem at:item ifAbsent:nil.
-            package notNil ifTrue:[
-                defClass := package asPackageId projectDefinitionClass.
-            ].
-
-            m := Menu new.
-            m addItem:(MenuItem 
-                        label: (resources string:'Load')
-                        itemValue: 
-                            [
-                                package notNil ifTrue:[
-                                    self loadPackageAndUpdate:package browse:false subPackages:false item:item.
-                                    "/ loadPackageAndUpdate value:package value:false value:item.
-                                ].
-                            ]
-                        enabled:package notNil).
-            m addItem:(MenuItem 
-                        label: (resources string:'Load with All Subpackages')
-                        itemValue: 
-                            [
-                                package notNil ifTrue:[
-                                    self loadPackageAndUpdate:package browse:false subPackages:true item:item.
-                                    "/ loadPackageAndUpdate value:package value:false value:item.
-                                ].
-                            ]
-                        enabled:package notNil).
-            m addSeparator. 
-            m addItem:(MenuItem 
-                        label: (resources string:'Open File Browser on Package''s Folder')
-                        itemValue: 
-                            [
-                                |dir|
-
-                                package notNil ifTrue:[
-                                    dir := Smalltalk getPackageDirectoryForPackage:package.
-                                    dir notNil ifTrue:[
-                                        FileBrowser default openOn:dir.
-                                    ] ifFalse:[
-                                        Dialog warn:(resources string:'Directory not present/readable: "%1"' with:dir)
-                                    ]
-                                ].
-                            ]
-                        enabled:package notNil).
-            m addSeparator. 
-            m addItem:(MenuItem 
-                        label: (resources string:'Browse Package Definition')
-                        itemValue: 
-                            [
-                                defClass notNil ifTrue:[
-                                    SystemBrowser default openInClass:defClass class
-                                ].
-                            ]
-                        enabled:defClass notNil).
-            m addItem:(MenuItem 
-                        label: (resources string:'Browse Package')
-                        itemValue: 
-                            [
-                                Tools::NewSystemBrowser openOnPackage:package
-                            ]
-                        enabled:defClass notNil).
-
-            item type == #monticelloPackage ifTrue:[
-                m addItem:(MenuItem 
-                            label: (resources string:'Browse Monticello Package')
-                            itemValue: [
-                                |repos|
-
-                                repos := item parent info.                    
-                                MCRepositoryBrowser openOnRepository:repos forPackage:item label.
-                            ]).
-            ].
-        ].
-    ].
-    ^ m
 
     "Modified: / 28-06-2016 / 07:55:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 loadAction:doBrowse 
     "the button's load action"
     
@@ -7705,6 +7730,74 @@
     ].
 !
 
+loadPackageDefinition:package browse:doBrowse subPackages:subPackages item:someItem
+    |defClass updateAction|
+
+    self withWaitCursorDo:[
+        updateAction := 
+            [:whatChanged :parameter | 
+                self updateAction:whatChanged parameter:parameter
+            ].
+            
+        Smalltalk onChangeSend:#value:value: to:updateAction.
+        [
+            |packageTried dir className fileName|
+
+            packageTried := package.
+            ((package includes:$:) not and:[(package includes:$/) not]) ifTrue:[
+                packageTried := package,':'
+            ].        
+
+            dir := Smalltalk packageDirectoryForPackageId:package.
+            dir notNil ifTrue:[
+                "/ is there a project definition class's source?
+                className := ProjectDefinition projectDefinitionClassNameForDefinitionOf:package.
+                fileName := dir / ((Smalltalk fileNameForClass:className),'.st').
+                fileName exists ifTrue:[
+                    Smalltalk fileIn:fileName.
+                ] ifFalse:[
+                    Dialog warn:(resources string:'Project definition class file not present: "%1"' with:fileName)
+                ]
+            ] ifFalse:[
+                Dialog warn:(resources string:'Directory not present/readable: "%1"' with:dir)
+            ]
+        ] ensure:[
+            Smalltalk retractInterestsFor:updateAction.
+        ].
+    ].
+    ((defClass := package asPackageId projectDefinitionClass) notNil
+        and:[ defClass isLoaded ])
+    ifFalse:[
+        defClass isNil ifTrue:[
+            Dialog warn:(resources string:'Load failed: definition class for packageID (%1) not present after package load.' with:package)
+        ]
+    ] ifTrue:[
+        doBrowse ifTrue:[
+            Tools::NewSystemBrowser openOnPackage:package
+        ].
+"/        someItem icon == packageIcon ifTrue:[
+"/            someItem icon:greyPackageIcon.
+"/            someItem label:(someItem label , alreadyLoadedString).
+"/        ] ifFalse:[
+"/            someItem icon == applicationIcon ifTrue:[
+"/                someItem icon:greyApplicationIcon.
+"/                someItem label:(someItem label , alreadyLoadedString).
+"/            ].
+"/        ].
+    ].
+    
+    subPackages ifTrue:[
+        someItem children do:[:eachChild |
+            |subPackageID|
+
+            subPackageID := packageIdByItem at:eachChild.
+            self loadPackageAndUpdate:subPackageID browse:false subPackages:true item:eachChild.
+        ].
+    ].
+
+    "Created: / 18-11-2016 / 11:13:03 / cg"
+!
+
 readOtherPackageTrees
     |packagePath|