X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/5bf9955dd5524e9b564f4d520e863b2509a56f89..125105d16c788398562ac03e91ce7a0dc0292492:/unix/gtkdlg.c diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index f5fe5d49..a454d8bb 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -993,6 +993,7 @@ static void list_selchange(GtkList *list, gpointer data) { struct dlgparam *dp = (struct dlgparam *)data; struct uctrl *uc = dlg_find_bywidget(dp, GTK_WIDGET(list)); + if (!uc) return; uc->ctrl->generic.handler(uc->ctrl, dp, dp->data, EVENT_SELCHANGE); } @@ -1910,8 +1911,6 @@ int do_config_box(const char *title, Config *cfg) struct selparam *selparams = NULL; int nselparams = 0, selparamsize = 0; - do_defaults(NULL, cfg); - dlg_init(&dp); { @@ -1922,7 +1921,7 @@ int do_config_box(const char *title, Config *cfg) gtk_widget_unref(listitem); } - sl.nsessions = 0; + get_sesslist(&sl, TRUE); for (index = 0; index < lenof(scs.sc); index++) { scs.sc[index].action = SHORTCUT_EMPTY; @@ -2115,6 +2114,7 @@ int do_config_box(const char *title, Config *cfg) gtk_main(); + get_sesslist(&sl, FALSE); dlg_cleanup(&dp); sfree(selparams); @@ -2337,30 +2337,21 @@ void old_keyfile_warning(void) */ } -void fatalbox(char *p, ...) +void fatal_message_box(void *window, char *msg) { - va_list ap; - char *msg; - va_start(ap, p); - msg = dupvprintf(p, ap); - va_end(ap); - messagebox(NULL, "PuTTY Fatal Error", msg, + messagebox(window, "PuTTY Fatal Error", msg, string_width("REASONABLY LONG LINE OF TEXT FOR BASIC SANITY"), "OK", 'o', 1, 1, NULL); - sfree(msg); - cleanup_exit(1); } -void connection_fatal(void *frontend, char *p, ...) + +void fatalbox(char *p, ...) { va_list ap; char *msg; va_start(ap, p); msg = dupvprintf(p, ap); va_end(ap); - messagebox(GTK_WIDGET(get_window(frontend)), - "PuTTY Fatal Error", msg, - string_width("REASONABLY LONG LINE OF TEXT FOR BASIC SANITY"), - "OK", 'o', 1, 1, NULL); + fatal_message_box(NULL, msg); sfree(msg); cleanup_exit(1); }