diff --git a/macssh/source/Url/url.c b/macssh/source/Url/url.c index cc6f659..0459ee5 100755 --- a/macssh/source/Url/url.c +++ b/macssh/source/Url/url.c @@ -716,10 +716,6 @@ Boolean FindURLAroundPoint(Point curr, short w) start = p; end = q; -/* NONO: wrong, HiliteThis does the deselect if needed */ - /*UnHiliteSelection(w);*/ -/* NONO */ - HUnlock(block); // RJZ 12/11/97 diff --git a/macssh/source/config/configure.c b/macssh/source/config/configure.c index 08ab397..a9c657e 100755 --- a/macssh/source/config/configure.c +++ b/macssh/source/config/configure.c @@ -73,6 +73,10 @@ extern Handle oldMacros; extern NewMacroInfo oldMacroIndexes; extern short dialogPane; +extern Boolean encryptOK; // true if des encryption routines available +extern Boolean authOK; // true if authentication driver available + + void CONFIGUREunload(void) {} void SetControlText(DialogPtr dptr, short item, Str255 text); @@ -833,6 +837,8 @@ void EditConfigType(ResType ConfigResourceType, Boolean (*EditFunction)(StringPt Hilite(dptr, kDuplicate, 255); } + ShowWindow(dptr); + currentHead = theHead; //let dialog filter know about the list while (ditem > 1) { movableModalDialog(MyDlogWListFilterUPP, &ditem); @@ -1859,6 +1865,7 @@ Boolean EditSession(StringPtr PrefRecordNamePtr) GetIndString(PrefRecordNamePtr, MISC_STRINGS, MISC_NEWSESSION); getAUniqueName(currentHead,PrefRecordNamePtr); } + HLock((Handle) SessPrefsHdl); SessPrefsPtr = *SessPrefsHdl; SetCntrl(dptr, SessTEKinhib, (SessPrefsPtr->tektype == -1)); @@ -1909,6 +1916,19 @@ Boolean EditSession(StringPtr PrefRecordNamePtr) CheckPortPopup( dptr, (unsigned short)SessPrefsPtr->port, 90 ); /* NONO */ + if (!authOK) { + Hilite( dptr, SessAuthenticate, 255); + Hilite( dptr, SessEncrypt, 255); + } else if (!encryptOK) { + Hilite( dptr, SessEncrypt, 255); + } + if (GetCntlVal(dptr, SessAuthenticate)) { + Hilite(dptr, SessEncrypt, (encryptOK)? 0 : 255); + } else { + Hilite(dptr, SessEncrypt, 255); + SetCntrl(dptr, SessEncrypt, false); + } + configPassword[0] = 0; if (SessPrefsPtr->otppassword[0]) { pstrcpy(configPassword, (unsigned char *)SessPrefsPtr->otppassword); @@ -2039,12 +2059,22 @@ Boolean EditSession(StringPtr PrefRecordNamePtr) { okaySessName: switch (ditem) { + + case SessAuthenticate: + FlipCheckBox(dptr, ditem); + if (GetCntlVal(dptr, SessAuthenticate)) { + Hilite(dptr, SessEncrypt, (encryptOK)? 0 : 255); + } else { + Hilite(dptr, SessEncrypt, 255); + SetCntrl(dptr, SessEncrypt, false); + } + break; + case SessForceSave: case SessBezerkeley: case SessLinemode: case SessTEKclear: case SessHalfDuplex: - case SessAuthenticate: case SessEncrypt: case SessLocalEcho: case 42: diff --git a/macssh/source/debug-errors/DlogUtils.c b/macssh/source/debug-errors/DlogUtils.c index 15616d5..85ac82b 100755 --- a/macssh/source/debug-errors/DlogUtils.c +++ b/macssh/source/debug-errors/DlogUtils.c @@ -813,5 +813,5 @@ void pstrinsert(StringPtr dst, StringPtr src) void pstrcpy(StringPtr dst, StringPtr src) { - BlockMove(src, dst, *src + 1); + BlockMoveData(src, dst, *src + 1); } diff --git a/macssh/source/init/init.c b/macssh/source/init/init.c index 22dfd18..ed39c2a 100755 --- a/macssh/source/init/init.c +++ b/macssh/source/init/init.c @@ -17,6 +17,7 @@ #include "init.proto.h" #include "mainseg.proto.h" /* For forcequit() proto */ +#include "event.proto.h" #include "iNetwork.proto.h" /* For initnet proto */ #include "macros.proto.h" /* For initmacro proto */ #include "wind.h" /* For WindRec definition */ @@ -75,8 +76,8 @@ Boolean gKeyboardHasControlKey, gAEavail; short **topLeftCorners; //CCP 2.7: Better window positioning scheme -Boolean encryptOK; // true if des encryption routines available Boolean authOK; // true if authentication driver available +Boolean encryptOK; // true if des encryption routines available /* checkCONF - check if the user clicked on a configuration file */ void checkCONF( void) @@ -188,7 +189,7 @@ void initmcurs ( short debug) loadcursor(rDbugCURS, &theCursors[normcurs]); else theCursors[normcurs] = &qd.arrow; - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); } /* If a file with the filetype "DBUG" was sent to us, set the debug mode. */ @@ -445,7 +446,7 @@ void init (void) TelInfo->debug=checkdebug(); /* must return TRUE or FALSE */ initmcurs(0); /* init the mouse cursor */ - SetCursor(theCursors[watchcurs]); + setLastCursor(theCursors[watchcurs]); setupmenu(gApplicationPrefs->CommandKeys, dtemp); trInit(myMenus[National]); /* LU: Initialize translation routines; must be done */ @@ -474,7 +475,7 @@ void init (void) TelInfo->done = FALSE; // We're not quitting yet. - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); initmacros(); CheckGlobalMacros(); diff --git a/macssh/source/main/Connections.c b/macssh/source/main/Connections.c index a64b291..8f55c4e 100755 --- a/macssh/source/main/Connections.c +++ b/macssh/source/main/Connections.c @@ -187,6 +187,44 @@ static short FindMenuItemText(MenuHandle hMenu, StringPtr itemString) } +static Str255 sLastHostName; + +static void SetCurrentSession(DialogPtr dptr, Str255 scratchPstring) +{ + SessionPrefs **tempSessHdl; + Str31 scritchPstring; + + tempSessHdl = (SessionPrefs **)Get1NamedSizedResource(SESSIONPREFS_RESTYPE, scratchPstring, sizeof(SessionPrefs)); + if (tempSessHdl) { + SetTEText(dptr, NCfavoritename, scratchPstring);//update the favoritename +// TerminalIndex = findPopupMenuItem(TermPopupHdl, +// (**tempSessHdl).TerminalEmulation); +// TPopup[0].choice = TerminalIndex; +// DrawPopUp(dptr, NCtermpopup); //update popup + strcpy((char *)scratchPstring, (char *)(**tempSessHdl).hostname); + + if ((**tempSessHdl).port != getDefaultPort((**tempSessHdl).protocol)) { + NumToString((unsigned short)(**tempSessHdl).port, scritchPstring); + pstrcat(scratchPstring, "\p:"); + if ((**tempSessHdl).portNegative) + pstrcat(scratchPstring, "\p-"); + pstrcat(scratchPstring, scritchPstring); + } + /* recall last hostname seen if none */ + if ( !scratchPstring[0] && sLastHostName[0] ) { + SetTEText(dptr, NChostname, sLastHostName); + } else { + SetTEText(dptr, NChostname, scratchPstring);//update the hostname + } + SelectDialogItemText(dptr, NChostname, 0, 32767); + SetCntrl(dptr, NCauthenticate, (**tempSessHdl).authenticate);//update the auth status + SetCntrl(dptr, NCencrypt, (**tempSessHdl).encrypt); + SetCntrl(dptr, NCssh2, (**tempSessHdl).protocol == 4); + setSessStates(dptr);//encrypt cant be on w/o authenticate + ReleaseResource((Handle)tempSessHdl); + } +} + Boolean PresentOpenConnectionDialog(void) { ConnInitParams **InitParams; @@ -196,7 +234,7 @@ Boolean PresentOpenConnectionDialog(void) long scratchlong; Str255 scratchPstring, terminalPopupString, scritchPstring; Handle ItemHandle; - SessionPrefs **defaultSessHdl,**tempSessHdl; + SessionPrefs **tempSessHdl; short numberOfTerms, sessMark, requestPort; MenuHandle SessPopupHdl; // MenuHandle TermPopupHdl; @@ -212,15 +250,12 @@ Boolean PresentOpenConnectionDialog(void) Boolean typedHost; Boolean parseAliases; - - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); - //LockDialog(); SetUpMovableModalMenus(); dptr = GetNewMyDialog(NewCnxnDLOG, NULL, kInFront, (void *)ThirdCenterDialog); if (dptr == NULL) { - //UnlockDialog(); ResetMenus(); OutOfMemory(1000); return; @@ -236,7 +271,6 @@ Boolean PresentOpenConnectionDialog(void) SessPopupHdl = NewMenu(668, scratchPstring); if (SessPopupHdl == NULL) { DisposeDialog(dptr); - //UnlockDialog(); ResetMenus(); OutOfMemory(1000); return; @@ -258,7 +292,6 @@ Boolean PresentOpenConnectionDialog(void) // if (TermPopupHdl == NULL) { // DisposeHandle((Handle)SessPopupHdl); // DisposeDialog(dptr); -// //UnlockDialog(); // ResetMenus(); // OutOfMemory(1000); // return; @@ -273,45 +306,26 @@ Boolean PresentOpenConnectionDialog(void) // TPopup[0].h = TermPopupHdl; // PopupInit(dptr, TPopup); - // Get default auth/encrypt settings from default session - defaultSessHdl = GetDefaultSession(); - HLock((Handle)defaultSessHdl); - - - BlockMoveData("\p", scratchPstring, 15); - SetTEText(dptr, NCfavoritename, scratchPstring); - - GetHostNameFromSession(scratchPstring); - if ((**defaultSessHdl).port != getDefaultPort((**defaultSessHdl).protocol)) { - NumToString((unsigned short)(**defaultSessHdl).port, scritchPstring); - pstrcat(scratchPstring, "\p:"); - if ((**defaultSessHdl).portNegative) - pstrcat(scratchPstring, "\p-"); - pstrcat(scratchPstring, scritchPstring); - } - SetTEText(dptr, NChostname, scratchPstring); - SelectDialogItemText(dptr, NChostname, 0, 32767); - - SetCntrl(dptr, NCauthenticate, (**defaultSessHdl).authenticate && authOK); - SetCntrl(dptr, NCencrypt, (**defaultSessHdl).encrypt && encryptOK); - - SetCntrl(dptr, NCssh2, (**defaultSessHdl).protocol == 4); - - if (!authOK) - { + if (!authOK) { Hilite( dptr, NCauthenticate, 255); Hilite( dptr, NCencrypt, 255); + } else if (!encryptOK) { + Hilite( dptr, NCencrypt, 255); } - + + BlockMoveData("\p", scratchPstring, 15); + SetCurrentSession(dptr, scratchPstring); + // TerminalIndex = findPopupMenuItem(TermPopupHdl,(**defaultSessHdl).TerminalEmulation); // TPopup[0].choice = TerminalIndex; // PopupInit(dptr, TPopup); - DisposeHandle((Handle)defaultSessHdl); - setSessStates(dptr); + SelectDialogItemText(dptr, NChostname, 0, 32767); typedHost = false; + ShowWindow(dptr); + while (ditem > NCcancel) { movableModalDialog(POCdlogfilterUPP, &ditem); switch(ditem) @@ -337,41 +351,12 @@ Boolean PresentOpenConnectionDialog(void) typedHost = true; GetTEText(dptr, NChostname, scratchPstring); scratchshort = FindMenuItemText(SessPopupHdl, scratchPstring); - /* revert to default if not found */ - /*if ( !scratchshort ) { - scratchshort = 1; - }*/ if ( scratchshort && sessMark != scratchshort ) { SetItemMark(SessPopupHdl, sessMark, 0); sessMark = scratchshort; SetItemMark(SessPopupHdl, sessMark, 18); GetMenuItemText(SessPopupHdl, scratchshort, scratchPstring); - tempSessHdl = (SessionPrefs **)Get1NamedSizedResource(SESSIONPREFS_RESTYPE, scratchPstring, sizeof(SessionPrefs)); - if (tempSessHdl) - { - SetTEText(dptr, NCfavoritename, scratchPstring);//update the favoritename - // TerminalIndex = findPopupMenuItem(TermPopupHdl, - // (**tempSessHdl).TerminalEmulation); - // TPopup[0].choice = TerminalIndex; - // DrawPopUp(dptr, NCtermpopup); //update popup - strcpy((char *)scratchPstring, (char *)(**tempSessHdl).hostname); - - if ((**tempSessHdl).port != getDefaultPort((**tempSessHdl).protocol)) { - NumToString((unsigned short)(**tempSessHdl).port, scritchPstring); - pstrcat(scratchPstring, "\p:"); - if ((**tempSessHdl).portNegative) - pstrcat(scratchPstring, "\p-"); - pstrcat(scratchPstring, scritchPstring); - } - - // SetTEText(dptr, NChostname, scratchPstring);//update the hostname - // SelectDialogItemText(dptr, NChostname, 0, 32767); - SetCntrl(dptr, NCauthenticate, (**tempSessHdl).authenticate && authOK);//update the auth status - SetCntrl(dptr, NCencrypt, (**tempSessHdl).encrypt && encryptOK); - SetCntrl(dptr, NCssh2, (**tempSessHdl).protocol == 4); - setSessStates(dptr);//encrypt cant be on w/o authenticate - ReleaseResource((Handle)tempSessHdl); - } + SetCurrentSession(dptr, scratchPstring); } } break; @@ -388,40 +373,14 @@ Boolean PresentOpenConnectionDialog(void) scratchlong = PopUpMenuSelect(SessPopupHdl, SessPopupLoc.v, SessPopupLoc.h, 0); DeleteMenu(668); - if (scratchlong) - { + if (scratchlong) { typedHost = false; scratchshort = scratchlong & 0xFFFF; // Apple sez ignore the high word SetItemMark(SessPopupHdl, sessMark, 0); sessMark = scratchshort; SetItemMark(SessPopupHdl, sessMark, 18); GetMenuItemText(SessPopupHdl, scratchshort, scratchPstring); - tempSessHdl = (SessionPrefs **)Get1NamedSizedResource(SESSIONPREFS_RESTYPE, scratchPstring, sizeof(SessionPrefs)); - if (tempSessHdl) - { - SetTEText(dptr, NCfavoritename, scratchPstring);//update the favoritename -// TerminalIndex = findPopupMenuItem(TermPopupHdl, -// (**tempSessHdl).TerminalEmulation); -// TPopup[0].choice = TerminalIndex; -// DrawPopUp(dptr, NCtermpopup); //update popup - strcpy((char *)scratchPstring, (char *)(**tempSessHdl).hostname); - - if ((**tempSessHdl).port != getDefaultPort((**tempSessHdl).protocol)) { - NumToString((unsigned short)(**tempSessHdl).port, scritchPstring); - pstrcat(scratchPstring, "\p:"); - if ((**tempSessHdl).portNegative) - pstrcat(scratchPstring, "\p-"); - pstrcat(scratchPstring, scritchPstring); - } - - SetTEText(dptr, NChostname, scratchPstring);//update the hostname - SelectDialogItemText(dptr, NChostname, 0, 32767); - SetCntrl(dptr, NCauthenticate, (**tempSessHdl).authenticate && authOK);//update the auth status - SetCntrl(dptr, NCencrypt, (**tempSessHdl).encrypt && encryptOK); - SetCntrl(dptr, NCssh2, (**tempSessHdl).protocol == 4); - setSessStates(dptr);//encrypt cant be on w/o authenticate - ReleaseResource((Handle)tempSessHdl); - } + SetCurrentSession(dptr, scratchPstring); } break; case 1001: @@ -432,27 +391,7 @@ Boolean PresentOpenConnectionDialog(void) sessMark = CountMItems(SessPopupHdl); SetItemMark(SessPopupHdl, sessMark, 18); GetMenuItemText(SessPopupHdl, sessMark, scratchPstring); - tempSessHdl = (SessionPrefs **)Get1NamedSizedResource(SESSIONPREFS_RESTYPE, scratchPstring, sizeof(SessionPrefs)); - if (tempSessHdl) { - SetTEText(dptr, NCfavoritename, scratchPstring);//update the favoritename - strcpy((char *)scratchPstring, (char *)(**tempSessHdl).hostname); - - if ((**tempSessHdl).port != getDefaultPort((**tempSessHdl).protocol)) { - NumToString((unsigned short)(**tempSessHdl).port, scritchPstring); - pstrcat(scratchPstring, "\p:"); - if ((**tempSessHdl).portNegative) - pstrcat(scratchPstring, "\p-"); - pstrcat(scratchPstring, scritchPstring); - } - - SetTEText(dptr, NChostname, scratchPstring);//update the hostname - SelectDialogItemText(dptr, NChostname, 0, 32767); - SetCntrl(dptr, NCauthenticate, (**tempSessHdl).authenticate && authOK);//update the auth status - SetCntrl(dptr, NCencrypt, (**tempSessHdl).encrypt && encryptOK); - SetCntrl(dptr, NCssh2, (**tempSessHdl).protocol == 4); - setSessStates(dptr);//encrypt cant be on w/o authenticate - ReleaseResource((Handle)tempSessHdl); - } + SetCurrentSession(dptr, scratchPstring); break; case 1000: typedHost = false; @@ -462,27 +401,7 @@ Boolean PresentOpenConnectionDialog(void) sessMark = 1; SetItemMark(SessPopupHdl, sessMark, 18); GetMenuItemText(SessPopupHdl, sessMark, scratchPstring); - tempSessHdl = (SessionPrefs **)Get1NamedSizedResource(SESSIONPREFS_RESTYPE, scratchPstring, sizeof(SessionPrefs)); - if (tempSessHdl) { - SetTEText(dptr, NCfavoritename, scratchPstring);//update the favoritename - strcpy((char *)scratchPstring, (char *)(**tempSessHdl).hostname); - - if ((**tempSessHdl).port != getDefaultPort((**tempSessHdl).protocol)) { - NumToString((unsigned short)(**tempSessHdl).port, scritchPstring); - pstrcat(scratchPstring, "\p:"); - if ((**tempSessHdl).portNegative) - pstrcat(scratchPstring, "\p-"); - pstrcat(scratchPstring, scritchPstring); - } - - SetTEText(dptr, NChostname, scratchPstring);//update the hostname - SelectDialogItemText(dptr, NChostname, 0, 32767); - SetCntrl(dptr, NCauthenticate, (**tempSessHdl).authenticate && authOK);//update the auth status - SetCntrl(dptr, NCencrypt, (**tempSessHdl).encrypt && encryptOK); - SetCntrl(dptr, NCssh2, (**tempSessHdl).protocol == 4); - setSessStates(dptr);//encrypt cant be on w/o authenticate - ReleaseResource((Handle)tempSessHdl); - } + SetCurrentSession(dptr, scratchPstring); break; default: break; @@ -495,7 +414,6 @@ Boolean PresentOpenConnectionDialog(void) DisposeMenu(SessPopupHdl); // drh Ñ Bug fix: memory leak DisposeDialog(dptr); ResetMenus(); - //UnlockDialog(); return; } @@ -505,10 +423,11 @@ Boolean PresentOpenConnectionDialog(void) DisposeMenu(SessPopupHdl); // drh Ñ Bug fix: memory leak DisposeDialog(dptr); ResetMenus(); - //UnlockDialog(); return; } + pstrcpy(sLastHostName, scratchPstring); + // GetMenuItemText(TPopup[0].h, TPopup[0].choice, terminalPopupString); // PopupCleanup(); portSet = false; @@ -533,7 +452,6 @@ Boolean PresentOpenConnectionDialog(void) DisposeMenu(SessPopupHdl); // drh Ñ Bug fix: memory leak DisposeDialog(dptr); ResetMenus(); - //UnlockDialog(); OutOfMemory(1000); return; } @@ -547,7 +465,6 @@ Boolean PresentOpenConnectionDialog(void) // OutOfMemory(1000); // DisposeDialog(dptr); // ResetMenus(); -// //UnlockDialog(); // return; // } // } @@ -557,32 +474,24 @@ Boolean PresentOpenConnectionDialog(void) HLock((Handle)InitParams); HLock((Handle)(**InitParams).session); - if (GetCntlVal(dptr, NCauthenticate)) - (**(**InitParams).session).authenticate = 1; - else - (**(**InitParams).session).authenticate = 0; - if (GetCntlVal(dptr, NCencrypt)) - (**(**InitParams).session).encrypt = 1; - else - (**(**InitParams).session).encrypt = 0; + (**(**InitParams).session).authenticate = GetCntlVal(dptr, NCauthenticate); + (**(**InitParams).session).encrypt = GetCntlVal(dptr, NCencrypt); - //if ( !wasAlias ) { - if ( GetCntlVal(dptr, NCssh2) ) { - if ((**(**InitParams).session).protocol != 4) { - (**(**InitParams).session).protocol = 4; - if ( !portSet ) { - (**(**InitParams).session).port = getDefaultPort(4); - } - } - } else { - if ((**(**InitParams).session).protocol == 4) { - (**(**InitParams).session).protocol = 0; - if ( !portSet ) { - (**(**InitParams).session).port = getDefaultPort(0); - } - } - } - //} + if ( GetCntlVal(dptr, NCssh2) ) { + if ((**(**InitParams).session).protocol != 4) { + (**(**InitParams).session).protocol = 4; + if ( !portSet ) { + (**(**InitParams).session).port = getDefaultPort(4); + } + } + } else { + if ((**(**InitParams).session).protocol == 4) { + (**(**InitParams).session).protocol = 0; + if ( !portSet ) { + (**(**InitParams).session).port = getDefaultPort(0); + } + } + } GetTEText(dptr, NCwindowname, scratchPstring); @@ -598,7 +507,6 @@ Boolean PresentOpenConnectionDialog(void) DisposeMenu(SessPopupHdl); // drh Ñ Bug fix: memory leak DisposeDialog(dptr); ResetMenus(); - //UnlockDialog(); success = CreateConnectionFromParams(InitParams); return success; @@ -691,7 +599,8 @@ Boolean CreateConnectionFromParams( ConnInitParams **Params) Boolean scratchBoolean; WindRec *theScreen; unsigned char *hostname; - SetCursor(theCursors[watchcurs]); /* We may be here a bit */ + + setLastCursor(theCursors[watchcurs]); /* We may be here a bit */ // Check if we have the max number of sessions open if (TelInfo->numwindows == MaxSess) return(FALSE); @@ -783,8 +692,8 @@ Boolean CreateConnectionFromParams( ConnInitParams **Params) theScreen->sessmacros = (**Params).sessmacros; - theScreen->authenticate = SessPtr->authenticate && authOK; - theScreen->encrypt = SessPtr->encrypt && encryptOK; + theScreen->authenticate = SessPtr->authenticate; + theScreen->encrypt = SessPtr->encrypt; theScreen->aedata = NULL; @@ -868,7 +777,9 @@ Boolean CreateConnectionFromParams( ConnInitParams **Params) memcpy(theScreen->sshdata.login, theScreen->username, theScreen->username[0] + 1); memcpy(theScreen->sshdata.password, theScreen->password, theScreen->password[0] + 1); memcpy(theScreen->sshdata.command, theScreen->command, theScreen->command[0] + 1); - SetCursor(theCursors[normcurs]); + + setLastCursor(theCursors[normcurs]); + if ( !theScreen->sshdata.login[0] /*|| !theScreen->sshdata.password[0]*/ ) { if ( !SSH2LoginDialog(theScreen->sshdata.host, theScreen->sshdata.login, theScreen->sshdata.password) ) { @@ -1333,7 +1244,7 @@ void destroyport(short wind) tw = &screens[wind]; - SetCursor(theCursors[watchcurs]); /* We may be here a while */ + setLastCursor(theCursors[watchcurs]); /* We may be here a while */ if (tw->active == CNXN_ISCORPSE) { if (tw->curgraph>-1) @@ -1387,7 +1298,7 @@ void removeport(WindRecPtr tw) { Str255 scratchPstring; - SetCursor(theCursors[watchcurs]); /* We may be here a while */ + setLastCursor(theCursors[watchcurs]); /* We may be here a while */ disposemacros(&tw->sessmacros); diff --git a/macssh/source/main/event.proto.h b/macssh/source/main/event.proto.h index 085708d..034f007 100755 --- a/macssh/source/main/event.proto.h +++ b/macssh/source/main/event.proto.h @@ -6,6 +6,7 @@ extern "C" { #endif void HandleMouseDown(EventRecord myEvent); +void setLastCursor(Cursor *crsr); short updateCursor(short force); void NoWindow(void); Boolean CheckPageKeys(short code); diff --git a/macssh/source/main/maclook.c b/macssh/source/main/maclook.c index ccfbfca..4f09c2f 100755 --- a/macssh/source/main/maclook.c +++ b/macssh/source/main/maclook.c @@ -253,7 +253,7 @@ void setupkeys( void) SetUpMovableModalMenus(); dtemp=GetNewMyDialog( SetupDLOG, NULL, kInFront, (void *)ThirdCenterDialog); - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); GetDialogItem( dtemp, killbox, &kItem, &kbox, &dBox); GetDialogItem( dtemp, stopbox, &eItem, &ebox, &dBox); diff --git a/macssh/source/network/network.c b/macssh/source/network/network.c index 486ce45..d6a795d 100755 --- a/macssh/source/network/network.c +++ b/macssh/source/network/network.c @@ -32,6 +32,7 @@ #include "authencrypt.h" #include "authencrypt.proto.h" #include "AddressXLation.h" +#include "event.proto.h" #include "Connections.proto.h" #include "sshglue.proto.h" @@ -1276,7 +1277,7 @@ void Mnetinit( void) if ((err = OpenDriver("\p.IPP",&TCPd)) != noError) /* cant open the IP driver */ { - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); FatalAlert(CANT_OPEN_MACTCP, 300, err); // Doesn't return! } } diff --git a/macssh/source/printing/printing.c b/macssh/source/printing/printing.c index 4ef1aed..d59f14a 100755 --- a/macssh/source/printing/printing.c +++ b/macssh/source/printing/printing.c @@ -94,7 +94,7 @@ void printGraph(short dnum) /* Which drawing to print */ PrRecHandle = PrintSetupRecord(); - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); if (PrJobDialog(PrRecHandle)) { /* Cancel the print if FALSE */ prPort=PrOpenDoc(PrRecHandle,0L,0L); /* Open Printer Port */ @@ -332,7 +332,7 @@ void printText PrRecHandle = PrintSetupRecord(); - SetCursor(theCursors[normcurs]); + setLastCursor(theCursors[normcurs]); if (PrJobDialog(PrRecHandle)) { /* Cancel the print if FALSE */ prPort=PrOpenDoc(PrRecHandle,0L,0L); diff --git a/macssh/source/ssh/ssh2.c b/macssh/source/ssh/ssh2.c index 952be4a..41acfc5 100755 --- a/macssh/source/ssh/ssh2.c +++ b/macssh/source/ssh/ssh2.c @@ -1756,6 +1756,7 @@ void *ssh2_randomize_thread(struct RandStruct *rnd) char *tabargv[64]; char *buf; int i, j; + Boolean saveUseKeyChain; context = (lshcontext *)NewPtr(sizeof(lshcontext)); if (context == NULL) { @@ -1853,6 +1854,8 @@ void *ssh2_randomize_thread(struct RandStruct *rnd) make_args( argstr, tabargv, &argc, &argv ); + saveUseKeyChain = gApplicationPrefs->useKeyChain; + context->_pexitbuf = &exitbuf; if (!setjmp(exitbuf)) { /* we need to intercept SIGINT to fake 'exit' */ @@ -1867,6 +1870,8 @@ void *ssh2_randomize_thread(struct RandStruct *rnd) wkappl_main(argc, argv); } + gApplicationPrefs->useKeyChain = saveUseKeyChain; + if ( context->_gConsoleOutBufLen ) { /* surely an error message... */ i = -1; @@ -2008,7 +2013,7 @@ void ssh_randomize(void) cursorHandle = (**cursorList).nCursors[frameNum]; if ( cursorHandle != NULL ) { HLock((Handle)cursorHandle); - SetCursor(*cursorHandle); + setLastCursor(*cursorHandle); HUnlock((Handle)cursorHandle); } (**cursorList).frame = (frameNum + 1) % count; diff --git a/macssh/source/telnet.rsrc b/macssh/source/telnet.rsrc index 68ba743..c926b99 100755 Binary files a/macssh/source/telnet.rsrc and b/macssh/source/telnet.rsrc differ diff --git a/macssh/source/wdef/wdefpatch.c b/macssh/source/wdef/wdefpatch.c index 1eca61a..3aef12f 100755 --- a/macssh/source/wdef/wdefpatch.c +++ b/macssh/source/wdef/wdefpatch.c @@ -20,6 +20,7 @@ #include "wind.h" #include "wdefpatch.proto.h" +#include "rsmac.proto.h" #include "tnae.h" void drawicon(short id, Rect *dest); @@ -384,6 +385,10 @@ void setupForGrow(WindowPtr window, short hCharInset, short vCharInset, short hC gGrowSaved.txSize = window->txSize; PenNormal(); + + /* back to default window colors */ + RSsetattr( 0, 0 ); + TextFont(1); TextSize(9); TextFace(0);