1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-17 19:11:00 -05:00

New Seat method, seat_nonfatal().

This is like the seat-independent nonfatal(), but specifies a Seat,
which allows the GUI dialog box to have the right terminal window as
its parent (if there are multiple ones).

Changed over all the nonfatal() calls in the code base that could be
localised to a Seat, which means all the ones that come up if
something goes horribly wrong in host key storage. To make that
possible, I've added a 'seat' parameter to store_host_key(); it turns
out that all its call sites had one available already.
This commit is contained in:
Simon Tatham
2022-09-13 08:49:38 +01:00
parent c674b2da4f
commit 4249b39ed3
24 changed files with 104 additions and 19 deletions

View File

@ -321,6 +321,7 @@ static bool win_seat_eof(Seat *seat);
static SeatPromptResult win_seat_get_userpass_input(Seat *seat, prompts_t *p);
static void win_seat_notify_remote_exit(Seat *seat);
static void win_seat_connection_fatal(Seat *seat, const char *msg);
static void win_seat_nonfatal(Seat *seat, const char *msg);
static void win_seat_update_specials_menu(Seat *seat);
static void win_seat_set_busy_status(Seat *seat, BusyStatus status);
static void win_seat_set_trust_status(Seat *seat, bool trusted);
@ -338,6 +339,7 @@ static const SeatVtable win_seat_vt = {
.notify_remote_exit = win_seat_notify_remote_exit,
.notify_remote_disconnect = nullseat_notify_remote_disconnect,
.connection_fatal = win_seat_connection_fatal,
.nonfatal = win_seat_nonfatal,
.update_specials_menu = win_seat_update_specials_menu,
.get_ttymode = win_seat_get_ttymode,
.set_busy_status = win_seat_set_busy_status,
@ -1188,6 +1190,17 @@ static void win_seat_connection_fatal(Seat *seat, const char *msg)
}
}
/*
* Print a message box and don't close the connection.
*/
static void win_seat_nonfatal(Seat *seat, const char *msg)
{
char *title = dupprintf("%s Error", appname);
show_mouseptr(true);
MessageBox(wgs.term_hwnd, msg, title, MB_ICONERROR | MB_OK);
sfree(title);
}
/*
* Report an error at the command-line parsing stage.
*/