A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-fbs.532.mcz ==================== Summary ==================== Name: System-fbs.532 Author: fbs Time: 18 May 2013, 10:58:59.877 pm UUID: 2455a403-4129-451e-ae74-472a347a791e Ancestors: System-fbs.531 Remove ScrapsBook classvar from Utilities. Instead, lazily instantiate a ScrapBook instance, and delegate trash behaviour to it. =============== Diff against System-fbs.531 =============== Item was changed: Object subclass: #Utilities instanceVariableNames: '' + classVariableNames: 'AuthorInitials AuthorName CommonRequestStrings LastStats RecentSubmissions UpdateDownloader UpdateUrlLists' - classVariableNames: 'AuthorInitials AuthorName CommonRequestStrings LastStats RecentSubmissions ScrapsBook UpdateDownloader UpdateUrlLists' poolDictionaries: '' category: 'System-Support'! !Utilities commentStamp: '<historical>' prior: 0! A repository for general and miscellaneous utilities; much of what is here are in effect global methods that don't naturally attach to anything else. 1/96 sw! Item was removed: - ----- Method: Utilities class>>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." - - | aBook aPage | - Preferences preserveTrash ifFalse: [^ self]. - - aBook := self scrapsBook. - aMorph position: aBook pages first position + (0@40). - aBook pages do: [:pp | - (pp submorphs size = 1 and: [pp hasProperty: #trash]) ifTrue: "perhaps remove that property here" - ["page is blank" - ^ pp addMorph: aMorph]]. - aPage := aBook insertPageLabel: Time dateAndTimeNow printString - morphs: (Array with: aMorph). - aPage setProperty: #trash toValue: true! Item was removed: - ----- Method: Utilities class>>cleanUp: (in category 'class initialization') ----- - cleanUp: agressive - "Nuke the scraps book when cleaning aggressively" - - agressive ifTrue:[ScrapsBook := nil].! Item was removed: - ----- Method: Utilities class>>emptyScrapsBook (in category 'scraps') ----- - emptyScrapsBook - "Utilities emptyScrapsBook" - | oldScraps | - oldScraps := ScrapsBook. - ScrapsBook := nil. - self scrapsBook. "Creates it afresh" - (oldScraps notNil and: [oldScraps owner notNil]) - ifTrue: - [ScrapsBook position: oldScraps position. - oldScraps owner replaceSubmorph: oldScraps by: ScrapsBook. - ScrapsBook changed; layoutChanged]! Item was changed: ----- Method: Utilities class>>initialize (in category 'class initialization') ----- initialize + (self classVarNames includes: 'ScrapsBook') ifTrue: [self removeClassVarName: 'ScrapsBook'].! - "Initialize the class variables. 5/16/96 sw" - self initializeCommonRequestStrings. - RecentSubmissions := OrderedCollection new. - - self registerInFlapsRegistry. ! Item was removed: - ----- Method: Utilities class>>maybeEmptyTrash (in category 'scraps') ----- - maybeEmptyTrash - (self confirm: 'Do you really want to empty the trash?' translated) - ifTrue: [self emptyScrapsBook]! Item was removed: - ----- Method: Utilities class>>trashTitle (in category 'scraps') ----- - trashTitle - | label pgs | - label := 'T R A S H' translated. - ^ (pgs := ScrapsBook pages size) < 2 - ifTrue: - [label] - ifFalse: - [label, (' ({1} pages)' translated format:{pgs})] - ! |
Free forum by Nabble | Edit this page |