Skip to content

Commit

Permalink
Merge pull request #2500 from moosetechnology/welcome
Browse files Browse the repository at this point in the history
New welcome browser for P11
  • Loading branch information
ClotildeToullec authored Aug 18, 2023
2 parents 7eccc9d + 5dae69d commit 06d05b5
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: set-version
run: |
ls -l $SMALLTALK_CI_VM
$SMALLTALK_CI_VM $SMALLTALK_CI_IMAGE eval --save "MooseVersion current commitHash: '$GITHUB_SHA'. Smalltalk at: #HelpBrowser ifPresent: [ :helpClass | helpClass allInstances do: #close. MooseWelcome openForRelease ]"
$SMALLTALK_CI_VM $SMALLTALK_CI_IMAGE eval --save "MooseVersion current commitHash: '$GITHUB_SHA'. (Smalltalk toolNamed: #mooseWelcome) closePharoWelcomeThenOpen"
- name: rename
run: |
Expand Down
43 changes: 30 additions & 13 deletions src/BaselineOfMoose/BaselineOfMoose.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,29 @@ Class {
BaselineOfMoose >> baseline: spec [

<baseline>
spec for: #common do: [
spec for: #common do: [
self
famix: spec;
famixTagging: spec;
famixReplication: spec;
famixReplication: spec;
mooseEasy: spec;
mooseIDE: spec;
neoCSV: spec.

spec
package: 'Moose-MenuBar' with: [
package: 'Moose-MenuBar' with: [
spec requires:
#( 'Famix' 'FamixTagging' 'FamixReplication'
'NeoCSV' 'MooseIDE' ) ];
#( 'Famix' 'FamixTagging' 'FamixReplication' 'NeoCSV' 'MooseIDE' ) ];
package: 'Moose-Configuration';
package: 'Moose-Help';
package: 'Famix-Visualizations' ]
]
package: 'Famix-Visualizations' ].

spec for: #( #'pharo10.x' #'pharo9.x' #'pharo8.x' ) do: [
spec package: 'Moose-Help-ToRemove'.
spec postLoadDoIt: #registerMooseWelcome ].

{ #category : #baseline }
BaselineOfMoose >> customProjectAttributes [
^ (Smalltalk classNamed: 'StInspector')
ifNotNil: [ #( #NewTools ) ]
ifNil: [ #( ) ]
spec for: #'pharo11.x' do: [
spec package: 'Moose-WelcomeBrowser'.
spec postLoadDoIt: #registerMooseWelcomeBrowser ]
]

{ #category : #dependencies }
Expand Down Expand Up @@ -83,3 +82,21 @@ BaselineOfMoose >> neoCSV: spec [
BaselineOfMoose >> projectClass [
^ MetacelloCypressBaselineProject
]

{ #category : #actions }
BaselineOfMoose >> registerMooseWelcome [
"For Pharo 10 and before"

Smalltalk
at: #MooseWelcome
ifPresent: [ :mooseWelcome | mooseWelcome register ]
]

{ #category : #actions }
BaselineOfMoose >> registerMooseWelcomeBrowser [
"For Pharo 11 and after"

Smalltalk
at: #MooseWelcomeBrowser
ifPresent: [ :mooseWelcome | mooseWelcome register ]
]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Class {
#classInstVars : [
'current'
],
#category : #'Moose-Help'
#category : #'Moose-Configuration'
}

{ #category : #accessing }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ I am the welcome window that opens when a Moose image
Class {
#name : #MooseWelcome,
#superclass : #CustomHelp,
#category : #'Moose-Help'
#category : #'Moose-Help-ToRemove'
}

{ #category : #accessing }
Expand All @@ -13,6 +13,14 @@ MooseWelcome class >> bookName [
^ 'Moose Tutorial'
]

{ #category : #'as yet unclassified' }
MooseWelcome class >> closePharoWelcomeThenOpen [

HelpBrowser allInstancesDo: [ :browser |
browser withWindowDo: #close ].
self openForRelease
]

{ #category : #pages }
MooseWelcome class >> mainTools [

Expand Down Expand Up @@ -90,6 +98,22 @@ MooseWelcome class >> pages [
^ #( welcome mainTools )
]

{ #category : #'tools registry' }
MooseWelcome class >> register [
"Add ourselves to registry. See [Smalltalk tools]"
<script>

self registerToolsOn: Smalltalk tools
]

{ #category : #'tools registry' }
MooseWelcome class >> registerToolsOn: registry [
"Add ourselves to registry. See [Smalltalk tools]"

registry register: self as: #mooseWelcome

]

{ #category : #pages }
MooseWelcome class >> welcome [

Expand Down
1 change: 1 addition & 0 deletions src/Moose-Help-ToRemove/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Moose-Help-ToRemove' }
52 changes: 0 additions & 52 deletions src/Moose-Help/MooseOnlineDocumentationMenuCommand.class.st

This file was deleted.

1 change: 0 additions & 1 deletion src/Moose-Help/package.st

This file was deleted.

160 changes: 160 additions & 0 deletions src/Moose-WelcomeBrowser/MooseWelcomeBrowser.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
"
A welcome browser for the Moose environment.
See superclass for more implementation details
"
Class {
#name : #MooseWelcomeBrowser,
#superclass : #StWelcomeBrowser,
#category : #'Moose-WelcomeBrowser'
}

{ #category : #'instance creation' }
MooseWelcomeBrowser class >> closePharoWelcomeThenOpen [

self superclass allInstancesDo: [ :browser |
browser withWindowDo: #close ].
self openForRelease
]

{ #category : #accessing }
MooseWelcomeBrowser class >> logo [

^ Form fromBinaryStream:
MooseConfiguration mooseLogoContents base64Decoded readStream
]

{ #category : #'instance creation' }
MooseWelcomeBrowser class >> open [

<script>
self new open
]

{ #category : #'instance creation' }
MooseWelcomeBrowser class >> openForRelease [
<script>
| window |

window := self new open.
"HACK: reset extent and position because it seems to not being taken
into account before opening. Using directly the morphic widget, as we
know we are still in morphic world."
window withAdapterDo: [ :anAdapter |
anAdapter widget
position: (((self environment classNamed: #OSWorldRenderer) defaultExtent - self windowExtent) / 2) asIntegerPoint;
extent: self windowExtent ]
]

{ #category : #finalization }
MooseWelcomeBrowser class >> register [
"Add ourselves to registry. See [Smalltalk tools]"
<script>

self registerToolsOn: Smalltalk tools
]

{ #category : #finalization }
MooseWelcomeBrowser class >> registerToolsOn: registry [
"Add ourselves to registry. See [Smalltalk tools]"

registry register: self as: #mooseWelcome

]

{ #category : #'accessing - labels' }
MooseWelcomeBrowser >> mainToolsContent [

^ '# Main Moose tools
Some suggestions on what you can do with Moose.
### Starting
First, use the model browser to create or load an internal model of a system:
```pharoeval
MiModelRootBrowser open
```
You will need to ''Propagate'' this model to other tools.
Then, you can inspect the content of your model:
```pharoeval
MiInspectorBrowser open
```
Keep an eye on opened tools with the Overview browser:
```pharoeval
MiOverviewBrowser open
```
### Manipulating
You can select specific entities in a model with the Query browser:
```pharoeval
MiQueriesBrowser open
```
You can also annotate entities with the Tag browser:
```pharoeval
MiTagBrowser open
```
### Visualization
There are various visualizations available on different kind of entities:
Architectural browser:
```pharoeval
MiArchitecturalMapBrowser open
```
CoUsage map browser:
```pharoeval
MiCoUsageMapBrowser open
```'
]

{ #category : #'accessing - labels' }
MooseWelcomeBrowser >> mainToolsLabel [

^ 'Main tools'
]

{ #category : #private }
MooseWelcomeBrowser >> topics [

^ {
(self
newTopicTitle: self welcomeLabel
contents: self welcomeContent).
(self
newTopicTitle: self mainToolsLabel
contents: self mainToolsContent) }
]

{ #category : #'accessing - contents' }
MooseWelcomeBrowser >> welcomeContent [

| version |
version := MooseVersion current.

^ '
# Welcome to Moose {1}
![test](pharo:///MooseWelcomeBrowser/logo)
Moose is a platform for software analysis.
It allows to represent software system in a model, to query, manipulate, transform, visualize this model.
Moose is based on Pharo and it''s open source under BSD/MIT.
For more information, please visit online documentation: [modularmoose.org](https://modularmoose.org/moose-wiki/).
Version {2}. Commit: [{3}](https://github.com/moosetechnology/Moose/commit/{4})'
format: {
version major.
version versionNumber.
(version commitHash first: 7).
version commitHash }
]

{ #category : #'accessing - labels' }
MooseWelcomeBrowser >> welcomeLabel [

^ 'Welcome to Moose ' , MooseVersion current major
]
1 change: 1 addition & 0 deletions src/Moose-WelcomeBrowser/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Moose-WelcomeBrowser' }

0 comments on commit 06d05b5

Please sign in to comment.