From 49a41767fc652b127d87fb20ca2f188a629b3f69 Mon Sep 17 00:00:00 2001 From: ClotildeToullec Date: Tue, 12 Nov 2024 18:29:06 +0100 Subject: [PATCH] Fix #1207: Avoid opening aStInspector in Moose --- .../MiPlaygroundPagePresenter.class.st | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/MooseIDE-NewTools/MiPlaygroundPagePresenter.class.st b/src/MooseIDE-NewTools/MiPlaygroundPagePresenter.class.st index fe7b27c87..c49e8a85a 100644 --- a/src/MooseIDE-NewTools/MiPlaygroundPagePresenter.class.st +++ b/src/MooseIDE-NewTools/MiPlaygroundPagePresenter.class.st @@ -22,6 +22,13 @@ MiPlaygroundPagePresenter >> addMooseToolbarCommandsTo: aGroup [ forRoot: aGroup ] +{ #category : #accessing } +MiPlaygroundPagePresenter >> application [ + "This is a hack to avoid opening Pharo system tools in MiApplication" + + ^ StPharoApplication current +] + { #category : #'public access' } MiPlaygroundPagePresenter >> evaluate [ @@ -40,18 +47,19 @@ MiPlaygroundPagePresenter >> menuActionsFor: aCodePresenter [ beDisplayedAsGroup; register: (StEvaluateCommand forSpecContext: self); register: - (MiInspectCommand forSpecContext: self playgroundBrowser); + ((MiInspectCommand forSpecContext: self playgroundBrowser) + name: 'Inspect in Moose'); register: (MiPropagateCommand forSpecContext: self playgroundBrowser); yourself); register: (aCodePresenter rootCommandsGroup name: 'Code'); - register: (aCodePresenter editionCommandsGroup name: 'Edition'); + in: [ :this | + self addMenuEditionCommandsTo: this presenter: aCodePresenter ]; + in: [ :this | self addMenuCommandsTo: this ]; register: ((CmCommandGroup named: 'Playground') asSpecGroup register: ((CmCommandGroup named: 'Base options') asSpecGroup beDisplayedAsGroup; - register: (StPlaygroundPublishCommand forSpecContext: self); - register: (StPlaygroundBindingsCommand forSpecContext: self); - register: (StPlaygroundPagesCommand forSpecContext: self); + in: [ :this | self addToolbarCommandsTo: this ]; yourself); register: ((CmCommandGroup named: 'Miscelaneous options') asSpecGroup