#REFACTORING by stefan
class: Workspace
changed: #correctableSelectorWarning:position:to:from:
use DialogBox class >> #modifyingBoxWith:do:
--- a/Workspace.st Wed May 16 08:37:31 2018 +0200
+++ b/Workspace.st Wed May 16 08:38:42 2018 +0200
@@ -920,40 +920,41 @@
|action doNotShowAgainHolder|
self highlightingWarningPosition:relPos to:relEndPos do:[
- doNotShowAgainHolder := false asValue.
- Dialog aboutToOpenBoxNotificationSignal handle:[:ex |
- MessageNotUnderstood catch:[
- (aCompiler notNil and:[DoNotShowCompilerWarningAgainActionQuery isHandled]) ifTrue:[
- ex box addCheckBoxAtBottom:'Do not show this dialog again (reenable via Launchers Settings Dialog)' on:doNotShowAgainHolder.
- ].
- ].
- ] do:[
- action := OptionBox
- request:aString
- label:(resources string:'Warning')
- image:(WarningBox iconBitmap)
- buttonLabels:(resources array:#('Cancel' 'Correct...' 'Generate' 'Continue'))
- values:#(#abort #correct #generate #continue)
- default:#continue
- onCancel:#abort.
- ].
- doNotShowAgainHolder value == true ifTrue:[
- DoNotShowCompilerWarningAgainActionQuery actionQuery value
- ].
+ doNotShowAgainHolder := false asValue.
+ DialogBox modifyingBoxWith:[:box |
+ MessageNotUnderstood catch:[
+ (aCompiler notNil and:[DoNotShowCompilerWarningAgainActionQuery isHandled]) ifTrue:[
+ box addCheckBoxAtBottom:'Do not show this dialog again (reenable via Launchers Settings Dialog)' on:doNotShowAgainHolder.
+ ].
+ ].
+ ] do:[
+ action := OptionBox
+ request:aString
+ label:(resources string:'Warning')
+ image:(WarningBox iconBitmap)
+ buttonLabels:(resources array:#('Cancel' 'Correct...' 'Generate' 'Continue'))
+ values:#(#abort #correct #generate #continue)
+ default:#continue
+ onCancel:#abort.
+ ].
+ doNotShowAgainHolder value == true ifTrue:[
+ DoNotShowCompilerWarningAgainActionQuery actionQuery value
+ ].
].
action == #generate ifTrue:[
- ^ action
+ ^ action
].
(action isNil or:[action == #abort]) ifTrue:[
- AbortOperationRequest raise.
- ^ false
+ AbortOperationRequest raise.
+ ^ false
].
^ action == #correct
"Created: / 19-01-2000 / 16:27:28 / cg"
"Modified: / 28-02-2012 / 10:42:37 / cg"
+ "Modified: / 15-05-2018 / 20:52:55 / stefan"
!
correctableWarning:aString position:relPos to:relEndPos from:aCompiler