X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/fabd1805a8f429ca83b4271aabd1206ac3537ebb..5211281f4c41ec7259121cfd44b476065a20dd35:/mac/macterm.c diff --git a/mac/macterm.c b/mac/macterm.c index 02232a57..4f4a9dbb 100644 --- a/mac/macterm.c +++ b/mac/macterm.c @@ -1,4 +1,4 @@ -/* $Id: macterm.c,v 1.50 2003/01/15 23:30:21 ben Exp $ */ +/* $Id: macterm.c,v 1.53 2003/01/25 15:15:40 ben Exp $ */ /* * Copyright (c) 1999 Simon Tatham * Copyright (c) 1999, 2002 Ben Harris @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -46,9 +47,7 @@ #include #include #include -#include #include -#include #include #include @@ -62,7 +61,6 @@ #include "putty.h" #include "charset.h" #include "mac.h" -#include "storage.h" #include "terminal.h" #define NCOLOURS (lenof(((Config *)0)->colours)) @@ -109,23 +107,12 @@ static RoutineDescriptor do_text_for_device_upp = #define do_text_for_device_upp do_text_for_device #endif /* not TARGET_RT_MAC_CFM */ -void mac_opensession(void) { - Session *s; - StandardFileReply sfr; - static const OSType sftypes[] = { 'Sess', 0, 0, 0 }; - void *sesshandle; +void mac_startsession(Session *s) +{ + char *errmsg; int i; - s = smalloc(sizeof(*s)); - memset(s, 0, sizeof(*s)); - - StandardGetFile(NULL, 1, sftypes, &sfr); - if (!sfr.sfGood) goto fail; - - sesshandle = open_settings_r_fsp(&sfr.sfFile); - if (sesshandle == NULL) goto fail; - load_open_settings(sesshandle, TRUE, &s->cfg); - close_settings_r(sesshandle); + init_ucs(s); /* * Select protocol. This is farmed out into a table in a @@ -137,22 +124,9 @@ void mac_opensession(void) { s->back = backends[i].backend; break; } - if (s->back == NULL) { + if (s->back == NULL) fatalbox("Unsupported protocol number found"); - } - mac_startsession(s); - return; - fail: - sfree(s); - return; -} - -void mac_startsession(Session *s) -{ - char *errmsg; - - init_ucs(s); /* XXX: Own storage management? */ if (HAVE_COLOR_QD()) s->window = GetNewCWindow(wTerminal, NULL, (WindowPtr)-1); @@ -441,6 +415,10 @@ void mac_adjusttermmenus(WindowPtr window) { long offset; s = (Session *)GetWRefCon(window); + menu = GetMenuHandle(mFile); + DisableItem(menu, iSave); /* XXX enable if modified */ + EnableItem(menu, iSaveAs); + EnableItem(menu, iDuplicate); menu = GetMenuHandle(mEdit); EnableItem(menu, 0); DisableItem(menu, iUndo);