<> <> <> <> <> <> <> <> <> DIRECTORY Commander USING [CommandProc, Handle, Register], CommandTool USING [CurrentWorkingDirectory, NextArgument, Parse], Containers, Convert USING [Error, IntFromRope], FS USING [ComponentPositions, Error, ExpandName], Icons USING [IconFlavor, NewIconFromFile], IO, MBQueue USING [Queue, Create, QueueClientAction], Menus, MessageWindow USING [Append], Process USING [Detach], Rope, Rules USING [Create], UserCredentials USING [Get], UserProfile USING [Boolean, Token], ViewerClasses USING [Viewer], ViewerEvents USING [EventProc, EventRegistration, RegisterEventProc], ViewerOps, ViewerSpecs USING[openLeftWidth, openTopY, openRightWidth], WalnutSendOps USING [userRName], WalnutSendOpsExtras USING [ChangeUserRName], WalnutOps USING [MsgSet, dontCareMsgSetVersion, CopyToExpungeLog, ExpungeMsgs, ReadArchiveFile, Shutdown], WalnutControlInternal USING [blankMenu, walnutMenu, workingMenu, BuildWalnutMenus, ChangeMenu, DoArchive, DoWaitCall, DoStartupCall, FlushWQueue, FixUpWalnutViewers, QuitWalnut, RestartWalnut], WalnutViewer USING [FirstLabel, MakeRuler, MakeTypescript], WalnutDisplayerInternal USING [QDisplayMsg, QDisplayMsgSet], WalnutPrintOps USING [PrintMsgCmd, PrintMsgSetCmd, PrintMsgSetTOCCmd, PrintSelCmd], WalnutWindowInternal USING [MsgSetButton, activeMsgSetButton, msgSetsVersion, CloseDownWalnut, DestroyAllMsgSetButtons, DisableNewMail, GetButton, OpenTS, Report, RetrieveNewMail, ShowMsgSetButtons, TakeDownWalnutViewers], WalnutWindow USING [OutCome]; WalnutWindowCommandsImpl: CEDAR PROGRAM IMPORTS FS, Commander, CommandTool, Convert, Containers, Icons, MBQueue, MessageWindow, Rules, IO, Process, Rope, UserCredentials, UserProfile, ViewerEvents, ViewerOps, ViewerSpecs, WalnutSendOps, WalnutSendOpsExtras, WalnutOps, WalnutControlInternal, WalnutDisplayerInternal, WalnutPrintOps, WalnutViewer, WalnutWindowInternal EXPORTS WalnutWindow, WalnutControlInternal, WalnutWindowInternal = BEGIN OPEN WalnutControlInternal, WalnutWindowInternal; <> ROPE: TYPE = Rope.ROPE; STREAM: TYPE = IO.STREAM; Viewer: TYPE = ViewerClasses.Viewer; InitialNotifyLabel: PUBLIC ROPE _ " "; walnutVersion: ROPE _ "Walnut 6.1"; walnut: PUBLIC Viewer _ NIL; msgSetIcon: PUBLIC Icons.IconFlavor _ tool; msgIcon: PUBLIC Icons.IconFlavor _ tool; labelledWalnutIcon: PUBLIC Icons.IconFlavor _ tool; labelledNewMailIcon: PUBLIC Icons.IconFlavor _ tool; unLabelledWalnutIcon: PUBLIC Icons.IconFlavor _ tool; unLabelledNewMailIcon: PUBLIC Icons.IconFlavor _ tool; walnutIcon: PUBLIC Icons.IconFlavor _ tool; newMailIcon: PUBLIC Icons.IconFlavor _ tool; iconFilePathName: PUBLIC ROPE _ NIL; walnutEventReg: PUBLIC ViewerEvents.EventRegistration_ NIL; mustQuitWalnut: PUBLIC ROPE _ NIL; previousUser: PUBLIC ROPE _ NIL; gettingOrganized: PUBLIC BOOL _ FALSE; readyToGo: PUBLIC CONDITION; initialActiveIconic: PUBLIC BOOL _ FALSE; initialActiveRight: PUBLIC BOOL _ TRUE; initialActiveOpen: PUBLIC BOOL _ TRUE; msgSetBorders: PUBLIC BOOL _ FALSE; walnutRulerBefore, walnutRulerAfter, walnutTS: PUBLIC Viewer; mailNotifyLabel: PUBLIC Viewer; -- is there new mail or not msgNamePrefix: PUBLIC ROPE; msgSetNamePrefix: PUBLIC ROPE; walnutRootFile: PUBLIC ROPE; readOnlyAccess: PUBLIC BOOL; personalMailDB: PUBLIC BOOL; walnutQueue: PUBLIC MBQueue.Queue; invocationDirectory: PUBLIC ROPE _ CommandTool.CurrentWorkingDirectory[]; searchRules: PUBLIC LIST OF REF ANY; <<* * * * * * * * * * Commander.CommandProc's - only Expunge & Shutdown Wait>> BuildWalnut: Commander.CommandProc = { dirName, rootName, captionName: ROPE; IF cmd # NIL THEN dirName _ CommandTool.NextArgument[cmd]; [rootName, captionName] _ ParseRootName[dirName]; IF rootName = NIL THEN { IF cmd # NIL THEN cmd.out.PutRope["\nNo RootFile specified\n"]; RETURN }; IF walnut # NIL THEN IF ~rootName.Equal[walnutRootFile, FALSE] THEN { TRUSTED { Process.Detach[ FORK ChangeDatabase[FALSE, rootName, captionName, dirName] ] }; RETURN }; TRUSTED {Process.Detach[FORK DoStartup[FALSE, rootName, captionName, dirName]] }; }; WalnutOldMailReader: Commander.CommandProc = { fName, messageSet: ROPE; IF walnut = NIL THEN { NoWalnutReport[cmd, "read old mail files"]; RETURN }; fName _ CommandTool.NextArgument[cmd]; IF fName = NIL THEN { Report["No file specified"]; RETURN; }; messageSet _ CommandTool.NextArgument[cmd]; TRUSTED {Process.Detach[FORK ReadMailFile[fName, messageSet, FALSE]] }; }; WalnutExpunge: Commander.CommandProc = { IF walnut = NIL THEN { NoWalnutReport[cmd, "do Expunge"]; RETURN}; Expunge[]; }; WalnutDump: Commander.CommandProc = {}; WalnutScavenge: Commander.CommandProc = { rootName, captionName, dirName: ROPE; dirName _ CommandTool.NextArgument[cmd]; [rootName, captionName] _ ParseRootName[dirName]; IF rootName = NIL THEN { cmd.out.PutRope["\n No rootfile given\n"]; RETURN; }; TRUSTED {Process.Detach[FORK DoScavenge[rootName, captionName, dirName]]}; }; WalnutMascarade: Commander.CommandProc = { dirName, rootName, captionName, rootUserName: ROPE; oldUser: ROPE; dirName _ CommandTool.NextArgument[cmd]; [rootName, captionName, dirName, rootUserName] _ ParseRootName[dirName]; IF rootName = NIL THEN { cmd.out.PutRope["\n No rootfile given\n"]; RETURN; }; IF NOT rootUserName.Equal[WalnutSendOps.userRName, FALSE] THEN { oldUser _ WalnutSendOps.userRName; WalnutSendOpsExtras.ChangeUserRName[rootUserName]; }; DoScavenge[rootName, captionName, dirName]; IF oldUser # NIL THEN WalnutSendOpsExtras.ChangeUserRName[oldUser]; cmd.out.PutF[ " Finished scavenging %g (done by %g)\n", IO.rope[rootName], IO.rope[oldUser]]; }; WalnutShutdown: Commander.CommandProc = { IF walnut # NIL THEN Shutdown[] }; WalnutNewMailProc: Commander.CommandProc = { IF walnut = NIL THEN RETURN; TRUSTED { Process.Detach[FORK RetrieveNewMail[]]}; }; WalnutPrintMsgSet: Commander.CommandProc = { msgSet, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgSet, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wpms[msgSet, server, TRUE, copies]] }; }; WalnutPrintIPMsgSet: Commander.CommandProc = { msgSet, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgSet, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wpms[msgSet, server, FALSE, copies]] }; }; WalnutPrintMsg: Commander.CommandProc = { msgName, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgName, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wpm[msgName, server, TRUE, copies]] }; }; WalnutPrintIPMsg: Commander.CommandProc = { msgName, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgName, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wpm[msgName, server, FALSE, copies]] }; }; WalnutPrintMsgSetTOC: Commander.CommandProc = { msgSet, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgSet, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wpmst[msgSet, server, TRUE, copies]] }; }; WalnutPrintIPMsgSetTOC: Commander.CommandProc = { msgSet, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgSet, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wpmst[msgSet, server, FALSE, copies]] }; }; WalnutPrintSel: Commander.CommandProc = { msgSet, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgSet, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wps[msgSet, server, TRUE, copies]] }; }; WalnutPrintIPSel: Commander.CommandProc = { msgSet, server: ROPE; copies: INT; IF walnut = NIL THEN RETURN; [msgSet, server, copies] _ ParseForPrinting[cmd]; TRUSTED { Process.Detach[FORK Wps[msgSet, server, FALSE, copies]] }; }; <<* * * * * * * * * * exported to WalnutWindow - these all wait for completion>> DisplayMsg: PUBLIC PROC[msg: ROPE, oldV: Viewer _ NIL, shift: BOOL _ FALSE] RETURNS[v: Viewer] = { Dm: PROC = -- don't open if iconic { v _ WalnutDisplayerInternal.QDisplayMsg[msg, oldV, shift, FALSE] }; [] _ DoWaitCall[Dm]; }; DisplayMsgSet: PUBLIC PROC[msgSet: ROPE, shift: BOOL _ FALSE, repaint: BOOL _ TRUE] RETURNS[v: Viewer] = { Dms: PROC = { v _ WalnutDisplayerInternal.QDisplayMsgSet[GetButton[msgSet], NIL, shift, repaint]; }; [] _ DoWaitCall[Dms]; }; CurrentVersion: PUBLIC PROC[msName: ROPE] RETURNS[version: INT] = { Dms: PROC = { version _ GetButton[msName].msgSet.version }; [] _ DoWaitCall[Dms] }; StartUp: PUBLIC PROC[rootFile: ROPE, scavengeFirst: BOOL _ FALSE] = { rootName, captionName: ROPE; [rootName, captionName] _ ParseRootName[rootFile]; IF walnut # NIL THEN IF rootFile.Equal[walnutRootFile, FALSE] THEN { Report["\nWalnut is already running"]; RETURN} ELSE { ChangeDatabase[scavengeFirst, rootName, captionName, rootFile]; RETURN }; DoStartup[scavengeFirst: scavengeFirst, rootName: rootName, captionName: captionName, iconLabel: rootFile] }; Shutdown: PUBLIC PROC = { Sd: PROC = { CloseDownWalnut[] }; [] _ DoWaitCall[Sd]; }; <<>> QueueCall: PUBLIC PROC[proc: PROC[] RETURNS[doReset: BOOL]] RETURNS[outCome: WalnutWindow.OutCome] = { Qc: PROC = { IF ~proc[] THEN RETURN; WalnutWindowInternal.ShowMsgSetButtons[]; WalnutControlInternal.FixUpWalnutViewers[]; }; outCome _ DoWaitCall[Qc]; }; Expunge: PUBLIC PROC = { Ep: PROC = { ENABLE UNWIND => { ChangeMenu[walnutMenu, FALSE] }; ok: BOOL _ TRUE; Quitting[IO.PutFR["\n****** Starting expunge at %g\n", IO.time[]], TRUE]; BEGIN ENABLE ABORTED => {ok _ FALSE; CONTINUE}; [] _ WalnutOps.ExpungeMsgs[WalnutOps.dontCareMsgSetVersion]; WalnutOps.CopyToExpungeLog[]; END; IF ~ok THEN { Report["\n Expunge failed or aborted; some changes have been aborted"]; ChangeMenu[walnutMenu, FALSE]; RETURN }; Report[IO.PutFR["\n ***** Expunge complete at %g\n", IO.time[]]]; WalnutOps.Shutdown[]; IF ~RestartWalnut[walnutRootFile, FALSE, TRUE] THEN RETURN; ChangeMenu[walnutMenu, FALSE]; }; [] _ DoWaitCall[Ep]; }; Scavenge: PUBLIC PROC[rootFile: ROPE] = { rootName, captionName: ROPE; [rootName, captionName] _ ParseRootName[rootFile]; IF rootName = NIL THEN RETURN; DoScavenge[rootName, captionName, rootFile]; }; ReadArchiveFile: PUBLIC PROC[fileName, msgSet: ROPE, useCategoriesInFile: BOOL] = { ReadMailFile[fileName, msgSet, useCategoriesInFile] }; WriteArchiveFile: PUBLIC PROC[fileName: ROPE, msgSetList: LIST OF ROPE] = { Waf: PROC = { msList: LIST OF WalnutOps.MsgSet; FOR mL: LIST OF ROPE _ msgSetList, mL.rest UNTIL mL = NIL DO msList _ CONS[ [mL.first, WalnutOps.dontCareMsgSetVersion], msList]; ENDLOOP; [] _ WalnutControlInternal.DoArchive[ fileName: fileName, msList: msList, append: FALSE] }; [] _ DoWaitCall[Waf]; }; <<* * * * * * * * * * * * local procedures>> NoWalnutReport: PROC[cmd: Commander.Handle, msg: ROPE] = { r: ROPE _ Rope.Concat["Walnut must be running to ", msg]; IF cmd # NIL THEN cmd.out.PutRope[r] ELSE MessageWindow.Append[r] }; ParseRootName: PROC[dirName: ROPE] RETURNS[rootName, captionName, iconLabel, rootUserName: ROPE] = { rName: ROPE; alpServer: ROPE = "[Luther.alpine]<"; root: ROPE = ">Walnut.Root"; user: ROPE _ UserCredentials.Get[].name; cp: FS.ComponentPositions; IF dirName.Length = 0 THEN { rName _ UserProfile.Token[key: "Walnut.WalnutRootFile", default: ""]; IF rName.Length[] = 0 THEN rName _ Rope.Cat[alpServer, user, root]; captionName _ walnutVersion; } ELSE { ch: CHAR = dirName.Fetch[0]; IF ch = '[ OR ch = '/ THEN rName _ dirName ELSE rName _ Rope.Cat[alpServer, dirName, root]; captionName _ Rope.Cat[walnutVersion, " {", dirName, "}"]; }; [rootName, cp, ] _ FS.ExpandName[rName, NIL]; IF cp.ext.length = 0 THEN rootName _ rootName.Concat[".Root"]; rootUserName _ rootName.Substr[cp.dir.start, cp.dir.length]; }; DoStartup: PROC[scavengeFirst: BOOL, rootName, captionName, iconLabel: ROPE] = { Su: PROC[BOOL] = { BuildWalnutControlWindow[captionName]; IF ~RestartWalnut[ rootFile: rootName, scavengeFirst: scavengeFirst, firstTime: TRUE] THEN RETURN; Report["\n ...Ready"]; ViewerOps.AddProp[walnut, $IconLabel, iconLabel]; }; [] _ DoStartupCall[Su]; }; startScavMsg: ROPE = "\n ***** Starting scavenge @ %g, using rootFile %g "; endScavMsg: ROPE = "\n ***** Scavenge finished @ %g "; DoScavenge: PROC[rootName, captionName, iconLabel: ROPE] = { Sp: PROC[isRunning: BOOL] = { ENABLE UNWIND => { ChangeMenu[walnutMenu, FALSE] }; IF isRunning THEN { Quitting[NIL, TRUE]; WalnutOps.Shutdown[]; Report[IO.PutFR[startScavMsg, IO.time[], IO.rope[rootName]] ]; walnut.name _ captionName; ViewerOps.PaintViewer[walnut, caption]; IF ~RestartWalnut[rootFile: rootName, scavengeFirst: TRUE] THEN RETURN; Report[IO.PutFR[endScavMsg, IO.time[]] ]; ViewerOps.AddProp[walnut, $IconLabel, iconLabel]; ChangeMenu[walnutMenu, FALSE]; } ELSE { DoStartup[scavengeFirst: TRUE, rootName: rootName, captionName: captionName, iconLabel: iconLabel]; }; }; [] _ DoStartupCall[Sp]; }; <<* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *>> BuildWalnutControlWindow: PROC[caption: ROPE] = { bt: Viewer; walnutWidth: INTEGER; transOK: BOOL _ TRUE; guarded: BOOL; IF walnut # NIL THEN RETURN; guarded _ UserProfile.Boolean[key: "Walnut.GuardedDestroy", default: FALSE]; walnut _ ViewerOps.CreateViewer[ flavor: $Container, info: [name: caption, iconic: FALSE, column: right, scrollable: FALSE, icon: walnutIcon, openHeight: ViewerSpecs.openTopY/4, guardDestroy: guarded]]; walnut.inhibitDestroy _ TRUE; walnutWidth _ IF walnut.column = right THEN ViewerSpecs.openRightWidth ELSE ViewerSpecs.openLeftWidth; ViewerOps.SetMenu[walnut, blankMenu]; mailNotifyLabel _ WalnutViewer.FirstLabel[name: InitialNotifyLabel, parent: walnut]; bt _ walnutRulerBefore _ WalnutViewer.MakeRuler[sib: mailNotifyLabel, h: 2]; walnutRulerAfter _ Rules.Create[ info: [parent: walnut, wy: bt.wy+bt.wh+14+4, ww: walnutWidth, wh: 2]]; Containers.ChildXBound[walnut, walnutRulerAfter]; walnutTS _ WalnutViewer.MakeTypescript[sib: walnutRulerAfter]; OpenTS[]; ViewerOps.SetMenu[walnut, workingMenu]; walnutEventReg _ ViewerEvents.RegisterEventProc[proc: QuitProc, event: destroy, filter: walnut]; }; <<* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *>> QuitProc: ViewerEvents.EventProc = { IF walnutEventReg = NIL THEN RETURN[FALSE]; MBQueue.QueueClientAction[walnutQueue, QuitWalnut, NIL]; RETURN[TRUE]; }; ChangeDatabase: PROC[scavengeFirst: BOOL, rootName, captionName, iconLabel: ROPE] = { Cdb: PROC = { walnut.inhibitDestroy _ TRUE; Quitting[IO.PutFR["\nClosing database for %g", IO.rope[walnutRootFile]], TRUE ]; WalnutOps.Shutdown[]; walnut.name _ captionName; ViewerOps.PaintViewer[walnut, caption]; IF ~RestartWalnut[rootName, scavengeFirst, TRUE] THEN RETURN; Report["\nDatabase is now defined by ", walnutRootFile]; ViewerOps.AddProp[walnut, $IconLabel, iconLabel]; }; [] _ DoWaitCall[Cdb]; }; Quitting: PROC[r: ROPE, isBusy: BOOL] = { ChangeMenu[workingMenu, isBusy]; TakeDownWalnutViewers[]; DestroyAllMsgSetButtons[]; IF personalMailDB THEN DisableNewMail[]; FlushWQueue[]; Report[r]; }; ReadMailFile: PROC[fName, msName: ROPE, useCategoriesInFile: BOOL] = { Erm: PROC = { ENABLE UNWIND => { ChangeMenu[walnutMenu, FALSE] }; fullName: ROPE; numNew: INT _ 0; msb: MsgSetButton _ GetButton[msName]; startVersion: INT _ msgSetsVersion; activeIsOpen: BOOL _ activeMsgSetButton.msViewer # NIL; msgSet: WalnutOps.MsgSet _ IF useCategoriesInFile THEN [NIL, WalnutOps.dontCareMsgSetVersion] ELSE IF msb = NIL THEN [msName, WalnutOps.dontCareMsgSetVersion] ELSE msb.msgSet; BEGIN cp: FS.ComponentPositions; wDir: ROPE _ UserProfile.Token["Walnut.DefaultArchiveDir"]; [fullName, cp, ] _ FS.ExpandName[fName, wDir]; IF cp.ext.length = 0 THEN fullName _ fullName.Concat[".ArchiveLog"]; END; IF fullName = NIL THEN {Report["No input file specified so quitting"]; RETURN}; Report["Reading messages from ", fullName, "... "]; ChangeMenu[workingMenu, TRUE]; numNew _ WalnutOps.ReadArchiveFile[fullName, msgSet]; SELECT numNew FROM < 0 => Report["\nProblems reading ", fullName]; 0 => Report["\nNo messages in ", fullName, " were new"]; >0 => Report[IO.PutFR[ "\n%g new messages from %g were added to database", IO.int[numNew], IO.rope[fullName]]]; ENDCASE; ShowMsgSetButtons[]; -- in case anything changed ViewerOps.PaintViewer[walnut, client]; -- msgSet buttons don't get painted IF activeIsOpen THEN [] _ WalnutDisplayerInternal.QDisplayMsgSet[activeMsgSetButton]; ChangeMenu[walnutMenu, FALSE]; }; [] _ DoWaitCall[Erm]; }; <<* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *>> <> ParseForPrinting: PROC[cmd: Commander.Handle] RETURNS[mOrMs, server: ROPE, copies: INT] = { numRope: ROPE; [] _ CommandTool.Parse[cmd]; mOrMs _ CommandTool.NextArgument[cmd]; server _ CommandTool.NextArgument[cmd]; numRope _ CommandTool.NextArgument[cmd]; IF numRope # NIL THEN copies _ Convert.IntFromRope[numRope ! Convert.Error => {copies _ 1; CONTINUE } ] ELSE copies _ 1; }; Wpms: PROC[msgSet, server: ROPE, usePress: BOOL, copies: INT] = { Pms: PROC = { WalnutPrintOps.PrintMsgSetCmd[msgSet, server, usePress, copies] }; [] _ DoWaitCall[Pms]; }; Wpm: PROC[msg, server: ROPE, usePress: BOOL, copies: INT] = { Pm: PROC = { WalnutPrintOps.PrintMsgCmd[msg, server, usePress, copies] }; [] _ DoWaitCall[Pm]; }; Wpmst: PROC[msgSet, server: ROPE, usePress: BOOL, copies: INT] = { Pms: PROC = { WalnutPrintOps.PrintMsgSetTOCCmd[msgSet, server, usePress, copies] }; [] _ DoWaitCall[Pms]; }; Wps: PROC[msgSet, server: ROPE, usePress: BOOL, copies: INT] = { Psel: PROC = { WalnutPrintOps.PrintSelCmd[msgSet, server, usePress, copies] }; [] _ DoWaitCall[Psel]; }; <<* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *>> walnutQueue _ MBQueue.Create[pushModel: FALSE]; -- queue for menu/button pushes BuildWalnutMenus[]; Commander.Register["Walnut", BuildWalnut, "For retrieving and sending mail"]; Commander.Register["WalnutScavenge", WalnutScavenge, "Rebuilds Mail database from log file"]; Commander.Register["WalnutOldMailReader", WalnutOldMailReader, "Reads Laurel, Hardy or Archive files into Mail database"]; Commander.Register["WalnutExpunge", WalnutExpunge, "Expunges deleted messages"]; Commander.Register["WalnutNewMail", WalnutNewMailProc, "Retrieves new mail"]; Commander.Register[ "WalnutMascarade", WalnutMascarade, "Scavenge someone else's walnut database"]; Commander.Register["WalnutPressPrintMsgSet", WalnutPrintMsgSet, "Prints a msgSet"]; Commander.Register["WalnutInterpress3.0PrintMsgSet", WalnutPrintIPMsgSet, "Prints a msgSet"]; Commander.Register["WalnutPressPrintMsgSetTOC", WalnutPrintMsgSetTOC, "Prints a msgSet TOC"]; Commander.Register[ "WalnutInterpress3.0PrintMsgSetTOC", WalnutPrintIPMsgSetTOC, "Prints a msgSet TOC"]; Commander.Register["WalnutPressPrintSelected", WalnutPrintSel, "Prints the selected msg in a msgSet"]; Commander.Register[ "WalnutInterpress3.0PrintSelected", WalnutPrintIPSel, "Prints the selected msg in a msgSet"]; Commander.Register["WalnutPressPrintMsg", WalnutPrintMsg, "Prints a msg"]; Commander.Register["WalnutInterpress3.0PrintMsg", WalnutPrintIPMsg, "Prints a msg"]; BEGIN iconFilePathName: ROPE = "Walnut.icons"; unLabelledWalnutIcon _ Icons.NewIconFromFile[iconFilePathName, 0 ! FS.Error => GOTO notFound]; unLabelledNewMailIcon_ Icons.NewIconFromFile[iconFilePathName, 5]; labelledWalnutIcon_ Icons.NewIconFromFile[iconFilePathName, 11]; labelledNewMailIcon_ Icons.NewIconFromFile[iconFilePathName, 12]; msgSetIcon_ Icons.NewIconFromFile[iconFilePathName, 1]; msgIcon_ Icons.NewIconFromFile[iconFilePathName, 2]; walnutIcon _ unLabelledWalnutIcon; newMailIcon _ unLabelledNewMailIcon; EXITS notFound => NULL; END; END.