'From Squeak3.3alpha of 25 January 2002 [latest update: #4743] on 5 February 2002 at 9:09:16 pm'! "Change Set: undoRecords-sw Date: 5 February 2002 Author: Scott Wallace Removes the intrusive dialog concerning undo records that usually popped up whenever 'Smalltalk spaceLeft' was invoked. Instead, the user is given a separate command in the help menu for expunging command records, and the report ensuing from a spaceLeft request will simply *mention* the presence of extant undo records."! !CommandHistory class methodsFor: 'system startup' stamp: 'sw 2/5/2002 20:45'! forgetGrabCommandsInAllMorphs "Forget all the commands that might be held on to in the properties dicitonary of various morphs for various reasons." Smalltalk allObjectsDo: [:obj | obj isMorph ifTrue: [obj removeProperty:#undoGrabCommand]]. "CommandHistory forgetGrabCommandsInAllMorphs" ! ! !CommandHistory class methodsFor: 'system startup' stamp: 'sw 2/5/2002 20:46'! resetAllHistory "Reset all command histories, and make all morphs that might be holding on to undo-grab-commands forget them" self allInstancesDo: [:c | c resetCommandHistory]. self forgetGrabCommandsInAllMorphs "CommandHistory resetAllHistory" ! ! !ScreenController methodsFor: 'menu messages' stamp: 'sw 2/5/2002 13:17'! garbageCollect "Do a garbage collection, and report results to the user." | cc reportString | reportString _ String streamContents: [:aStream | aStream nextPutAll: Smalltalk bytesLeftString. Smalltalk at: #Command ifPresent: [:cmdClass | (cc _ cmdClass instanceCount) > 0 ifTrue: [aStream cr; nextPutAll: ('(note: there are ', cc printString, ' undo record(s) present in your system; purging them may free up more space.)')]]]. self inform: reportString "ScheduledControllers screenController garbageCollect"! ! !TheWorldMenu methodsFor: 'construction' stamp: 'sw 2/5/2002 20:30'! helpMenu "Build the help menu for the world." | screenCtrl genieEnabledString | screenCtrl _ ScreenController new. genieEnabledString _ World currentHand isGenieEnabled ifTrue: ['disable'] ifFalse: ['enable']. ^ self fillIn: (self menu: 'help...') from: { {'about this system...'. {Smalltalk. #aboutThisSystem}. 'current version information.'}. {'update code from server'. {Utilities. #updateFromServer}. 'load latest code updates via the internet'}. {'preferences...'. {Preferences. #openPreferencesInspector}. 'view and change various options.'}. {'set language...' . {Project. #chooseNaturalLanguage}. 'choose the language in which tiles should be displayed.'} . nil. {genieEnabledString , ' genie'. {World currentHand. #switchGenieEnabled}. genieEnabledString , ' gesture recognizer for the world''s current hand'}. {'genie gesture dictionaries'. {CRDictionary. #openInstanceBrowserMorph}. 'edit or inspect gesture dictionaries'.}. {'choose genie text dictionary'. {CRDictionary. #chooseTextDictionary}. 'select the dictionary used for text input'.}. {'genie display properties'. {CRDisplayProperties. #openInstanceBrowserMorph}. 'edit or inspect display properies'.}. nil. {'command-key help'. { Utilities . #openCommandKeyHelp}. 'summary of keyboard shortcuts.'}. {'world menu help'. { self . #worldMenuHelp}. 'helps find menu items buried in submenus.'}. "{'info about flaps' . { Utilities . #explainFlaps}. 'describes how to enable and use flaps.'}." {'font size summary' . { Utilities . #fontSizeSummary}. 'summary of names and sizes of available fonts.'}. {'useful expressions' . { Utilities . #openStandardWorkspace}. 'a window full of useful expressions.'}. {'annotation setup...' . { Preferences . #editAnnotations}. 'Click here to get a little window that will allow you to specify which types of annotations, in which order, you wish to see in the annotation panes of browsers and other tools'}. nil. {'graphical imports' . { Smalltalk . #viewImageImports}. 'view the global repository called ImageImports; you can easily import external graphics into ImageImports via the FileList'}. {'standard graphics library' . { ScriptingSystem . #inspectFormDictionary}. 'lets you view and change the system''s standard library of graphics.'}. nil. {'telemorphic...' . {self. #remoteDo}. 'commands for doing multi-machine "telemorphic" experiments'}. {#soundEnablingString . { Preferences . #toggleSoundEnabling}. 'turning sound off will completely disable Squeak''s use of sound.'}. {'definition for...' . { Utilities . #lookUpDefinition}. 'if connected to the internet, use this to look up the definition of an English word.'}. nil. {'set author initials...' . { screenCtrl . #setAuthorInitials }. 'supply initials to be used to identify the author of code and other content.'}. {'vm statistics' . { screenCtrl . #vmStatistics}. 'obtain some intriguing data about the vm.'}. nil. {'purge undo records' . { CommandHistory . #resetAllHistory }. 'save space by removing all the undo information remembered in all projects.'}. {'space left' . { screenCtrl . #garbageCollect}. 'perform a full garbage-collection and report how many bytes of space remain in the image.'}. } ! ! !Utilities class methodsFor: 'common requests' stamp: 'sw 2/5/2002 13:17'! initializeCommonRequestStrings "Initialize the common request strings, a directly-editable list of expressions that can be evaluated from the 'do...' menu." CommonRequestStrings _ StringHolder new contents: 'Utilities emergencyCollapse. Utilities closeAllDebuggers. - Sensor keyboard. ParagraphEditor abandonChangeText. Cursor normal show. - CommandHistory resetAllHistory. Project allInstancesDo: [:p | p displayDepth: 16]. ScriptingSystem inspectFormDictionary. Form fromUser bitEdit. Display border: (0@0 extent: 640@480) width: 2. - Undeclared inspect. Undeclared removeUnreferencedKeys; inspect. Transcript clear. Utilities grabScreenAndSaveOnDisk. FrameRateMorph new openInHand. - Utilities reconstructTextWindowsFromFileNamed: ''TW''. Utilities storeTextWindowContentsToFileNamed: ''TW''. ChangeSorter removeEmptyUnnamedChangeSets. ChangeSorter reorderChangeSets. - ActiveWorld installVectorVocabulary. ActiveWorld abandonVocabularyPreference. Smalltalk saveAsNewVersion' "Utilities initializeCommonRequestStrings"! ! "Postscript:" CommandHistory forgetGrabCommandsInAllMorphs.!