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 BOOLFALSE; -- Peanut.AutomaticNewMail
toBeforeSubject: PUBLIC BOOLFALSE; -- Peanut.ToBeforeSubject
ccField: PUBLIC BOOLFALSE; -- Peanut.CarbonCopyField
ccToSelf: PUBLIC BOOLFALSE; -- Peanut.CarbonCopyToSelf
messageNodeFormat: PUBLIC ATOMNIL; -- Peanut.MessageNodeFormat
killViewersOnSaveAll: PUBLIC BOOLFALSE; -- Peanut.KillViewersOnSaveAll
startIconic: PUBLIC BOOLFALSE; -- Peanut.StartIconic
windowHeight: PUBLIC INT ← 0; -- Peanut.WindowHeight
activeMailFile: PUBLIC ROPENIL; -- Peanut.ActiveMailFile
outgoingMailFile: PUBLIC ROPENIL; -- Peanut.OutgoingMailFile
workingDirectory: PUBLIC ROPENIL; -- 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.