X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=macosx%2Fosxdlg.m;h=295b675520d790c08a1b6afc81115016758b228a;hb=f004bcca17a789356c32527a396b68b71a773db2;hp=f2d09027c5f7ce45957d22b152b7bedb0c580ded;hpb=f73fcb042423866a06b9e41b6934906a0fe9502e;p=PuTTY.git diff --git a/macosx/osxdlg.m b/macosx/osxdlg.m index f2d09027..295b6755 100644 --- a/macosx/osxdlg.m +++ b/macosx/osxdlg.m @@ -123,12 +123,10 @@ int hmin = 0; int panelht = 0; - get_sesslist(&sl, TRUE); - ctrlbox = ctrl_new_box(); - setup_config_box(ctrlbox, &sl, FALSE /*midsession*/, aCfg.protocol, + setup_config_box(ctrlbox, FALSE /*midsession*/, aCfg.protocol, 0 /* protcfginfo */); - unix_setup_config_box(ctrlbox, FALSE /*midsession*/); + unix_setup_config_box(ctrlbox, FALSE /*midsession*/, aCfg.protocol); cfg = aCfg; /* structure copy */ @@ -485,7 +483,27 @@ void old_keyfile_warning(void) */ } -void about_box(void *window) +static void connection_fatal_callback(void *ctx, int result) +{ + SessionWindow *win = (SessionWindow *)ctx; + + [win endSession:FALSE]; +} + +void connection_fatal(void *frontend, char *p, ...) { - /* FIXME */ + SessionWindow *win = (SessionWindow *)frontend; + va_list ap; + char *msg; + NSAlert *alert; + + va_start(ap, p); + msg = dupvprintf(p, ap); + va_end(ap); + + alert = [[NSAlert alloc] init]; + [alert setInformativeText:[NSString stringWithCString:msg]]; + [alert addButtonWithTitle:@"Proceed"]; + [win startAlert:alert withCallback:connection_fatal_callback + andCtx:win]; }