diff --git a/src/PharoLauncher-CLI/PhLNotificationCenter.class.st b/src/PharoLauncher-CLI/PhLNotificationCenter.class.st index ac4676b6..cc0d6b6d 100644 --- a/src/PharoLauncher-CLI/PhLNotificationCenter.class.st +++ b/src/PharoLauncher-CLI/PhLNotificationCenter.class.st @@ -1,5 +1,8 @@ " -This represents singleton object for accessing errorStream, outStream in methods used by CLI, that do not have any reference to streams of CLI command (or CLI context) object. +I represent an object to manage notifications to user when ran in CLI mode. + +I can act as the PharoLauncher default application (see PharoLauncherApplication class>>#default). +I only have a minimal set of methods to provide some polymorphism with an SpApplication and avoid UI interactions. " Class { #name : #PhLNotificationCenter, @@ -54,3 +57,20 @@ PhLNotificationCenter >> outStream [ PhLNotificationCenter >> outStream: anOutStream [ outStream := anOutStream ] + +{ #category : #ui } +PhLNotificationCenter >> pushProgress: aString with: aFullBlockClosure [ + "do not display progress, only evaluate the block" + aFullBlockClosure value: DummySystemProgressItem new +] + +{ #category : #ui } +PhLNotificationCenter >> showError: anError [ + + self errorStream + nextPutAll: 'Error: '; + nextPutAll: anError name; + nextPutAll: ' - '; + nextPutAll: anError longDescription; + cr +] diff --git a/src/PharoLauncher-Core/PhLDownloadManager.class.st b/src/PharoLauncher-Core/PhLDownloadManager.class.st index e232d1b1..79a5ecec 100644 --- a/src/PharoLauncher-Core/PhLDownloadManager.class.st +++ b/src/PharoLauncher-Core/PhLDownloadManager.class.st @@ -46,8 +46,6 @@ PhLDownloadManager >> basicDownload: url toFile: destinationFile [ { #category : #private } PhLDownloadManager >> displayProgress: aTitle during: workBlock [ "Inform user about download progression" - | bar | - bar := ConsoleProgressBar on: PhLNotificationCenter default outStream. PharoLauncherApplication default pushProgress: aTitle diff --git a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st index f48a51df..4a3e526e 100644 --- a/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st +++ b/src/PharoLauncher-Spec2/PhLDeploymentScript.class.st @@ -166,8 +166,11 @@ PhLDeploymentScript class >> isDeployed [ { #category : #'system startup' } PhLDeploymentScript class >> launcherStartUp [ - (self isDeployed and: [ Smalltalk isInteractive not ]) - ifTrue: [ self closeWindowsAndOpenLauncher ] + self isDeployed ifFalse: [ ^ self ]. + + Smalltalk isInteractive + ifTrue: [ PharoLauncherApplication default: PhLNotificationCenter default ] + ifFalse: [ self closeWindowsAndOpenLauncher ] ] { #category : #'system startup' }