[squeak-dev] The Trunk: Morphic-topa.1024.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Nov 2 09:10:18 UTC 2015


Tobias Pape uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-topa.1024.mcz

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

Name: Morphic-topa.1024
Author: topa
Time: 2 November 2015, 10:09:39.152 am
UUID: 4751f1ce-2b2c-465c-9a03-b10e2260993c
Ancestors: Morphic-kfr.1023

Try directories before files when handling dropped items.

(Because on Unix, we'll get a file for a directory but obviously not vice versa)

=============== Diff against Morphic-kfr.1023 ===============

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 := anEvent contents.
  	1 to: numFiles do: [ :i |
+ 		(FileDirectory requestDropDirectory: i) 
+ 			ifNotNil: [:directory | self handleDroppedItem: directory event: anEvent]
+ 			ifNil: [(FileStream requestDropStream: i) ifNotNil: [:stream |
+ 				[self handleDroppedItem: stream event: anEvent] ensure: [stream close]]]].
+ 				!
- 		(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]]]].!

Item was added:
+ ----- Method: PasteUpMorph>>handleDroppedItem:event: (in category 'event handling') -----
+ handleDroppedItem: anItem event: anEvent
+ 	
+ 	(ExternalDropHandler lookupExternalDropHandler: anItem)
+ 		ifNotNil: [:handler | handler handle: anItem in: self dropEvent: anEvent].!



More information about the Squeak-dev mailing list