PeanutProfileImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Doug Wyatt, July 2, 1985 11:35:11 am PDT
Bertrand Serlet June 27, 1986 2:24:59 pm PDT
DIRECTORY
Ascii USING [Lower],
Atom USING [MakeAtom],
PeanutProfile USING [],
Rope USING [ROPE, Translate, TranslatorType],
UserProfile USING [Boolean, CallWhenProfileChanges, Number, ProfileChangedProc, Token];
PeanutProfileImpl: CEDAR PROGRAM
IMPORTS Ascii, Atom, Rope, UserProfile
EXPORTS PeanutProfile
= BEGIN
ROPE: TYPE = Rope.ROPE;
automaticNewMail: PUBLIC BOOL ← FALSE; -- Peanut.AutomaticNewMail
toBeforeSubject: PUBLIC BOOL ← FALSE; -- Peanut.ToBeforeSubject
ccField: PUBLIC BOOL ← FALSE; -- Peanut.CarbonCopyField
ccToSelf: PUBLIC BOOL ← FALSE; -- Peanut.CarbonCopyToSelf
messageNodeFormat: PUBLIC ATOM ← NIL; -- Peanut.MessageNodeFormat
killViewersOnSaveAll: PUBLIC BOOL ← FALSE; -- Peanut.KillViewersOnSaveAll
startIconic: PUBLIC BOOL ← FALSE; -- Peanut.StartIconic
windowHeight: PUBLIC INT ← 0; -- Peanut.WindowHeight
activeMailFile: PUBLIC ROPE ← NIL; -- Peanut.ActiveMailFile
outgoingMailFile: PUBLIC ROPE ← NIL; -- Peanut.OutgoingMailFile
workingDirectory: PUBLIC ROPE ← NIL; -- Peanut.WorkingDirectory
recipients: PUBLIC ROPE; -- Peanut.Recipients
signature: PUBLIC ROPE; -- Peanut.Signature
LCAtomFromRope:
PROC [rope:
ROPE]
RETURNS [
ATOM] ~ {
lowerCase: Rope.TranslatorType ~ { new ← Ascii.Lower[old] };
RETURN[Atom.MakeAtom[Rope.Translate[base: rope, translator: lowerCase]]];
};
ChangePeanutProfile: UserProfile.ProfileChangedProc = {
automaticNewMail ← UserProfile.Boolean["Peanut.AutomaticNewMail", FALSE];
toBeforeSubject ← UserProfile.Boolean["Peanut.ToBeforeSubject", FALSE];
ccField ← UserProfile.Boolean["Peanut.CarbonCopyField", TRUE];
ccToSelf ← UserProfile.Boolean["Peanut.CarbonCopyToSelf", TRUE];
messageNodeFormat ← LCAtomFromRope[UserProfile.Token["Peanut.MessageNodeFormat", NIL]];
killViewersOnSaveAll ← UserProfile.Boolean["Peanut.KillViewersOnSaveAll", FALSE];
startIconic ← UserProfile.Boolean["Peanut.StartIconic", TRUE];
windowHeight ← UserProfile.Number["Peanut.WindowHeight", 80];
activeMailFile ← UserProfile.Token["Peanut.ActiveMailFile", "Active"];
outgoingMailFile ← UserProfile.Token["Peanut.OutgoingMailFile", ""];
workingDirectory ← UserProfile.Token["Peanut.WorkingDirectory", NIL];
recipients ← UserProfile.Token["Peanut.Recipients", "Recipients"];
signature ← UserProfile.Token["Peanut.Signature", NIL];
};
UserProfile.CallWhenProfileChanges[ChangePeanutProfile];
END.