ArgsPtr -> RDA_ExtHelp = "\nUsage: \33[1mterm\33[0m [KeepIO] [DontPop]\n\n KeepIO ....: Keep links to the current Shell window.\n DontPop ...: Don't pop an already running `term' to the front.\n\n";
MyEasyRequest(Window,"Failed to add application icon\n(is Workbench running?).","Continue");
DeleteMsgPort(IconPort);
}
else
MyEasyRequest(Window,"Failed to create MsgPort.","Continue");
FreeDiskObject(Icon);
}
else
MyEasyRequest(Window,"Failed to open tool icon.","Continue");
CloseLibrary(IconBase);
}
else
MyEasyRequest(Window,"Failed to open icon.library.","Continue");
CloseLibrary(WorkbenchBase);
}
else
MyEasyRequest(Window,"Failed to open workbench.library.","Continue");
if(!Released)
ReleaseWindows();
/* Finished! */
DoIconify = FALSE;
}
/* Set up a new emulator? */
if(NewEmulatorPlease)
{
BlockWindows();
if(!CreateEmulator(Config . EmulationName,TRUE))
{
Config . Emulation = EMULATION_ANSIVT100;
if(Config . Font == FONT_IBM && IBM)
CurrentFont = IBM;
else
CurrentFont = Topaz;
SetFont(RPort,CurrentFont);
}
else
{
Config . RasterEnabled = FALSE;
EraseScreen("2");
}
NewEmulatorPlease = FALSE;
ReleaseWindows();
}
/* Encountered any trouble during emulation
* setup procedure?
*/
if(EmulationSetupError)
{
BlockWindows();
MyEasyRequest(Window,"Could not set up terminal emulation `%s':\n%s.\n\nResetting to built-in terminal emulation.","Continue",FilePart(Config . EmulationName),EmulationErrorStrings[EmulationSetupError - 1]);
EmulationSetupError = 0;
ReleaseWindows();
}
/* Reset the serial driver? */
if(ResetSerial)
{
ClearSerial();
DeleteSerial();
BlockWindows();
OpenLoop: if(!CreateSerial())
{
APTR OldPtr = ThisProcess -> pr_WindowPtr;
DeleteSerial();
ThisProcess -> pr_WindowPtr = (APTR)Window;
switch(MyEasyRequest(Window,"`term' has a problem:\nFailed to open %s!","Retry|Ignore|Quit `term'",Config . SerialDevice))
{
case 1: goto OpenLoop;
case 2: break;
case 0: Terminated = TRUE;
}
ThisProcess -> pr_WindowPtr = OldPtr;
}
else
ResetSerial = FALSE;
ReleaseWindows();
}
/* We are to release the serial.device (or
* whatever we are using) for some reason.
*/
if(ReleaseSerial)
{
APTR OldPtr = ThisProcess -> pr_WindowPtr;
ThisProcess -> pr_WindowPtr = (APTR)Window;
/* This might happen if an ARexx user
* released the serial device and
* failed to reopen it.
*/
if(!ReadPort)
goto OpenIt;
ClearSerial();
DeleteSerial();
BlockWindows();
if(MyEasyRequest(Window,"`%s' unit Nº %ld has been reset and released.","Return To `term'|Quit `term'",Config . SerialDevice,Config . UnitNumber))
{
OpenIt: if(!CreateSerial())
{
DeleteSerial();
switch(MyEasyRequest(Window,"`term' has a problem:\nFailed to open %s!","Retry|Ignore|Quit `term'",Config . SerialDevice))
{
case 1: goto OpenIt;
case 2: break;
case 0: Terminated = TRUE;
}
}
}
else
Terminated = TRUE;
ReleaseSerial = FALSE;
ThisProcess -> pr_WindowPtr = OldPtr;
ReleaseWindows();
}
/* Somebody told us to re-open the display
* (changed the terminal emulation/colour
* mode).
*/
if(ResetDisplay)
{
UBYTE *Result;
/* Delete the display (if possible).
* This will go wrong if there
* are any visitor windows on our
* screen.
*/
if(DeleteDisplay())
{
if(Result = CreateDisplay(FALSE))
{
ThisProcess -> pr_WindowPtr = (APTR)Window;
MyEasyRequest(NULL,"`term' has a problem:\n%s!","Continue",Result);