X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/713b8b7a02c4385426cc06071142c50d042dd16b..dbd2a0be87198275be4a3bf46ad64681e2688d86:/mac/mac.c diff --git a/mac/mac.c b/mac/mac.c index 54ed35ca..456f4f35 100644 --- a/mac/mac.c +++ b/mac/mac.c @@ -1,4 +1,4 @@ -/* $Id: mac.c,v 1.9 2002/12/29 19:14:56 ben Exp $ */ +/* $Id: mac.c,v 1.13 2003/01/01 11:45:43 ben Exp $ */ /* * Copyright (c) 1999 Ben Harris * All rights reserved. @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -174,6 +175,17 @@ static void mac_startup(void) { windows.about = NULL; windows.licence = NULL; + { + short vol; + long dirid; + + /* Set the default directory for loading and saving settings. */ + /* XXX Should we create it? */ + if (get_session_dir(FALSE, &vol, &dirid) == noErr) { + LMSetSFSaveDisk(-vol); + LMSetCurDirStore(dirid); + } + } init_ucs(); } @@ -261,13 +273,16 @@ static void mac_contentclick(WindowPtr window, EventRecord *event) { mac_clickterm(window, event); break; case wAbout: - if (DialogSelect(event, &(DialogPtr)window, &item)) + if (DialogSelect(event, &window, &item)) switch (item) { case wiAboutLicence: mac_openlicence(); break; } break; + case wSettings: + mac_clickdlg(window, event); + break; } } @@ -288,6 +303,9 @@ static void mac_activatewindow(WindowPtr window, EventRecord *event) { case wTerminal: mac_activateterm(window, active); break; + case wSettings: + mac_activatedlg(window, event); + break; case wAbout: mac_activateabout(window, event); break; @@ -314,6 +332,7 @@ static void mac_updatewindow(WindowPtr window) { mac_updateterm(window); break; case wAbout: + case wSettings: BeginUpdate(window); UpdateDialog(window, window->visRgn); EndUpdate(window); @@ -351,6 +370,7 @@ static void mac_updatelicence(WindowPtr window) */ static int mac_windowtype(WindowPtr window) { int kind; + long refcon; if (window == NULL) return wNone; @@ -359,7 +379,11 @@ static int mac_windowtype(WindowPtr window) { return wDA; if (GetWVariant(window) == zoomDocProc) return wTerminal; - return GetWRefCon(window); + refcon = GetWRefCon(window); + if (refcon < 1024) + return refcon; + else + return wSettings; } /* @@ -413,6 +437,9 @@ static void mac_menucommand(long result) { case iNew: mac_newsession(); goto done; + case iOpen: + mac_opensession(); + goto done; case iClose: mac_closewindow(window); goto done;