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";
ConWrites("\r\nThis call will cost you %ld.%02ld.\r\n\r\n",CurrentPay / 100,CurrentPay % 100);
CurrentPay = 0;
}
/* We did a file transfer (auto-download?) and
* will need to close the transfer window.
*/
if(TransferWindow)
{
WakeUp(TransferWindow);
DeleteTransferPanel();
ReleaseWindows();
Say("Transfer completed.");
}
if(ResetSerial)
{
FlushSerial();
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 = TRUE;
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;
FlushSerial();
DeleteSerial();
BlockWindows();
if(MyEasyRequest(Window,"%s unit %ld has been reset and released.\nClick below to continue.","Continue|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);