The Trunk: Morphic-mt.1018.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.1018.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1018.mcz

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

Name: Morphic-mt.1018
Author: mt
Time: 22 October 2015, 10:51:51.981 am
UUID: e2faf21f-a955-4d6f-849c-0d844a7eaf2b
Ancestors: Morphic-cmm.1017

Adds support for dropping directories into the image.

=============== Diff against Morphic-cmm.1017 ===============

Item was changed:
  ----- Method: PasteUpMorph>>dropFiles: (in category 'event handling') -----
  dropFiles: anEvent
  "Handle a number of dropped files from the OS.
  TODO:
  - use a more general mechanism for figuring out what to do with the file (perhaps even offering a choice from a menu)
  - remember the resource location or (when in browser) even the actual file handle
  "
+ | numFiles |
- | numFiles stream handler |
  numFiles := anEvent contents.
  1 to: numFiles do: [ :i |
+ (FileStream requestDropStream: i)
+ ifNotNil: [:stream |
+ [ (ExternalDropHandler lookupExternalDropHandler: stream) ifNotNil: [:handler |
+ handler handle: stream in: self dropEvent: anEvent ] ]
+ ensure: [ stream close ] ]
+ ifNil: [(FileDirectory requestDropDirectory: i) ifNotNil: [:directory |
+ (ExternalDropHandler lookupExternalDropHandler: directory) ifNotNil: [:handler |
+ handler handle: directory in: self dropEvent: anEvent]]]].!
- (stream := FileStream requestDropStream: i) ifNotNil: [
- handler := ExternalDropHandler lookupExternalDropHandler: stream.
- [ handler ifNotNil: [handler handle: stream in: self dropEvent: anEvent ] ]
- ensure: [ stream close ] ] ].!