How to uninstall Pharo Glamorous Toolkit?
Asked Answered
M

2

7

I want to uninstall the Glamorous Toolkit (to me seems to be overloaded versions of classic Smalltalk tools) in Pharo 4 or 5.

Here is my code:

| config configName |
configName := #ConfigurationOfGTInspectorCore.
config := (MBConfigurationInfo 
            configurationClass: (Smalltalk globals at: (configName asSymbol)))
            configurationRoot: MBConfigurationRoot new;
            yourself.
config workingCopy unload

but my script unloads the Configuration, but not the packages or classes and methods it contains, and I want to unload all GT packages in the Configuration.

What am I doing wrong? Any assistance will be greatly appreciated!

Thank you in advance.

Maegan answered 14/1, 2016 at 4:18 Comment(0)
C
5

I also prefer GT to be optional, the fact the Pharo board is going to impose GT by default in upcoming Pharos makes me think about the transparency process, and how far is a Pharo fork if such policies continues.

That said, GT tools cannot be easily uninstalled (and it takes a lot of time):

Workspace openContents: 'GTPlayground setGTPlaygroundEnabledStatus: false.
" ========== Debuggers ========== "

Nautilus pluginClasses: nil.
SpecDebugger closeAllDebuggers.
GTGenericStackDebugger closeAllDebuggers.
GTGenericStackDebugger setGTDebuggerEnabledStatus: false.

" ========== Miscellany ========== "

GTInspector setGTInspectorEnabledStatus: false.
GTExampleOrganizer stop.
GTEventRecorder cleanUp.
GTEventRecorderSettings cleanUp.
GTSnippets reset.
GTPlayBook reset.
GTPlayBook resetDirectories.
GTSpotter cleanUp.
GTSpotterGlobalShortcut reset.

GlobalIdentifier cleanUp.
Privacy cleanUp.

" ========== QA ========== "
QASettings inspectorPluggin: false.
QASettings spotterPlugin: false.
QAEventCollector unload.
(MCPackage named: ''QualityAssistant'') unload.

" ========== RPackage ========== "
RPackageOrganizer default packageNames
    select: [ :each | each beginsWith: ''GT'' ]
    thenDo: [ :each |
        (MCPackage named: each) unload.
        RPackageOrganizer default unregisterPackageNamed: each.
        " Possibly unnecessary... "
        Smalltalk removeEmptyMessageCategories.
        Smalltalk cleanOutUndeclared.
        Smalltalk fixObsoleteReferences.
        Smalltalk globals flushClassNameCache ].  
Behavior flushEvents.
Behavior flushObsoleteSubclasses.
SmalltalkImage current resetTools.'
Castaway answered 14/1, 2016 at 14:33 Comment(0)
H
5

If you want to use older versions, all you have to do is to go to settings and deactivate them (go to settings in the menu: world menu/system/settings), then look for "Glamorous Toolkit".

Unloading packages is a lot more complicated: You need to iterate each package in correct order and unload it.

Now, notice that GT tools are the official tools (Overloaded for you, powerful for us)... Most probably future versions of Pharo will not contain the older tools.

I suggest you to give them a try... you will see the benefits very fast.

Hamitic answered 14/1, 2016 at 7:43 Comment(1)
btw, if you just unload packages without before deactivate the GT tools (as described), you will end with an unusable system...Hamitic
C
5

I also prefer GT to be optional, the fact the Pharo board is going to impose GT by default in upcoming Pharos makes me think about the transparency process, and how far is a Pharo fork if such policies continues.

That said, GT tools cannot be easily uninstalled (and it takes a lot of time):

Workspace openContents: 'GTPlayground setGTPlaygroundEnabledStatus: false.
" ========== Debuggers ========== "

Nautilus pluginClasses: nil.
SpecDebugger closeAllDebuggers.
GTGenericStackDebugger closeAllDebuggers.
GTGenericStackDebugger setGTDebuggerEnabledStatus: false.

" ========== Miscellany ========== "

GTInspector setGTInspectorEnabledStatus: false.
GTExampleOrganizer stop.
GTEventRecorder cleanUp.
GTEventRecorderSettings cleanUp.
GTSnippets reset.
GTPlayBook reset.
GTPlayBook resetDirectories.
GTSpotter cleanUp.
GTSpotterGlobalShortcut reset.

GlobalIdentifier cleanUp.
Privacy cleanUp.

" ========== QA ========== "
QASettings inspectorPluggin: false.
QASettings spotterPlugin: false.
QAEventCollector unload.
(MCPackage named: ''QualityAssistant'') unload.

" ========== RPackage ========== "
RPackageOrganizer default packageNames
    select: [ :each | each beginsWith: ''GT'' ]
    thenDo: [ :each |
        (MCPackage named: each) unload.
        RPackageOrganizer default unregisterPackageNamed: each.
        " Possibly unnecessary... "
        Smalltalk removeEmptyMessageCategories.
        Smalltalk cleanOutUndeclared.
        Smalltalk fixObsoleteReferences.
        Smalltalk globals flushClassNameCache ].  
Behavior flushEvents.
Behavior flushObsoleteSubclasses.
SmalltalkImage current resetTools.'
Castaway answered 14/1, 2016 at 14:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.