giving more information on the download dialogs, but also force a max length of the title
MODIFY
src/PharoLauncher-Core/PhLDownloadManager.class.st
src/PharoLauncher-Core/PhLDownloadManager.class.st
@@ -36,17 +36,19 @@ PhLDownloadManager >> basicDownload: url toFile: destinationFile [
| tmpFile |
tmpFile := destinationFile , UUIDGenerator next asString.
- self displayProgressDuring: [ (self newHTTPClientForUrl: url) downloadTo: tmpFile ].
+ self
+ displayProgress: ('Downloading {1}...' format: { url })
+ during: [ (self newHTTPClientForUrl: url) downloadTo: tmpFile ].
destinationFile ensureDelete.
tmpFile renameTo: destinationFile basename.
]
{ #category : #private }
-PhLDownloadManager >> displayProgressDuring: workBlock [
+PhLDownloadManager >> displayProgress: aTitle during: workBlock [
"Inform user about download progression"
PharoLauncherApplication default
- pushProgress: 'Downloading...'
+ pushProgress: aTitle
with: [ :bar |
workBlock
on: HTTPProgress
@@ -57,6 +59,15 @@ PhLDownloadManager >> displayProgressDuring: workBlock [
progress resume ] ]
]
+{ #category : #private }
+PhLDownloadManager >> displayProgressDuring: workBlock [
+ "Inform user about download progression"
+
+ self
+ displayProgress: 'Downloading...'
+ during: workBlock
+]
+
{ #category : #action }
PhLDownloadManager >> download: url toFile: destinationFile [
[ self basicDownload: url toFile: destinationFile ]
@@ -84,7 +95,9 @@ PhLDownloadManager >> downloadToPositionableStream: url mimeType: mimeType [
beOneShot;
accept: mimeType;
enforceAcceptContentType: true.
- self displayProgressDuring: [ content := client get ].
+ self
+ displayProgress: ('Downloading {1}...' format: { url })
+ during: [ content := client get ].
^ content readStream
]

MODIFY
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
src/PharoLauncher-Spec2/PharoLauncherApplication.class.st
@@ -275,7 +275,7 @@ PharoLauncherApplication >> pushProgress: aString with: aBlock [
self newProgress
parentWindow: self topWindow;
- title: aString;
+ title: (aString contractTo: 60);
informUserDuring: aBlock
]

giving more information on the download dialogs, but also force a max length of the title