From 03f2f23860328026920796efc933f3b210bd60bd Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 6 May 2025 11:41:14 +0200 Subject: [PATCH] Remove dead code un UIManager It seems that we have leftover code to handle some errors. I propose to remove it --- .../OupsDummyDebuggerSystem.class.st | 6 ---- src/Debugger-Oups/OupsDebuggerSystem.class.st | 11 ------ src/Files-Prompt/DummyUIManager.extension.st | 5 --- src/Files-Prompt/UIManager.extension.st | 7 ---- .../MorphicUIManager.class.st | 22 ------------ src/UIManager/CommandLineUIManager.class.st | 34 ------------------- src/UIManager/DummyUIManager.class.st | 16 --------- .../NonInteractiveUIManager.class.st | 5 --- src/UIManager/UIManager.class.st | 23 ------------- 9 files changed, 129 deletions(-) delete mode 100644 src/Files-Prompt/DummyUIManager.extension.st delete mode 100644 src/Files-Prompt/UIManager.extension.st diff --git a/src/Debugger-Oups-Tests/OupsDummyDebuggerSystem.class.st b/src/Debugger-Oups-Tests/OupsDummyDebuggerSystem.class.st index ffd1ea8e97f..d9ee3636574 100644 --- a/src/Debugger-Oups-Tests/OupsDummyDebuggerSystem.class.st +++ b/src/Debugger-Oups-Tests/OupsDummyDebuggerSystem.class.st @@ -45,12 +45,6 @@ OupsDummyDebuggerSystem >> defaultUIManager [ ^ customUIManager ] -{ #category : 'open debugger' } -OupsDummyDebuggerSystem >> logDebugRequest: aDebugRequest withUIManager: aCommandLineUIManager [ - - self openDebuggerOnRequest: aDebugRequest -] - { #category : 'open debugger' } OupsDummyDebuggerSystem >> openDebuggerOnRequest: aDebugRequest [ self callsToHandleDebugRequest: self callsToHandleDebugRequest + 1. diff --git a/src/Debugger-Oups/OupsDebuggerSystem.class.st b/src/Debugger-Oups/OupsDebuggerSystem.class.st index 617c826a466..5b102711dea 100644 --- a/src/Debugger-Oups/OupsDebuggerSystem.class.st +++ b/src/Debugger-Oups/OupsDebuggerSystem.class.st @@ -69,17 +69,6 @@ OupsDebuggerSystem >> handleWarningDebugRequest: aWarningDebugRequest [ do: [ self signalDebuggerError: aWarningDebugRequest ] ] -{ #category : 'open debugger' } -OupsDebuggerSystem >> logDebugRequest: aDebugRequest withUIManager: aCommandLineUIManager [ - - aCommandLineUIManager - debugProcess: aDebugRequest process - context: aDebugRequest exception signalerContext - label: aDebugRequest exception description - fullView: false - notification: aDebugRequest exception description -] - { #category : 'open debugger' } OupsDebuggerSystem >> openDebuggerOnRequest: aDebugRequest [ "Prepare the opening of a debugger, and delegate the debugger selection and opening to a strategy" diff --git a/src/Files-Prompt/DummyUIManager.extension.st b/src/Files-Prompt/DummyUIManager.extension.st deleted file mode 100644 index 9002df95c9e..00000000000 --- a/src/Files-Prompt/DummyUIManager.extension.st +++ /dev/null @@ -1,5 +0,0 @@ -Extension { #name : 'DummyUIManager' } - -{ #category : '*Files-Prompt' } -DummyUIManager >> fileDoesNotExistsDefaultAction: anException [ -] diff --git a/src/Files-Prompt/UIManager.extension.st b/src/Files-Prompt/UIManager.extension.st deleted file mode 100644 index e0989c9bdc2..00000000000 --- a/src/Files-Prompt/UIManager.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'UIManager' } - -{ #category : '*Files-Prompt' } -UIManager >> fileDoesNotExistsDefaultAction: anException [ - - ^self subclassResponsibility -] diff --git a/src/Polymorph-Widgets/MorphicUIManager.class.st b/src/Polymorph-Widgets/MorphicUIManager.class.st index 8e9c0b20d57..a9f144873e4 100644 --- a/src/Polymorph-Widgets/MorphicUIManager.class.st +++ b/src/Polymorph-Widgets/MorphicUIManager.class.st @@ -284,15 +284,6 @@ MorphicUIManager >> deactivate [ self currentWorld worldState worldRenderer: (NullWorldRenderer forWorld: self currentWorld) ] -{ #category : 'debug' } -MorphicUIManager >> debugProcess: process context: context label: title fullView: bool notification: notificationString [ - - (OupsDebugRequest newForContext: context) - process: process; - label: title; - submit -] - { #category : 'ui process' } MorphicUIManager >> defer: aValuable [ "aValuable will be executed in the next UI rendering cycle" @@ -345,12 +336,6 @@ MorphicUIManager >> enterOrRequestFrom: labelList values: valueList lines: lines lines: linesArray ] -{ #category : 'handle debug requests' } -MorphicUIManager >> handleDebugRequest: aDebugRequest fromDebuggerSystem: anOupsDebuggerSystem [ - - anOupsDebuggerSystem openDebuggerOnRequest: aDebugRequest -] - { #category : 'error handling' } MorphicUIManager >> handleError: anError log: shouldLog [ @@ -626,13 +611,6 @@ MorphicUIManager >> uiProcess [ ^ UIProcess ] -{ #category : 'ui requests' } -MorphicUIManager >> unhandledErrorDefaultAction: anException [ - - "The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated." - anException debug -] - { #category : 'global state' } MorphicUIManager >> world [ ^ self currentWorld diff --git a/src/UIManager/CommandLineUIManager.class.st b/src/UIManager/CommandLineUIManager.class.st index f2b1d825c22..1997c145368 100644 --- a/src/UIManager/CommandLineUIManager.class.st +++ b/src/UIManager/CommandLineUIManager.class.st @@ -141,24 +141,6 @@ CommandLineUIManager >> confirm: queryString trueChoice: trueLabel falseChoice: ^ self choose: questions title: queryString ] -{ #category : 'debug' } -CommandLineUIManager >> debugProcess: process context: context label: title fullView: bool notification: notificationString [ - | description | - description := String streamContents: [ :stream | - stream - nextPutAll: 'debugging process: '; - nextPutAll: process name; - cr; - nextPutAll: 'context:'; - cr; - print: context. - notificationString ifNotNil: [ stream nextPutAll: notificationString ] ]. - self - logTitle: title - andDescription: description - to: self stderr -] - { #category : 'ui TEasilyThemed' } CommandLineUIManager >> deny: aStringOrText [ "Open a denial dialog." @@ -182,14 +164,6 @@ CommandLineUIManager >> exitFailure [ ] ] -{ #category : 'handle debug requests' } -CommandLineUIManager >> handleDebugRequest: aDebugRequest fromDebuggerSystem: anOupsDebuggerSystem [ - - anOupsDebuggerSystem - logDebugRequest: aDebugRequest - withUIManager: self -] - { #category : 'error handling' } CommandLineUIManager >> handleError: anError log: shouldLog [ @@ -427,11 +401,3 @@ CommandLineUIManager >> textEntry: aStringOrText title: aString [ CommandLineUIManager >> textEntry: aStringOrText title: aString entryText: defaultEntryText [ "Open a text entry dialog." ] - -{ #category : 'default actions' } -CommandLineUIManager >> unhandledErrorDefaultAction: anException [ - - self quitFrom: anException signalerContext withMessage: anException description. - - -] diff --git a/src/UIManager/DummyUIManager.class.st b/src/UIManager/DummyUIManager.class.st index 1d4d564a0d2..4236bf320da 100644 --- a/src/UIManager/DummyUIManager.class.st +++ b/src/UIManager/DummyUIManager.class.st @@ -55,11 +55,6 @@ DummyUIManager >> confirm: aString orCancel: cancelBlock [ self error: 'No user response possible' ] -{ #category : 'debug' } -DummyUIManager >> debugProcess: process context: context label: title fullView: bool notification: notificationString [ - Warning signal: 'Trying to debug the process ', title -] - { #category : 'ui requests' } DummyUIManager >> edit: aText label: labelString accept: aBlockOrNil [ @@ -153,14 +148,3 @@ DummyUIManager >> traceCr: aString [ logger nextPutAll: aString; cr ] ] - -{ #category : 'default actions' } -DummyUIManager >> unhandledErrorDefaultAction: anException [ - self traceCr: '*** EXCEPTION ***'. - self traceCr: anException. - self - trace: - (String - streamContents: [ :stream | anException signalerContext errorReportOn: stream ]). - Smalltalk exitFailure -] diff --git a/src/UIManager/NonInteractiveUIManager.class.st b/src/UIManager/NonInteractiveUIManager.class.st index 59379b3dced..adc6f4c4845 100644 --- a/src/UIManager/NonInteractiveUIManager.class.st +++ b/src/UIManager/NonInteractiveUIManager.class.st @@ -101,11 +101,6 @@ NonInteractiveUIManager >> confirm: queryString trueChoice: trueChoice falseChoi ^ self nonInteractiveRequest: queryString ] -{ #category : 'debug' } -NonInteractiveUIManager >> debugProcess: process context: context label: title fullView: bool notification: notificationString [ - ^ self nonInteractiveWarning: 'Opening Debugger' -] - { #category : 'ui requests' } NonInteractiveUIManager >> edit: aText label: labelString accept: aBlockOrNil [ "Open an editor on the given string/text" diff --git a/src/UIManager/UIManager.class.st b/src/UIManager/UIManager.class.st index b0105c1195e..55b9c19564e 100644 --- a/src/UIManager/UIManager.class.st +++ b/src/UIManager/UIManager.class.st @@ -337,12 +337,6 @@ UIManager >> confirm: queryString trueChoice: trueChoice falseChoice: falseChoic UIManager >> deactivate [ ] -{ #category : 'debug' } -UIManager >> debugProcess: process context: context label: title fullView: bool notification: notificationString [ - - self subclassResponsibility -] - { #category : 'ui process' } UIManager >> defer: aBlock [ "Evaluate the given Block in the UI thread as soon as there is nothing scheduled. @@ -386,17 +380,6 @@ UIManager >> edit: aText label: labelString accept: aBlockOrNil [ ^self subclassResponsibility ] -{ #category : 'debug requests' } -UIManager >> handleDebugRequest: aDebugRequest fromDebuggerSystem: anOupsDebuggerSystem [ - "Provide a default handling for unhandled error. - We should never reach this code, because it should be overridden by subclasses. - (but we can't put 'self subclassResponsibility' , because it will cause infinite loop, - in case if current ui manager having no override of this method). - This method is only for documentation purposes." - self flag: 'Code smell: can someone explain why we have this code if we should never reach it? And if we do, why quitting without any information? Finally, why the self subclassResponsibility produces an infinite loop?'. - Smalltalk snapshot: false andQuit: true -] - { #category : 'error handling' } UIManager >> handleError: anError [ @@ -537,12 +520,6 @@ UIManager >> onFontsChanged [ UIManager >> onPrimitiveError: aString [ ] -{ #category : 'ui requests' } -UIManager >> openComparisionFrom: targetMethodSource to: originalMethodSource belongingTo: aClass from: aChange [ - - ^self subclassResponsibility -] - { #category : 'ui TEasilyThemed' } UIManager >> proceed: aStringOrText [ "Open a proceed dialog."