1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Add asynchronous callback capability to the askappend() alert box.

This was harder than verify_ssh_host_key() and askalg() put
together, because:
 (a) askappend() can be called at any time, since it's a side effect
     of data-logging functions. Therefore there can be an unfinished
     askappend() alert at any time, and hence the OS X front end has
     to be prepared to _queue_ other alerts which occur during that
     time.
 (b) logging.c has to do something with data that comes in while
     it's waiting for an answer to askappend(). It buffers it until
     it knows what the user wants done with it. This involved
     something of a reorganisation of logging.c.

[originally from svn r5344]
This commit is contained in:
Simon Tatham
2005-02-18 18:33:31 +00:00
parent 775fe9eb31
commit f73fcb0424
10 changed files with 338 additions and 176 deletions

View File

@ -27,6 +27,13 @@ extern AppController *controller;
* The SessionWindow class, defined in osxwin.m.
*/
struct alert_queue {
struct alert_queue *next;
NSAlert *alert;
void (*callback)(void *, int);
void *ctx;
};
@class SessionWindow;
@class TerminalView;
@ -40,8 +47,14 @@ extern AppController *controller;
void *ldisc;
Backend *back;
void *backhandle;
/*
* The following two members relate to the currently active
* alert sheet, if any. They are NULL if there isn't one.
*/
void (*alert_callback)(void *, int);
void *alert_ctx;
/* This queues future alerts that need to be shown. */
struct alert_queue *alert_qhead, *alert_qtail;
}
- (id)initWithConfig:(Config)cfg;
- (void)drawStartFinish:(BOOL)start;