<> <> <> <> <<>> 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.