[squeak-dev] The Trunk: MorphicExtras-fbs.146.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Dec 31 12:25:22 UTC 2013


Frank Shearar uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-fbs.146.mcz

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

Name: MorphicExtras-fbs.146
Author: fbs
Time: 31 December 2013, 12:19:52.384 pm
UUID: ae8f7f9f-3edc-8546-b6de-b54e889c225e
Ancestors: MorphicExtras-nice.145

* Turn #preserveTrash and #slideDismissalsToTrash into pragma preferences.
* Update call sites for same.
* Accidentally on purpose alphabetise the categories, while we're mucking around with the package.

=============== Diff against MorphicExtras-nice.145 ===============

Item was changed:
  SystemOrganization addCategory: #'MorphicExtras-AdditionalMorphs'!
  SystemOrganization addCategory: #'MorphicExtras-AdditionalSupport'!
  SystemOrganization addCategory: #'MorphicExtras-AdditionalWidgets'!
  SystemOrganization addCategory: #'MorphicExtras-Books'!
  SystemOrganization addCategory: #'MorphicExtras-Demo'!
  SystemOrganization addCategory: #'MorphicExtras-EToy-Download'!
+ SystemOrganization addCategory: #'MorphicExtras-Exceptions'!
  SystemOrganization addCategory: #'MorphicExtras-Flaps'!
  SystemOrganization addCategory: #'MorphicExtras-GeeMail'!
  SystemOrganization addCategory: #'MorphicExtras-Leds'!
  SystemOrganization addCategory: #'MorphicExtras-Navigators'!
  SystemOrganization addCategory: #'MorphicExtras-Obsolete'!
  SystemOrganization addCategory: #'MorphicExtras-Palettes'!
  SystemOrganization addCategory: #'MorphicExtras-PartsBin'!
  SystemOrganization addCategory: #'MorphicExtras-Postscript Canvases'!
  SystemOrganization addCategory: #'MorphicExtras-Postscript Filters'!
  SystemOrganization addCategory: #'MorphicExtras-Sound'!
  SystemOrganization addCategory: #'MorphicExtras-SoundInterface'!
  SystemOrganization addCategory: #'MorphicExtras-SqueakPage'!
  SystemOrganization addCategory: #'MorphicExtras-Support'!
  SystemOrganization addCategory: #'MorphicExtras-Text Support'!
  SystemOrganization addCategory: #'MorphicExtras-Undo'!
  SystemOrganization addCategory: #'MorphicExtras-Widgets'!
- SystemOrganization addCategory: #'MorphicExtras-Exceptions'!

Item was changed:
  ----- Method: ScrapBook>>addToTrash: (in category 'scraps') -----
  addToTrash: aMorph
  	"Paste the object onto a page of the system Trash book, unless the preference is set to empty the trash immediately."
  
  	| aPage |
+ 	TrashCanMorph preserveTrash ifFalse: [^ self].
- 	Preferences preserveTrash ifFalse: [^ self].
  
  	aMorph position: book pages first position + (0 at 40).
  	book pages do: [:pp | 
  		(pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue:  "perhaps remove that property here"
  			["page is blank"
  			^ pp addMorph: aMorph]].
  	aPage := book insertPageLabel: Time dateAndTimeNow printString
  		morphs: (Array with: aMorph).
  	aPage setProperty: #trash toValue: true!

Item was changed:
  ThreePhaseButtonMorph subclass: #TrashCanMorph
  	instanceVariableNames: ''
+ 	classVariableNames: 'PreserveTrash SlideDismissalsToTrash TrashPic TrashPicOn'
- 	classVariableNames: 'TrashPic TrashPicOn'
  	poolDictionaries: ''
  	category: 'MorphicExtras-AdditionalWidgets'!

Item was changed:
  ----- Method: TrashCanMorph class>>moveToTrash: (in category 'miscellaneous') -----
  moveToTrash: aMorph
  	SoundService soundEnabled ifTrue:
+ 		[TrashCanMorph preserveTrash 
+ 			ifFalse: [self playSoundNamed: 'scratch']
+ 			ifTrue: [self playDeleteSound]].
- 		[Preferences preserveTrash 
- 			ifFalse:
- 				[self playSoundNamed: 'scratch']
- 			ifTrue:
- 				[self playDeleteSound]].
  
  	aMorph delete.
  	aMorph == ScrapBook default scrapBook ifFalse:
  		[ScrapBook default addToTrash: aMorph]!

Item was added:
+ ----- Method: TrashCanMorph class>>preserveTrash (in category 'preferences') -----
+ preserveTrash
+ 	<preference: 'Preserve trash' category: 'morphic' description: 'If true, morphs dismissed via halo or dragged into the Trash willbe preserved in the TrashCan for possible future retrieval.' type: #Boolean>
+ 	^ PreserveTrash ifNil: [false].!

Item was added:
+ ----- Method: TrashCanMorph class>>preserveTrash: (in category 'preferences') -----
+ preserveTrash: aBoolean
+ 	PreserveTrash := aBoolean.!

Item was added:
+ ----- Method: TrashCanMorph class>>slideDismissalsToTrash (in category 'preferences') -----
+ slideDismissalsToTrash
+ 	<preference: 'Slide dismissals to trash' category: 'morphic' description: 'If true, when you dismiss a Morph it will slide to the TrashCan.' type: #Boolean>
+ 	^ SlideDismissalsToTrash ifNil: [false].!

Item was added:
+ ----- Method: TrashCanMorph class>>slideDismissalsToTrash: (in category 'preferences') -----
+ slideDismissalsToTrash: aBoolean
+ 	SlideDismissalsToTrash := aBoolean.!

Item was changed:
  ----- Method: TrashCanMorph>>acceptDroppingMorph:event: (in category 'layout') -----
  acceptDroppingMorph: aMorph event: evt 
  	SoundService soundEnabled
+ 		ifTrue: [TrashCanMorph preserveTrash
- 		ifTrue: [Preferences preserveTrash
  				ifTrue: [self class playDeleteSound]
  				ifFalse: [self playSoundNamed: 'scratch']].
  	evt hand visible: true.
  	self state: #off.
  	aMorph delete.
  	aMorph == ScrapBook default scrapBook
  		ifFalse: [ScrapBook default addToTrash: aMorph removeHalo]!

Item was changed:
+ (PackageInfo named: 'MorphicExtras') postscript: 'TrashCanMorph preserveTrash: Preferences preserveTrash.
+ TrashCanMorph slideDismissalsToTrash: Preferences slideDismissalsToTrash.
+ 
+ Preferences removePreference: #preserveTrash.
+ Preferences removePreference: #slideDismissalsToTrash.'!
- (PackageInfo named: 'MorphicExtras') postscript: 'Flaps initializeFlapsQuads.'!



More information about the Squeak-dev mailing list