[squeak-dev] The Trunk: UpdateStream-nice.2.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Dec 6 16:16:19 UTC 2013


Nicolas Cellier uploaded a new version of UpdateStream to project The Trunk:
http://source.squeak.org/trunk/UpdateStream-nice.2.mcz

==================== Summary ====================

Name: UpdateStream-nice.2
Author: nice
Time: 6 December 2013, 5:16:05.919 pm
UUID: 946512c5-6ada-463e-83ea-231b857eb86d
Ancestors: UpdateStream-nice.1

Prefer own Preferences

=============== Diff against UpdateStream-nice.1 ===============

Item was changed:
  Object subclass: #UpdateStreamDownloader
  	instanceVariableNames: ''
+ 	classVariableNames: 'PromptForUpdateServer UpdateDownloader UpdateSavesFile UpdateUrlLists'
- 	classVariableNames: 'UpdateDownloader UpdateUrlLists'
  	poolDictionaries: ''
  	category: 'UpdateStream'!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>chooseUpdateList (in category 'fetching updates') -----
  chooseUpdateList
  	"When there is more than one set of update servers, let the user choose which we will update from.  Put it at the front of the list. Return false if the user aborted.  If the preference #promptForUpdateServer is false, then suppress that prompt, in effect using the same server choice that was used the previous time (a convenience for those of us who always answer the same thing to the prompt.)"
  
  	| index him |
+ 	((UpdateUrlLists size > 1) and: [self promptForUpdateServer])
- 	((UpdateUrlLists size > 1) and: [Preferences promptForUpdateServer])
  		ifTrue:
  			[index := UIManager default 
  				chooseFrom: (UpdateUrlLists collect: [:each | each first]) 
  				lines: #()
  				title: 'Choose a group of servers\from which to fetch updates.' translated withCRs.
  			index > 0 ifTrue:
  				[him := UpdateUrlLists at: index.
  				UpdateUrlLists removeAt: index.
  				UpdateUrlLists addFirst: him].
  			^ index > 0].
  	^ true!

Item was added:
+ ----- Method: UpdateStreamDownloader class>>promptForUpdateServer (in category 'preferences') -----
+ promptForUpdateServer
+ 	<preference: 'Prompt for update server'
+ 	category: 'updates'
+ 	description: 'If false, the prompt for server choice when updating code from the server is suppressed. Set this to false to leave the server choice unchanged from update to update.'
+ 	type: #Boolean>
+ 	^PromptForUpdateServer ifNil: [ false ]!

Item was added:
+ ----- Method: UpdateStreamDownloader class>>promptForUpdateServer: (in category 'preferences') -----
+ promptForUpdateServer: aBoolean
+ 	PromptForUpdateServer := aBoolean!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>saveUpdate:onFile: (in category 'fetching updates') -----
  saveUpdate: doc onFile: fileName
  	"Save the update on a local file.  With or without the update number on the front, depending on the preference #updateRemoveSequenceNum"
  
  	| file fName pos updateDirectory |
  
  	(FileDirectory default directoryNames includes: 'updates') ifFalse:
  		[FileDirectory default createDirectory: 'updates'].
  	updateDirectory := FileDirectory default directoryNamed: 'updates'.
  
  	fName := fileName.
+ 	self updateRemoveSequenceNum ifTrue:
- 	(Preferences valueOfFlag: #updateRemoveSequenceNum) ifTrue:
  		[pos := fName findFirst: [:c | c isDigit not].
  		fName := fName copyFrom: pos to: fName size].
  	doc reset; ascii.
  	(updateDirectory fileExists: fName) ifFalse:
  		[file := updateDirectory newFileNamed: fName.
  		file nextPutAll: doc contents.
  		file close].
  !

Item was changed:
  ----- Method: UpdateStreamDownloader class>>updateFromServer (in category 'fetching updates') -----
  updateFromServer
  	"Update the image by loading all pending updates from the server.  Also save local copies of the update files if the #updateSavesFile preference is set to true"
  
+ 	self readServerUpdatesSaveLocally: self updateSavesFile updateImage: true!
- 	self readServerUpdatesSaveLocally: Preferences updateSavesFile updateImage: true!

Item was changed:
  ----- Method: UpdateStreamDownloader class>>updateFromServerThroughUpdateNumber: (in category 'fetching updates') -----
  updateFromServerThroughUpdateNumber: aNumber
  	"Update the image by loading all pending updates from the server.  Also save local copies of the update files if the #updateSavesFile preference is set to true"
  
+ 	self readServerUpdatesThrough: aNumber saveLocally: self updateSavesFile updateImage: true!
- 	self readServerUpdatesThrough: aNumber saveLocally: Preferences updateSavesFile updateImage: true!

Item was added:
+ ----- Method: UpdateStreamDownloader class>>updateRemoveSequenceNum (in category 'preferences') -----
+ updateRemoveSequenceNum
+ 	^false!

Item was added:
+ ----- Method: UpdateStreamDownloader class>>updateSavesFile (in category 'preferences') -----
+ updateSavesFile
+ 	<preference: 'Update saves files'
+ 	category: 'updates'
+ 	description: 'If true, then when an update is loaded from the server, a copy of it will automatically be saved on a local file as well.'
+ 	type: #Boolean>
+ 	^UpdateSavesFile ifNil: [ false ]!

Item was added:
+ ----- Method: UpdateStreamDownloader class>>updateSavesFile: (in category 'preferences') -----
+ updateSavesFile: aBoolean
+ 	UpdateSavesFile := aBoolean!



More information about the Squeak-dev mailing list