From a258f3c1c18685c9e6d0d99d9d2e608a0deba617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Tue, 5 Sep 2023 22:12:20 +0200 Subject: [PATCH] Remove UIManager dependencies!confirm: -> 5 activate done alert:title: -> 1 defer: inform: request: -> 1 request:initialAnswer: -> 7 chooseFrom:values:title: -> 2 chooseDirectoryFrom: -> 1 All the other ones will be treated in separate PRs because I do not know how to treat them now. --- .../StSingleCritiqueResultListPresenter.class.st | 2 +- src/NewTools-Debugger/StDebugger.class.st | 15 +++++++++------ .../StMessageBrowserPresenter.class.st | 8 ++++---- .../StVersionBrowserPresenter.class.st | 2 +- src/NewTools-Spotter/StSpotter.class.st | 8 ++++---- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/NewTools-CodeCritiques/StSingleCritiqueResultListPresenter.class.st b/src/NewTools-CodeCritiques/StSingleCritiqueResultListPresenter.class.st index 3bc192b8b..76f334f8a 100644 --- a/src/NewTools-CodeCritiques/StSingleCritiqueResultListPresenter.class.st +++ b/src/NewTools-CodeCritiques/StSingleCritiqueResultListPresenter.class.st @@ -465,7 +465,7 @@ StSingleCritiqueResultListPresenter >> updateList [ | delay | self critiquesOf: rule. - delay := [ UIManager default defer: [ critiquesModel updateList ] ] + delay := [ self defer: [ critiquesModel updateList ] ] schedule ] diff --git a/src/NewTools-Debugger/StDebugger.class.st b/src/NewTools-Debugger/StDebugger.class.st index 68a94c42c..e55b36ed8 100644 --- a/src/NewTools-Debugger/StDebugger.class.st +++ b/src/NewTools-Debugger/StDebugger.class.st @@ -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 } @@ -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 diff --git a/src/NewTools-MethodBrowsers/StMessageBrowserPresenter.class.st b/src/NewTools-MethodBrowsers/StMessageBrowserPresenter.class.st index beced233d..f07d384bb 100644 --- a/src/NewTools-MethodBrowsers/StMessageBrowserPresenter.class.st +++ b/src/NewTools-MethodBrowsers/StMessageBrowserPresenter.class.st @@ -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 ] ] @@ -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 ] ] @@ -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 ] ] diff --git a/src/NewTools-MethodBrowsers/StVersionBrowserPresenter.class.st b/src/NewTools-MethodBrowsers/StVersionBrowserPresenter.class.st index 49bbb4e74..d2d08c5c6 100644 --- a/src/NewTools-MethodBrowsers/StVersionBrowserPresenter.class.st +++ b/src/NewTools-MethodBrowsers/StVersionBrowserPresenter.class.st @@ -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 diff --git a/src/NewTools-Spotter/StSpotter.class.st b/src/NewTools-Spotter/StSpotter.class.st index 1a29dc9c7..07a13a8cf 100644 --- a/src/NewTools-Spotter/StSpotter.class.st +++ b/src/NewTools-Spotter/StSpotter.class.st @@ -397,7 +397,7 @@ StSpotter >> feedTip [ { #category : #'private - updating' } StSpotter >> flushPendingUpdates [ - self application defer: [ + self defer: [ self model schedule: [ mutex critical: [ [ @@ -440,7 +440,7 @@ StSpotter >> headerCategoryUnifiedFor: aLink [ { #category : #'private - actions' } StSpotter >> hideSpinner [ - self application defer: [ spinner hide ] + self defer: [ spinner hide ] ] { #category : #'private - actions' } @@ -771,7 +771,7 @@ StSpotter >> showSpinner [ spinner isVisible ifTrue: [ ^ self ]. self model schedule: [ - self application defer: [ spinner show ]] + self defer: [ spinner show ]] ] { #category : #processing } @@ -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 ] ]