'From Squeak3.3alpha of 18 January 2002 [latest update: #4913] on 4 July 2002 at 7:06:34 pm'! "Change Set: chgsFileForAlpha-sw Date: 4 July 2002 Author: Scott Wallace Adaptation to make the new filelist feature in Hunter Kelly's update 4908changesFileBrowsing available in the 3.3a registering file-list. NOT to be retrofitted to 3.2."! !ChangeList class methodsFor: 'public access' stamp: 'sw 7/4/2002 19:05'! browseRecentLogOn: origChangesFile "figure out where the last snapshot or quit was, then browse the recent entries." | end done block pos chunk changesFile positions prevBlock | changesFile _ origChangesFile readOnlyCopy. positions _ SortedCollection new. end _ changesFile size. prevBlock _ end. block _ end - 1024 max: 0. done _ false. [done or: [positions size > 0]] whileFalse: [changesFile position: block. "ignore first fragment" changesFile nextChunk. [changesFile position < prevBlock] whileTrue: [pos _ changesFile position. chunk _ changesFile nextChunk. ((chunk indexOfSubCollection: '----SNAPSHOT----' startingAt: 1) = 1 or: [(chunk indexOfSubCollection: '----QUIT----' startingAt: 1) = 1]) ifTrue: [positions add: pos]]. block = 0 ifTrue: [done _ true] ifFalse: [prevBlock _ block. block _ block - 1024 max: 0]]. changesFile close. positions isEmpty ifTrue: [self inform: 'File ' , changesFile name , ' does not appear to be a changes file'] ifFalse: [self browseRecentLogOn: origChangesFile startingFrom: positions last]! ! !ChangeList class methodsFor: 'public access' stamp: 'sw 7/4/2002 18:54'! browseRecentLogOnPath: fullName "figure out where the last snapshot or quit was, then browse the recent entries." fullName ifNotNil: [self browseRecentLogOn: (FileStream readOnlyFileNamed: fullName)] ifNil: [self beep] ! ! !ChangeList class methodsFor: 'fileIn/Out' stamp: 'sw 7/4/2002 18:56'! fileReaderServicesForFile: fullName suffix: suffix ^ (FileStream isSourceFileSuffix: suffix) ifTrue: [Array with: self serviceBrowseChangeFile] ifFalse: [suffix = 'changes' ifTrue: [Array with: self serviceBrowseDotChangesFile] ifFalse: [#()]]! ! !ChangeList class methodsFor: 'fileIn/Out' stamp: 'sw 7/4/2002 18:37'! serviceBrowseDotChangesFile "Answer a service for opening a changelist browser on the tail end of a .changes file" ^ SimpleServiceEntry provider: self label: 'recent changes in file' selector: #browseRecentLogOnPath: description: 'open a changelist tool on recent changes in file' buttonLabel: 'recent changes'! ! !ChangeList class methodsFor: 'fileIn/Out' stamp: 'sw 7/4/2002 19:05'! services "Answer potential file services associated with this class" ^ Array with: self serviceBrowseChangeFile with: self serviceBrowseDotChangesFile! ! !FileList methodsFor: 'file list menu' stamp: 'sw 7/4/2002 19:02'! fullFileListMenu: aMenu shifted: aBoolean "Fill the menu with all possible items for the file list pane, regardless of selection." | services servicesPlus extraLines linePointer | aMenu title: 'all possible file operations'. servicesPlus := self servicesFromSelectorSpecs: #( openImageInWindow: importImage: openAsBackground: - fromFileName: openFromFile: - openOn: fileIntoNewChangeSet: fileIn: browseChangesFile: putUpdate: browseRecentLogOnPath: - playMidiFile: openAsMovie: openAsFlash: openTTFFile: open3DSFile: openTapeFromFile: openVRMLFile: - viewContents: saveContents: openOn: - removeLineFeeds: renderFile: - loadCRDictionary: loadCRDisplayProperties: ). extraLines _ OrderedCollection new. linePointer _ 1. services _ OrderedCollection new. servicesPlus doWithIndex: [:svc :ind | svc == #- ifTrue: [extraLines add: linePointer - 1] ifFalse: [services add: svc. linePointer _ linePointer + 1]]. aMenu addServices: services for: self fullName extraLines: extraLines! !