Skip to content

Commit

Permalink
Merge pull request pharo-spec#671 from pharo-spec/dev-2.0
Browse files Browse the repository at this point in the history
latest changes
  • Loading branch information
estebanlm authored Jan 30, 2024
2 parents 4d63680 + 0a638a2 commit a47153b
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/NewTools-Core/StPharoApplication.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ StPharoApplication >> defaultWindowExtent [
StPharoApplication >> initialize [

super initialize.
self initializeConfiguration
]

{ #category : 'initialization' }
StPharoApplication >> initializeConfiguration [

self resetConfiguration.
SystemAnnouncer uniqueInstance weak
when: UIThemeChanged
Expand All @@ -74,14 +80,13 @@ StPharoApplication >> newIconProvider [
{ #category : 'initialization' }
StPharoApplication >> resetConfiguration [

self flag: #TODO. "Invalidating for a moment because I need to align with Spec"
self configuration reset
]

{ #category : 'running' }
StPharoApplication >> run [

Current ifNotNil: [ Current close ].
Current ifNotNil: [ Current closeAllWindows ].
super run.
Current := self
]
Expand Down
83 changes: 83 additions & 0 deletions src/NewTools-Core/StPharoJobManager.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
"
This is a JobManager to work with the Jobs package.
This manager will listen to the announcer and fire the events as it corresponds, allowing the user to interact with the joblist tool.
"
Class {
#name : 'StPharoJobManager',
#superclass : 'Object',
#category : 'NewTools-Core-Application',
#package : 'NewTools-Core',
#tag : 'Application'
}

{ #category : 'private' }
StPharoJobManager class >> application [

self flag: #TODO. "Not cool, but well... better than extend the StPharoApplication.
At least this side is contained."
^ StPharoApplication current
]

{ #category : 'accessing' }
StPharoJobManager class >> disable [
<script>

Job jobAnnouncer unsubscribe: self
]

{ #category : 'accessing' }
StPharoJobManager class >> enable [
<script>

Job jobAnnouncer
when: JobStart send: #jobStart: to: self;
when: JobChange send: #jobChanged: to: self;
when: JobEnd send: #jobEnd: to: self
]

{ #category : 'class initialization' }
StPharoJobManager class >> initialize [

self enable
]

{ #category : 'private' }
StPharoJobManager class >> isHeadless [

"this is a huge hack to know if we are running with an UI or not.
I need it because this Jobs are created all around the world, and I need
a control point."
^ Smalltalk isInteractiveGraphic not
]

{ #category : 'private - events' }
StPharoJobManager class >> jobChanged: ann [

self isHeadless ifTrue: [ ^ self ].
self jobList jobChanged: ann
]

{ #category : 'private - events' }
StPharoJobManager class >> jobEnd: ann [

self isHeadless ifTrue: [ ^ self ].
self jobList jobEnd: ann.
"this is just a cleanup... because jobs may leak!"
self jobList isEmpty
ifTrue: [ self application removeProperty: #jobList ]
]

{ #category : 'private' }
StPharoJobManager class >> jobList [

^ self application jobList
]

{ #category : 'private - events' }
StPharoJobManager class >> jobStart: ann [

self isHeadless ifTrue: [ ^ self ].
self jobList jobStart: ann
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'ClyClassReferencesQuery' }

{ #category : '*NewTools-MethodBrowsers' }
ClyClassReferencesQuery >> queryElement [

^ self printVariables
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'ClyConstantMethodQuery' }

{ #category : '*NewTools-MethodBrowsers' }
ClyConstantMethodQuery >> queryElement [

^ self description
]
7 changes: 7 additions & 0 deletions src/NewTools-MethodBrowsers/ClyMessageBasedQuery.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'ClyMessageBasedQuery' }

{ #category : '*NewTools-MethodBrowsers' }
ClyMessageBasedQuery >> queryElement [

^ self selectors anyOne
]
7 changes: 7 additions & 0 deletions src/NewTools-MethodBrowsers/ClyQuery.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'ClyQuery' }

{ #category : '*NewTools-MethodBrowsers' }
ClyQuery >> queryElement [

^ nil
]

0 comments on commit a47153b

Please sign in to comment.