]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Warn on close. Also warn before use.
authorOwen Dunn <owen@greenend.org.uk>
Sun, 27 Feb 2005 13:53:08 +0000 (13:53 +0000)
committerOwen Dunn <owen@greenend.org.uk>
Sun, 27 Feb 2005 13:53:08 +0000 (13:53 +0000)
[originally from svn r5407]

mac/README.mac
mac/macterm.c

index 9494c9f25d406ee3b8e793d4ccfc3a5fef53dc7a..abe3a19365a45ab3a381fdcbf3d0ad4d0810fbea 100644 (file)
@@ -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.
index 78efa65fe2fa63ab297b8488e234550494e1427c..22360e146d97bce0a1616af3985df84d911aa54e 100644 (file)
@@ -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;