Provide progress bars for network Templates refresh.
ADD
src/Pharo-Launcher-Core.package/PhLDownloadManager.class/class/displayProgress.during..st
+action
+displayProgress: label during: workBlock
+ UIManager default informUserDuring:
+ [ :bar1|
+ bar1 label: label.
+ UIManager default informUserDuring:
+ [ :bar2|
+ [workBlock value] on: HTTPProgress do:
+ [ : progress |
+ bar2 label: progress printString.
+ progress resume.
+ ].
+ ].
+ ].
+
\ No newline at end of file

MODIFY
src/Pharo-Launcher-Core.package/PhLHTTPListingTemplateGroup.class/instance/templatesAndGroups.st
src/Pharo-Launcher-Core.package/PhLHTTPListingTemplateGroup.class/instance/templatesAndGroups.st
accessing
templatesAndGroups
| content matcher templates |
- content := PhLDownloadManager default downloadToPositionableStream: url mimeType: ZnMimeType textHtml.
+ PhLDownloadManager displayProgress: 'Refreshing ''' , self name , ''' templates' during:
+ [ content := PhLDownloadManager default downloadToPositionableStream: url mimeType: ZnMimeType textHtml.
+ ].
matcher := RxMatcher for: self regex.
templates := OrderedCollection new.
[ matcher searchStream: content ]
@@ -9,3 +11,4 @@ templatesAndGroups
createTemplateFromHref: (matcher subexpression: self subexpression)
addingTo: templates ].
^ templates
+
\ No newline at end of file

MODIFY
src/Pharo-Launcher-Core.package/PhLJenkinsServer.class/instance/jobs.st
src/Pharo-Launcher-Core.package/PhLJenkinsServer.class/instance/jobs.st
private
jobs
"Get the JSON array from the server"
- | queryUrl query |
+
+ | queryUrl query result |
"The query is detailed enough to get all the information we want with just one request. If you update this, make sure we always have the 'relativePath' field for each artifact."
query := 'jobs[name,url,lastSuccessfulBuild[runs[artifacts[relativePath],fullDisplayName,url],artifacts[relativePath]]]'.
queryUrl := url / 'api' / 'json' ? ('tree' -> query).
- ^ Json readFrom: (PhLDownloadManager default downloadToPositionableStream: queryUrl mimeType: ZnMimeType applicationJson)
\ No newline at end of file
+ PhLDownloadManager
+ displayProgress: 'Refreshing ''' , self name , ''' templates'
+ during: [
+ result := Json
+ readFrom: (PhLDownloadManager default downloadToPositionableStream: queryUrl mimeType: ZnMimeType applicationJson) ].
+ ^ result
\ No newline at end of file

https://pharo.fogbugz.com/default.asp?11770
Provide progress bars for network Templates refresh.