'From Squeak3.1alpha of 28 February 2001 [latest update: #4320] on 5 September 2001 at 6:06:45 pm'! "Change Set: prettyDiffs-sw Date: 5 September 2001 Author: Scott Wallace Resolves conflicts and establishes consistency between the #diffsWithPrettyPrint Preference and the ability of any code pane to show *any* source mode, including either kind of diffs. CLARIFICATION: The 'diffsWithPrettyPrint' preference governs what the *default* diffing mode should be. Thus, ChangeList & Versions browsers will open up showing regular diffing or pretty-diffing, depending on the setting of the preference. And when the diffing mode of any code tool is turned on by the cmd-shift-D shortcut (issued when the cursor is over the selector-list-pane), the kind of diffing instituted will be the one specified by the Preference. But none of this interferes with the user's ability to show any kind of diffing, or any other form of source-code representation, in any given window."! !ChangeListForProjects commentStamp: 'sw 9/5/2001 15:30' prior: 0! A ChangeList that looks at the changes in a revokable project. This class has no users at present.! !CodeHolder methodsFor: 'diffs' stamp: 'sw 9/5/2001 13:36'! defaultDiffsSymbol "Answer the code symbol to use when generically switching to diffing" ^ Preferences diffsWithPrettyPrint ifTrue: [#prettyDiffs] ifFalse: [#showDiffs]! ! !CodeHolder methodsFor: 'diffs' stamp: 'sw 9/5/2001 13:36'! showDiffs: aBoolean "Set whether I'm showing diffs as indicated; use the global preference to determine which kind of diffs to institute." self showingAnyKindOfDiffs ifFalse: [aBoolean ifTrue: [contentsSymbol _ self defaultDiffsSymbol]] ifTrue: [aBoolean ifFalse: [contentsSymbol _ #source]]. self setContentsToForceRefetch. self contentsChanged! ! !CodeHolder methodsFor: 'diffs' stamp: 'sw 9/5/2001 13:32'! showingAnyKindOfDiffs "Answer whether the receiver is currently set to show any kind of diffs" ^ #(showDiffs prettyDiffs) includes: contentsSymbol! ! !CodeHolder methodsFor: 'diffs' stamp: 'sw 9/5/2001 13:33'! toggleDiffing "Toggle whether diffs should be shown in the code pane" | wasShowingDiffs | self okToChange ifTrue: [wasShowingDiffs _ self showingAnyKindOfDiffs. self restoreTextualCodingPane. self showDiffs: wasShowingDiffs not. self setContentsToForceRefetch. self contentsChanged] ! ! !ChangeList methodsFor: 'initialization-release' stamp: 'sw 9/5/2001 13:53'! initialize "Initialize a blank ChangeList. Set the contentsSymbol to reflect whether diffs will initally be shown or not" contentsSymbol _ Preferences diffsInChangeList ifTrue: [self defaultDiffsSymbol] ifFalse: [#source]. changeList _ OrderedCollection new. list _ OrderedCollection new. listIndex _ 0. super initialize! ! !ChangeList methodsFor: 'viewing access' stamp: 'sw 9/5/2001 13:52'! contents "Answer the contents string, obeying diffing directives if needed" ^ self showingAnyKindOfDiffs ifFalse: [self undiffedContents] ifTrue: [self showsVersions ifTrue: [self diffedVersionContents] ifFalse: [self contentsDiffedFromCurrent]]! ! !ChangeListForProjects methodsFor: 'contents' stamp: 'sw 9/5/2001 15:25'! contents ^ self showingAnyKindOfDiffs ifFalse: [self undiffedContents] ifTrue: [self currentDiffedFromContents] "Current is writing over one in list. Show how I would change it"! ! !ChangeSorter methodsFor: 'code pane' stamp: 'sw 9/5/2001 13:32'! toggleDiffing "Toggle whether diffs should be shown in the code pane" self okToChange ifTrue: [self showDiffs: self showingAnyKindOfDiffs not. self changed: #contents. self update] ! !