diff --git a/src/Spec2-Core/SpApplication.class.st b/src/Spec2-Core/SpApplication.class.st index 6c847e66..7ef709a6 100644 --- a/src/Spec2-Core/SpApplication.class.st +++ b/src/Spec2-Core/SpApplication.class.st @@ -109,16 +109,6 @@ SpApplication >> adapterBindings [ ^ self backend adapterBindings ] -{ #category : 'ui - dialogs' } -SpApplication >> alert: aString [ - "Displays an inform dialog, for more configurable version please use `self application newInform title: ....`." - - ^ self newAlert - title: 'Alert'; - label: aString; - openModal -] - { #category : 'accessing - backend' } SpApplication >> backend [ @@ -150,16 +140,6 @@ SpApplication >> configuration [ configuration ] ] -{ #category : 'ui - dialogs' } -SpApplication >> confirm: aString [ - "Displays a confirm dialog, for more configurable version please use `self application newConfirm title: ....`." - - ^ self newConfirm - title: 'Please confirm'; - label: aString; - openModal -] - { #category : 'showing' } SpApplication >> defaultBlockedDialogWindowPresenterClass [ @@ -251,16 +231,6 @@ SpApplication >> iconProvider: anIconProvider [ iconProvider := anIconProvider ] -{ #category : 'ui - dialogs' } -SpApplication >> inform: aString [ - "Displays an inform dialog, for more configurable version please use `self application newInform title: ....`." - - ^ self newInform - title: 'Alert'; - label: aString; - openModal -] - { #category : 'accessing' } SpApplication >> locale [ @@ -292,18 +262,6 @@ SpApplication >> notificationCenter [ ^ notificationCenter ifNil: [ notificationCenter := SpNotificationCenter new forApplication: self; yourself ] ] -{ #category : 'ui - dialogs' } -SpApplication >> notificationClass [ - - ^ SpNotificationItem -] - -{ #category : 'ui - dialogs' } -SpApplication >> notify: aString [ - - self notificationCenter add: (self notificationClass with: aString) -] - { #category : 'accessing - properties' } SpApplication >> properties [ @@ -386,18 +344,6 @@ SpApplication >> run [ self start ] -{ #category : 'ui - dialogs' } -SpApplication >> selectDirectoryTitle: aString [ - - ^ self backend selectDirectoryTitle: aString -] - -{ #category : 'ui - dialogs' } -SpApplication >> selectFileTitle: aString [ - - ^ self backend selectFileTitle: aString -] - { #category : 'ui' } SpApplication >> showWaitCursorWhile: aBlock [ diff --git a/src/Spec2-Dialogs/SpApplication.extension.st b/src/Spec2-Dialogs/SpApplication.extension.st index 9b6c0099..1f785a74 100644 --- a/src/Spec2-Dialogs/SpApplication.extension.st +++ b/src/Spec2-Dialogs/SpApplication.extension.st @@ -1,5 +1,42 @@ Extension { #name : 'SpApplication' } +{ #category : '*Spec2-Dialogs' } +SpApplication >> alert: aString [ + "Displays an inform dialog, for more configurable version please use `self application newInform title: ....`." + + ^ self newAlert + title: 'Alert'; + label: aString; + openModal +] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> confirm: aString [ + "Displays a confirm dialog, for more configurable version please use `self application newConfirm title: ....`." + + ^ self newConfirm + title: 'Please confirm'; + label: aString; + openModal +] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> inform: aString [ + "Displays an inform dialog, for more configurable version please use `self application newInform title: ....`." + + ^ self newInform + title: 'Alert'; + label: aString; + openModal +] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> informUser: aString during: aBlock [ + "Display a message during execution of the given block." + + ^ self newProgress informUser: aString during: aBlock +] + { #category : '*Spec2-Dialogs' } SpApplication >> newAlert [ @@ -25,13 +62,9 @@ SpApplication >> newJobList [ ] { #category : '*Spec2-Dialogs' } -SpApplication >> newProgress [ +SpApplication >> newProgress [ - self - deprecated: 'Use #newJobList' - transformWith: '`@receiver newProgress' - -> '`@receiver newJobList'. - ^ SpJobListPresenter newApplication: self + ^ SpProgressDialog new ] { #category : '*Spec2-Dialogs' } @@ -51,3 +84,27 @@ SpApplication >> newSelect [ ^ SpSelectDialog newApplication: self ] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> notificationClass [ + + ^ SpNotificationItem +] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> notify: aString [ + + self notificationCenter add: (self notificationClass with: aString) +] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> selectDirectoryTitle: aString [ + + ^ self backend selectDirectoryTitle: aString +] + +{ #category : '*Spec2-Dialogs' } +SpApplication >> selectFileTitle: aString [ + + ^ self backend selectFileTitle: aString +] diff --git a/src/Spec2-Dialogs/SpNotificationCenterPresenter.class.st b/src/Spec2-Dialogs/SpNotificationCenterPresenter.class.st index b0b9d5f5..e2828556 100644 --- a/src/Spec2-Dialogs/SpNotificationCenterPresenter.class.st +++ b/src/Spec2-Dialogs/SpNotificationCenterPresenter.class.st @@ -1,15 +1,16 @@ Class { - #name : #SpNotificationCenterPresenter, - #superclass : #SpPresenterWithModel, + #name : 'SpNotificationCenterPresenter', + #superclass : 'SpPresenterWithModel', #instVars : [ 'itemList', 'descriptionText', 'clearButton' ], - #category : #'Spec2-Dialogs' + #category : 'Spec2-Dialogs', + #package : 'Spec2-Dialogs' } -{ #category : #examples } +{ #category : 'examples' } SpNotificationCenterPresenter class >> example2 [ @@ -21,14 +22,14 @@ SpNotificationCenterPresenter class >> example2 [ "1 to: 10 do: [ :each | app notify: each printString ]" ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotificationCenterPresenter >> clearNotificationsAction [ itemList items: OrderedCollection new. descriptionText text: ' No notification ' ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotificationCenterPresenter >> connectPresenters [ "Why this is not working @@ -38,7 +39,7 @@ SpNotificationCenterPresenter >> connectPresenters [ ] -{ #category : #layout } +{ #category : 'layout' } SpNotificationCenterPresenter >> defaultLayout [ | upperLayout lowerLayout | @@ -56,7 +57,7 @@ SpNotificationCenterPresenter >> defaultLayout [ yourself ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotificationCenterPresenter >> initializePresenters [ itemList := self newList @@ -70,20 +71,20 @@ SpNotificationCenterPresenter >> initializePresenters [ yourself ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotificationCenterPresenter >> initializeWindow: aWindowPresenter [ aWindowPresenter title: 'Notifications' ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotificationCenterPresenter >> modelChanged [ itemList items: announcingObject value items. itemList selectFirst ] -{ #category : #updating } +{ #category : 'updating' } SpNotificationCenterPresenter >> updatePresenter [ self modelChanged