From 66defecf66675707642388f117cf0b63430df3e4 Mon Sep 17 00:00:00 2001 From: DEMAREY Christophe Date: Thu, 30 May 2024 11:20:15 +0200 Subject: [PATCH 1/4] fix bad label before first progress event. fixes #1550 --- src/Spec2-Dialogs/SpProgressDialog.class.st | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Spec2-Dialogs/SpProgressDialog.class.st b/src/Spec2-Dialogs/SpProgressDialog.class.st index 5997d79e..c54791ec 100644 --- a/src/Spec2-Dialogs/SpProgressDialog.class.st +++ b/src/Spec2-Dialogs/SpProgressDialog.class.st @@ -100,7 +100,8 @@ SpProgressDialog >> initializePresenters [ borderWidth: 5; add: (label := self newLabel) expand: false; add: (progressBar := self newProgressBar) expand: false; - yourself) + yourself). + self progressPercent: 0. ] { #category : 'accessing' } From 280ec85a98a7aa2b6dc5a49d73314cf14a5271b7 Mon Sep 17 00:00:00 2001 From: DEMAREY Christophe Date: Thu, 13 Jun 2024 10:13:42 +0200 Subject: [PATCH 2/4] withWindowDo: should return the result of the block --- src/Spec2-Core/SpAbstractPresenter.class.st | 2 +- src/Spec2-Core/SpStringTableColumn.class.st | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Spec2-Core/SpAbstractPresenter.class.st b/src/Spec2-Core/SpAbstractPresenter.class.st index a64a1f6a..ae668bed 100644 --- a/src/Spec2-Core/SpAbstractPresenter.class.st +++ b/src/Spec2-Core/SpAbstractPresenter.class.st @@ -550,5 +550,5 @@ SpAbstractPresenter >> withWindowDo: aValuable [ self hasWindow ifFalse: [ ^ self ]. "Since Presenter has window, root = window" - aValuable value: self root + ^ aValuable value: self root ] diff --git a/src/Spec2-Core/SpStringTableColumn.class.st b/src/Spec2-Core/SpStringTableColumn.class.st index 730826b5..d68995f7 100644 --- a/src/Spec2-Core/SpStringTableColumn.class.st +++ b/src/Spec2-Core/SpStringTableColumn.class.st @@ -125,7 +125,7 @@ SpStringTableColumn >> onAcceptEdition: aBlock [ acceptAction := aBlock ] -{ #category : #api } +{ #category : 'api' } SpStringTableColumn >> onTextChanged: aBlock [ "Set the block to execute when cell edition is edited. `aBlock` receives two arguments: @@ -135,7 +135,7 @@ SpStringTableColumn >> onTextChanged: aBlock [ textChanged := aBlock ] -{ #category : #api } +{ #category : 'api' } SpStringTableColumn >> sortFunction [ ^ super sortFunction ifNil: [ self evaluation ascending ] @@ -156,7 +156,7 @@ SpStringTableColumn >> sortFunction: aBlockOrSortFunction [ self isSortable: aBlockOrSortFunction isNotNil ] -{ #category : #accessing } +{ #category : 'accessing' } SpStringTableColumn >> textChanged [ ^ textChanged From 3beb538f78d8bf4490e3a2440e6cb2297ce308e6 Mon Sep 17 00:00:00 2001 From: DEMAREY Christophe Date: Thu, 13 Jun 2024 10:17:09 +0200 Subject: [PATCH 3/4] ok action should return the result of the evaluation of the block --- src/Spec2-Core/SpDialogWindowPresenter.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spec2-Core/SpDialogWindowPresenter.class.st b/src/Spec2-Core/SpDialogWindowPresenter.class.st index b52dbdc6..dc7be4db 100644 --- a/src/Spec2-Core/SpDialogWindowPresenter.class.st +++ b/src/Spec2-Core/SpDialogWindowPresenter.class.st @@ -271,5 +271,5 @@ SpDialogWindowPresenter >> triggerOkAction [ See `SpDialogWindowPresenter>>#okAction:`" okAction ifNil: [ ^ self ]. - okAction cull: self + ^ okAction cull: self ] From 34e1541c4db2b00ff40d1f4bc0ddf174c1466755 Mon Sep 17 00:00:00 2001 From: DEMAREY Christophe Date: Thu, 13 Jun 2024 10:19:49 +0200 Subject: [PATCH 4/4] return nil instead of self when no action available --- src/Spec2-Core/SpAbstractPresenter.class.st | 2 +- src/Spec2-Core/SpDialogWindowPresenter.class.st | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spec2-Core/SpAbstractPresenter.class.st b/src/Spec2-Core/SpAbstractPresenter.class.st index ae668bed..a5bd8695 100644 --- a/src/Spec2-Core/SpAbstractPresenter.class.st +++ b/src/Spec2-Core/SpAbstractPresenter.class.st @@ -548,7 +548,7 @@ SpAbstractPresenter >> withAdapterDo: aValuable [ { #category : 'private - utilities' } SpAbstractPresenter >> withWindowDo: aValuable [ - self hasWindow ifFalse: [ ^ self ]. + self hasWindow ifFalse: [ ^ nil ]. "Since Presenter has window, root = window" ^ aValuable value: self root ] diff --git a/src/Spec2-Core/SpDialogWindowPresenter.class.st b/src/Spec2-Core/SpDialogWindowPresenter.class.st index dc7be4db..ac05a9e6 100644 --- a/src/Spec2-Core/SpDialogWindowPresenter.class.st +++ b/src/Spec2-Core/SpDialogWindowPresenter.class.st @@ -270,6 +270,6 @@ SpDialogWindowPresenter >> triggerOkAction [ "Trigger defined ok action. See `SpDialogWindowPresenter>>#okAction:`" - okAction ifNil: [ ^ self ]. + okAction ifNil: [ ^ nil ]. ^ okAction cull: self ]