X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/ccbfb941a6124efb75b68313c86dd195cfab575f..1d470ad2e5c02decf05a509b2c8c2718a3f70495:/windlg.c diff --git a/windlg.c b/windlg.c index 1d0604e5..47a8690b 100644 --- a/windlg.c +++ b/windlg.c @@ -15,8 +15,9 @@ static const char *const puttystr = PUTTY_REG_POS "\\Sessions"; -static char **negots = NULL; -static int nnegots = 0, negsize = 0; +static char **events = NULL; +static int nevents = 0, negsize = 0; + static HWND logbox = NULL, abtbox = NULL; static char hex[16] = "0123456789ABCDEF"; @@ -153,6 +154,10 @@ static void save_settings (char *section, int do_host) { wppi (sesskey, "LinuxFunctionKeys", cfg.linux_funkeys); wppi (sesskey, "ApplicationCursorKeys", cfg.app_cursor); wppi (sesskey, "ApplicationKeypad", cfg.app_keypad); + wppi (sesskey, "NetHackKeypad", cfg.nethack_keypad); + wppi (sesskey, "AltF4", cfg.alt_f4); + wppi (sesskey, "AltSpace", cfg.alt_space); + wppi (sesskey, "LdiscTerm", cfg.ldisc_term); wppi (sesskey, "ScrollbackLines", cfg.savelines); wppi (sesskey, "DECOriginMode", cfg.dec_om); wppi (sesskey, "AutoWrapMode", cfg.wrap_mode); @@ -187,6 +192,7 @@ static void save_settings (char *section, int do_host) { wpps (sesskey, buf, buf2); } wppi (sesskey, "KoiWinXlat", cfg.xlat_enablekoiwin); + wppi (sesskey, "88592Xlat", cfg.xlat_88592w1250); wppi (sesskey, "CapsLockCyr", cfg.xlat_capslockcyr); RegCloseKey(sesskey); @@ -283,6 +289,10 @@ static void load_settings (char *section, int do_host) { gppi (sesskey, "LinuxFunctionKeys", 0, &cfg.linux_funkeys); gppi (sesskey, "ApplicationCursorKeys", 0, &cfg.app_cursor); gppi (sesskey, "ApplicationKeypad", 0, &cfg.app_keypad); + gppi (sesskey, "NetHackKeypad", 0, &cfg.nethack_keypad); + gppi (sesskey, "AltF4", 1, &cfg.alt_f4); + gppi (sesskey, "AltSpace", 0, &cfg.alt_space); + gppi (sesskey, "LdiscTerm", 0, &cfg.ldisc_term); gppi (sesskey, "ScrollbackLines", 200, &cfg.savelines); gppi (sesskey, "DECOriginMode", 0, &cfg.dec_om); gppi (sesskey, "AutoWrapMode", 1, &cfg.wrap_mode); @@ -294,7 +304,7 @@ static void load_settings (char *section, int do_host) { gppi (sesskey, "FontIsBold", 0, &cfg.fontisbold); gppi (sesskey, "FontCharSet", ANSI_CHARSET, &cfg.fontcharset); gppi (sesskey, "FontHeight", 10, &cfg.fontheight); - gppi (sesskey, "FontVTMode", VT_POORMAN, &cfg.vtmode); + gppi (sesskey, "FontVTMode", VT_POORMAN, (int *)&cfg.vtmode); gppi (sesskey, "TryPalette", 0, &cfg.try_palette); gppi (sesskey, "BoldAsColour", 1, &cfg.bold_colour); for (i=0; i<22; i++) { @@ -306,10 +316,14 @@ static void load_settings (char *section, int do_host) { "85,255,255", "187,187,187", "255,255,255" }; char buf[20], buf2[30]; + int c0, c1, c2; sprintf(buf, "Colour%d", i); gpps (sesskey, buf, defaults[i], buf2, sizeof(buf2)); - sscanf(buf2, "%d,%d,%d", &cfg.colours[i][0], - &cfg.colours[i][1], &cfg.colours[i][2]); + if(sscanf(buf2, "%d,%d,%d", &c0, &c1, &c2) == 3) { + cfg.colours[i][0] = c0; + cfg.colours[i][1] = c1; + cfg.colours[i][2] = c2; + } } gppi (sesskey, "MouseIsXterm", 0, &cfg.mouse_is_xterm); for (i=0; i<256; i+=32) { @@ -336,6 +350,7 @@ static void load_settings (char *section, int do_host) { } } gppi (sesskey, "KoiWinXlat", 0, &cfg.xlat_enablekoiwin); + gppi (sesskey, "88592Xlat", 0, &cfg.xlat_88592w1250); gppi (sesskey, "CapsLockCyr", 0, &cfg.xlat_capslockcyr); RegCloseKey(sesskey); @@ -355,9 +370,9 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, switch (msg) { case WM_INITDIALOG: - for (i=0; i= negsize) { +void logevent (char *string) { + if (nevents >= negsize) { negsize += 64; - negots = srealloc (negots, negsize * sizeof(*negots)); + events = srealloc (events, negsize * sizeof(*events)); } - negots[nnegots] = smalloc(1+strlen(string)); - strcpy (negots[nnegots], string); - nnegots++; + events[nevents] = smalloc(1+strlen(string)); + strcpy (events[nevents], string); + nevents++; if (logbox) SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING, 0, (LPARAM)string); } -void shownegot (HWND hwnd) { +void showeventlog (HWND hwnd) { if (!logbox) { logbox = CreateDialog (hinst, MAKEINTRESOURCE(IDD_LOGBOX), hwnd, LogProc);