[squeak-dev] The Trunk: MorphicExtras-tpr.223.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 7 19:14:26 UTC 2018

tim Rowledge uploaded a new version of MorphicExtras to project The Trunk:

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

Name: MorphicExtras-tpr.223
Author: tpr
Time: 7 March 2018, 11:14:11.491809 am
UUID: c324d012-9883-4ede-a149-240f51d9687c
Ancestors: MorphicExtras-dtl.222

Convert usage of nasty old StandardFileMenu to gleaming new file dialogues

=============== Diff against MorphicExtras-dtl.222 ===============

Item was changed:
  ----- Method: BookMorph>>loadImagesIntoBook (in category 'menu') -----
  	"PowerPoint stores GIF presentations as individual slides named Slide1, Slide2, etc.
  	Load these into the book.  mjg 9/99"
  	| directory filenumber form newpage |
+ 	directory :=DirectoryChooserDialog openOn: FileDirectory default label: 'Select the directory to load pages from'.
- 	directory := ((StandardFileMenu oldFileFrom: FileDirectory default) 
- 				ifNil: [^nil]) directory.
  	directory isNil ifTrue: [^nil].
  	"Start loading 'em up!!"
  	filenumber := 1.
  	[directory fileExists: 'Slide' , filenumber asString] whileTrue: 
  				show: 'Slide' , filenumber asString;
  			Smalltalk bytesLeft < 1000000 
  					["Make some room"
  					(self valueOfProperty: #url) isNil 
  						ifTrue: [self savePagesOnURL]
  						ifFalse: [self saveAsNumberedURLs]].
  			form := Form 
  						fromFileNamed: (directory fullNameFor: 'Slide' , filenumber asString).
  			newpage := PasteUpMorph new extent: form extent.
  			newpage addMorph: (self world drawingClass withForm: form).
  			self pages addLast: newpage.
  			filenumber := filenumber + 1].
  	"After adding all, delete the first page."
  	self goToPage: 1.
  	self deletePageBasic.
  	"Save the book"
  	(self valueOfProperty: #url) isNil 
  		ifTrue: [self savePagesOnURL]
  		ifFalse: [self saveAsNumberedURLs]!

Item was changed:
  ----- Method: FancyMailComposition>>addAttachment (in category 'actions') -----
+ 	| file fileName |
- 	| file fileResult fileName |
  		ifNotNil: [self hasUnacceptedEdits ifTrue: [textEditor accept]].
+ 	fileName := FileChooserDialog openOn: FileDirectory default pattern: nil label: 'Choose attachment'.
+ 	fileName ifNil: [^self].
+ 	file := FileStream readOnlyFileNamed: fileName.
+ 	file ifNotNil: [file binary.
- 	(fileResult := StandardFileMenu oldFile)
- 		ifNotNil: 
- 			[fileName := fileResult directory fullNameFor: fileResult name.
- 			file := FileStream readOnlyFileNamed: fileName.
- 			file ifNotNil:
- 				[file binary.
  				self messageText:
  						((MailMessage from: self messageText asString)
+ 							addAttachmentFrom: file withName: (FileDirectory localNameFor: fileName);  
+ 							text).
+ 				file close]!
- 							addAttachmentFrom: file withName: fileResult name; text).
- 				file close]] !

Item was changed:
  ----- Method: FatBitsPaint>>fileOut (in category 'menu') -----
+         | fileName |
-         | fileName result |
+ 	fileName := FileSaverDialog openOn: FileDirectory default.
+ 	fileName ifNil: [^Beeper beep].
+  	Cursor normal showWhile:  [self unmagnifiedForm writeOnFileNamed: fileName]!
-         result := StandardFileMenu newFile ifNil: [^Beeper beep].
-         fileName := result directory fullNameFor: result name.
-         Cursor normal showWhile:
-                 [self unmagnifiedForm writeOnFileNamed: fileName]!

More information about the Squeak-dev mailing list