Skip to content

Commit

Permalink
Merge pull request #581 from pharo-spec/reduceUIManagerDependency
Browse files Browse the repository at this point in the history
Remove UIManager dependencies!
  • Loading branch information
Ducasse authored Sep 6, 2023
2 parents cb70ac0 + a258f3c commit c1c65e8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ StSingleCritiqueResultListPresenter >> updateList [

| delay |
self critiquesOf: rule.
delay := [ UIManager default defer: [ critiquesModel updateList ] ]
delay := [ self defer: [ critiquesModel updateList ] ]
schedule
]

Expand Down
15 changes: 9 additions & 6 deletions src/NewTools-Debugger/StDebugger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1070,10 +1070,11 @@ StDebugger >> requestSuperclassOf: aClass to: aSuperclass [
classes addAll:
(aClass traits sort: [ :t1 :t2 | t1 asString < t2 asString ]).
classes size = 1 ifTrue: [ ^ classes first ].
^ (UIManager default
chooseFrom: (classes collect: [ :c | c name ])
values: classes
title: 'Define selector in:') ifNil: [ Abort signal ]
^ (self application newSelect
display: [ :each | each name ];
item: classes;
title: 'Define selector in:';
openModal) ifNil: [ Abort signal ]
]

{ #category : #actions }
Expand All @@ -1089,8 +1090,10 @@ StDebugger >> restartCurrentContext [
StDebugger >> returnEnteredValue [
| expression |
self flag: #DBG_HowToTestNilIfUserCancels.
expression := (UIManager default
request: 'Enter expression for return value:') ifNil: [^self].
expression := (self application newRequest
title: 'Enter expression for return value:';
openModal
) ifNil: [^self].
self debuggerActionModel
returnValueFromExpression: expression
fromContext: self currentContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ StMessageBrowserPresenter >> autoSelect: aSelector [
{ #category : #announcements }
StMessageBrowserPresenter >> classRenamed: anAnnouncement [
"this method forces the announcement to be handled in the UI process"
UIManager default defer: [
self defer: [
self handleClassRenamed: anAnnouncement ]
]

Expand Down Expand Up @@ -346,7 +346,7 @@ StMessageBrowserPresenter >> messages: aCollection [
{ #category : #announcements }
StMessageBrowserPresenter >> methodAdded: anAnnouncement [
"this method forces the announcement to be handled in the UI process"
UIManager default defer: [
self defer: [
self handleMethodAdded: anAnnouncement ]
]

Expand All @@ -358,14 +358,14 @@ StMessageBrowserPresenter >> methodClassNameForItem: anItem [
{ #category : #announcements }
StMessageBrowserPresenter >> methodModified: anAnnouncement [
"this method forces the announcement to be handled in the UI process"
UIManager default defer: [
self defer: [
self handleMethodModified: anAnnouncement ]
]

{ #category : #announcements }
StMessageBrowserPresenter >> methodRemoved: anAnnouncement [
"this method forces the announcement to be handled in the UI process"
UIManager default defer: [
self defer: [
self handleMethodRemoved: anAnnouncement ]
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ StVersionBrowserPresenter >> compareToOtherVersion [
| labels versions index selected |
versions := self changeList.
labels := versions collect: [ :each | each stamp ].
index := UIManager default chooseFrom: labels.
index := self application newSelect title: 'Select a version'; item: labels; openModal.
index > 0 ifFalse: [ ^ self ].
selected := versions at: index.
self compareTo: selected withLabel: selected stamp
Expand Down
8 changes: 4 additions & 4 deletions src/NewTools-Spotter/StSpotter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ StSpotter >> feedTip [
{ #category : #'private - updating' }
StSpotter >> flushPendingUpdates [

self application defer: [
self defer: [
self model schedule: [
mutex critical: [
[
Expand Down Expand Up @@ -440,7 +440,7 @@ StSpotter >> headerCategoryUnifiedFor: aLink [
{ #category : #'private - actions' }
StSpotter >> hideSpinner [

self application defer: [ spinner hide ]
self defer: [ spinner hide ]
]

{ #category : #'private - actions' }
Expand Down Expand Up @@ -771,7 +771,7 @@ StSpotter >> showSpinner [

spinner isVisible ifTrue: [ ^ self ].
self model schedule: [
self application defer: [ spinner show ]]
self defer: [ spinner show ]]
]

{ #category : #processing }
Expand Down Expand Up @@ -882,7 +882,7 @@ StSpotter >> updateResultList: aCandidateLink [
{ #category : #'private - updating' }
StSpotter >> updateResultProcessor: processor amount: amount [

self application defer: [
self defer: [
categories
at: processor
ifPresent: [ :aPresenter | aPresenter finalAmount: amount ] ]
Expand Down

0 comments on commit c1c65e8

Please sign in to comment.