Tobias Pape uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-topa.224.mcz==================== Summary ====================
Name: MorphicExtras-topa.224
Author: topa
Time: 7 March 2018, 9:37:01.927179 pm
UUID: 429c41eb-0c72-4d9c-b01a-60446039c6b9
Ancestors: MorphicExtras-tpr.223
Slight improvement to tim's improvement
=============== Diff against MorphicExtras-tpr.223 ===============
Item was changed:
----- Method: BookMorph>>loadImagesIntoBook (in category 'menu') -----
loadImagesIntoBook
"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 ifNil: [^ self].
- directory isNil ifTrue: [^nil].
"Start loading 'em up!!"
filenumber := 1.
[directory fileExists: 'Slide' , filenumber asString] whileTrue:
[Transcript
show: 'Slide' , filenumber asString;
cr.
Smalltalk bytesLeft < 1000000
ifTrue:
["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') -----
addAttachment
+
- | file fileName |
textEditor
ifNotNil: [self hasUnacceptedEdits ifTrue: [textEditor accept]].
+ (FileChooserDialog openOn: FileDirectory default pattern: nil label: 'Choose attachment') ifNotNil:
+ [:fileName |
+ FileStream readOnlyFileNamed: fileName do:
+ [:file |
+ file binary.
+ self messageText:
+ ((MailMessage from: self messageText asString)
+ addAttachmentFrom: file withName: (FileDirectory localNameFor: fileName);
+ text)]]!
- fileName := FileChooserDialog openOn: FileDirectory default pattern: nil label: 'Choose attachment'.
- fileName ifNil: [^self].
-
- file := FileStream readOnlyFileNamed: fileName.
- file ifNotNil: [file binary.
- self messageText:
- ((MailMessage from: self messageText asString)
- addAttachmentFrom: file withName: (FileDirectory localNameFor: fileName);
- text).
- file close]!