From 88b3172a9144857696ed9425a0e66e5a11bdd927 Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 27 Feb 2005 13:53:08 +0000 Subject: [PATCH] Warn on close. Also warn before use. git-svn-id: svn://svn.tartarus.org/sgt/putty@5407 cda61777-01e9-0310-a592-d414129be87e --- mac/README.mac | 5 ++++- mac/macterm.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/mac/README.mac b/mac/README.mac index 9494c9f2..abe3a193 100644 --- a/mac/README.mac +++ b/mac/README.mac @@ -3,6 +3,10 @@ $Id$ Information about PuTTY for the Mac OS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +This is a port of PuTTY to the Classic Mac OS. It is a work in +progress and should be considered unfinished and insecure. Unless you +know what you're doing, don't use it. + Compiling it: See ../README for generic information. @@ -83,7 +87,6 @@ Unimplemented features (should be done before release): * Private key files. * Pageant and PuTTYgen. * Do something with Open Application Apple Events. - * Warn-on-close. * Close-on-exit. * Warn-on-quit. * Non-block cursors. diff --git a/mac/macterm.c b/mac/macterm.c index 78efa65f..22360e14 100644 --- a/mac/macterm.c +++ b/mac/macterm.c @@ -1012,9 +1012,19 @@ static pascal void mac_growtermdraghook(void) void mac_closeterm(WindowPtr window) { + int alertret; Session *s = mac_windowsession(window); - /* XXX warn on close */ + if (s->cfg.warn_on_close) { + ParamText("\pAre you sure you want to close this session?", + NULL, NULL, NULL); + alertret=CautionAlert(wQuestion, NULL); + if (alertret == 2) { + /* Cancel */ + return; + } + } + HideWindow(s->window); *s->prev = s->next; s->next->prev = s->prev; -- 2.11.0