[etoys-dev] Etoys: Sugar-bf.14.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jun 4 11:56:27 EDT 2012


Bert Freudenberg uploaded a new version of Sugar to project Etoys:
http://source.squeak.org/etoys/Sugar-bf.14.mcz

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

Name: Sugar-bf.14
Author: bf
Time: 4 June 2012, 4:05:46 pm
UUID: 6b87c395-e7e7-496b-a88d-c0dab80bf818
Ancestors: Sugar-bf.13

ObjectChooser: handle non-ascii filenames. Plus some cleanup.

=============== Diff against Sugar-bf.13 ===============

Item was changed:
  ----- Method: SugarLauncher>>chooser:response: (in category 'chooser') -----
  chooser: chooserId response: objectIdOrPath
  	self chooserDone: chooserId.
  	WorldState addDeferredUIMessage: [
  		(objectIdOrPath beginsWith: '/')
  			ifTrue: [
+ 				| path file title |
+ 				path := objectIdOrPath utf8ToSqueak.
+ 				file := FileStream readOnlyFileNamed: path.
+ 				title := FileDirectory localNameFor: path.
- 				| file title |
- 				file := FileStream readOnlyFileNamed: objectIdOrPath.
- 				title := FileDirectory localNameFor: objectIdOrPath.
  				self handleStream: file mimetype: nil titled: title]
  			ifFalse: [
  				| props title mimetype |
  				props := self getProperties: objectIdOrPath.
  				title := props at: 'title' ifAbsent: ['untitled' translated].
  				mimetype := props at: 'mime_type' ifAbsent: [''].
  				[self open: objectIdOrPath title: title mimetype: mimetype]
  					on: SugarPropertiesNotification do: [:ex | ex resume: props]]].!

Item was changed:
  ----- Method: SugarLauncher>>handleStream:mimetype:titled: (in category 'datastore') -----
  handleStream: tmpStream mimetype: mimetypeOrNil titled: title
+ 	"tmpStream was opened from journal or other media.
+ 	For simplicity, we re-use the file drop logic."
- 	"tmpStream was loaded from journal, is not a project, do something sensible"
- 	"this ignores the mimetype, we really should do better ..."
  
+ 	ActiveHand lastEvent position: World center.
  	[
  		[(ExternalDropHandler lookupExternalDropHandler: tmpStream)
  			handle: tmpStream in: World dropEvent: ActiveHand lastEvent]
+ 		ifError: [self inform: ('Cannot open {1}' translated format: {title})]
- 		ifError: [self inform: ('Cannot open {1}' translated withCRs format: {title})]
  	] ensure: [tmpStream ifNotNil: [tmpStream close]].!

Item was changed:
  ----- Method: SugarLauncher>>open:title:mimetype: (in category 'chooser') -----
  open: id title: titleString mimetype: mimeString
  	| file |
- 	ActiveHand lastEvent position: World center.
  	Utilities informUser: 'Opening journal entry' translated, String cr, 
  			(titleString copyReplaceAll: String lf with: String cr)
  		during: [file := self getFile: id].
  	self handleStream: file mimetype: mimeString titled: titleString.!



More information about the etoys-dev mailing list