Mantis - Squeak
Viewing Issue Advanced Details
4849 Kernel minor always 09-09-06 19:55 01-04-07 05:28
Krivanek  
 
normal  
new 3.10  
open  
none    
none  
0004849: [KernelImageOverride] AutoStart
The AutoStart class is dependent on network support. The version in KernelImage is modified to obtain clean code but the function of this class is broken. So this class is not present in the startup list. That also means that processing of command-line arguments is not possible. This class refactoring.

AutoStart class >> checkForUpdates has empty content.

original:

AutoStart class >> startUp: resuming
    "The image is either being newly started (resuming is true), or it's just been snapshotted.
    If this has just been a snapshot, skip all the startup stuff."

    | startupParameters launchers |
    self active ifTrue: [^self].
    self active: true.
    resuming ifFalse: [^self].

    HTTPClient determineIfRunningInBrowser.
    startupParameters _ AbstractLauncher extractParameters.
    (startupParameters includesKey: 'apiSupported' asUppercase )
        ifTrue: [
            HTTPClient browserSupportsAPI: ((startupParameters at: 'apiSupported' asUppercase) asUppercase = 'TRUE').
            HTTPClient isRunningInBrowser
                ifFalse: [HTTPClient isRunningInBrowser: true]].
    self checkForUpdates
        ifTrue: [^self].
    self checkForPluginUpdate.
    launchers _ self installedLaunchers collect: [:launcher |
        launcher new].
    launchers do: [:launcher |
        launcher parameters: startupParameters].
    launchers do: [:launcher |
        Smalltalk at: #WorldState ifPresent: [ :ws | ws addDeferredUIMessage: [launcher startUp] fixTemps]]

override:

AutoStart class >> startUp: resuming
    "The image is either being newly started (resuming is true), or it's just been snapshotted.
    If this has just been a snapshot, skip all the startup stuff."

    | launchers startupParameters |
    self active ifTrue: [^self].
    self active: true.
    resuming ifFalse: [^self].
    
    startupParameters := AbstractLauncher extractParameters.

    self browserSupport.
    
    self checkForUpdates
        ifTrue: [^self].

    launchers _ self installedLaunchers collect: [:launcher |
        launcher new].
    launchers do: [:launcher |
        launcher parameters: startupParameters].
    launchers do: [:launcher |
        Smalltalk at: #WorldState ifPresent: [ :ws | ws addDeferredUIMessage: [launcher startUp] fixTemps]]

Notes
(0008822)
Keith_Hodges   
01-04-07 05:28   
The AutoStart system could use a review and a revamp.

above

a) The dependency HTTPClient determineIfRunningInBrowser is actually implemented in StandardFileStream.

b) Command line parameters and ExternalSettings could use some synergy.
how about:

squeak squeak-0000.image <script1> <params for script1>... <script N> <params for script N>

Where params are in the typical form.
param1=true param2="hello world" +param3 -param4

i.e. items with an = are parameters,
+ gives param3=true
- give param4=false
the rest are startup scripts/documents, which are also included in params at: #documents

For synergy: Can the commandline parameters override any ExternelSettings and can ExternelSettings provide default startup parameters?

c) Currently starting up with a local document, or url file: is broken (in linux)

d) A document/script has no easy way of determining whether it is being run as a startup document/script.