X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/098ecd174ccf3473f2345a7f1e205dd199cc0100..d3a22f7952add0b13fac029efb18faae537795bd:/windlg.c diff --git a/windlg.c b/windlg.c index f814cf4b..391938a8 100644 --- a/windlg.c +++ b/windlg.c @@ -50,7 +50,7 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, switch (msg) { case WM_INITDIALOG: { - static const int tabs[4] = {78, 108}; + static int tabs[4] = {78, 108}; SendDlgItemMessage (hwnd, IDN_LIST, LB_SETTABSTOPS, 2, (LPARAM) tabs); } @@ -366,6 +366,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_CIPHER3DES, IDC_CIPHERBLOWF, IDC_CIPHERDES, + IDC_CIPHERAES, IDC_BUGGYMAC, IDC_AUTHTIS, IDC_PKSTATIC, @@ -384,6 +385,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_TITLE_SELECTION, IDC_BOX_SELECTION1, IDC_BOX_SELECTION2, + IDC_BOX_SELECTION3, IDC_MBSTATIC, IDC_MBWINDOWS, IDC_MBXTERM, @@ -392,6 +394,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_CCSET, IDC_CCSTATIC2, IDC_CCEDIT, + IDC_RAWCNP, selectionpanelend, colourspanelstart, @@ -466,9 +469,8 @@ static void fmtfont (char *buf) { if (cfg.fontheight == 0) strcat (buf, "default height"); else - sprintf (buf+strlen(buf), "%d-%s", - (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight), - (cfg.fontheight < 0 ? "pixel" : "point")); + sprintf (buf+strlen(buf), "%d-point", + (cfg.fontheight < 0 ? -cfg.fontheight : cfg.fontheight)); } static void init_dlg_ctrls(HWND hwnd) { @@ -578,9 +580,10 @@ static void init_dlg_ctrls(HWND hwnd) { CheckDlgButton (hwnd, IDC_COMPRESS, cfg.compression); CheckDlgButton (hwnd, IDC_BUGGYMAC, cfg.buggymac); CheckDlgButton (hwnd, IDC_AGENTFWD, cfg.agentfwd); - CheckRadioButton (hwnd, IDC_CIPHER3DES, IDC_CIPHERDES, + CheckRadioButton (hwnd, IDC_CIPHER3DES, IDC_CIPHERAES, cfg.cipher == CIPHER_BLOWFISH ? IDC_CIPHERBLOWF : cfg.cipher == CIPHER_DES ? IDC_CIPHERDES : + cfg.cipher == CIPHER_AES ? IDC_CIPHERAES : IDC_CIPHER3DES); CheckRadioButton (hwnd, IDC_SSHPROT1, IDC_SSHPROT2, cfg.sshprot == 1 ? IDC_SSHPROT1 : IDC_SSHPROT2); @@ -590,6 +593,7 @@ static void init_dlg_ctrls(HWND hwnd) { CheckRadioButton (hwnd, IDC_MBWINDOWS, IDC_MBXTERM, cfg.mouse_is_xterm ? IDC_MBXTERM : IDC_MBWINDOWS); + CheckDlgButton (hwnd, IDC_RAWCNP, cfg.rawcnp); { static int tabs[4] = {25, 61, 96, 128}; SendDlgItemMessage (hwnd, IDC_CCLIST, LB_SETTABSTOPS, 4, @@ -905,20 +909,25 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == selectionpanelstart) { - /* The Selection panel. Accelerators used: [acgo] wx hst */ + /* The Selection panel. Accelerators used: [acgo] d wx hst */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling copy and paste", IDC_TITLE_SELECTION); - beginbox(&cp, "Control which mouse button does which thing", + beginbox(&cp, "Translation of pasted characters", IDC_BOX_SELECTION1); + checkbox(&cp, "&Don't translate line drawing chars into +, - and |", + IDC_RAWCNP); + endbox(&cp); + beginbox(&cp, "Control which mouse button does which thing", + IDC_BOX_SELECTION2); radiobig(&cp, "Action of mouse buttons:", IDC_MBSTATIC, "&Windows (Right pastes, Middle extends)", IDC_MBWINDOWS, "&xterm (Right extends, Middle pastes)", IDC_MBXTERM, NULL); endbox(&cp); beginbox(&cp, "Control the select-one-word-at-a-time mode", - IDC_BOX_SELECTION2); + IDC_BOX_SELECTION3); charclass(&cp, "C&haracter classes:", IDC_CCSTATIC, IDC_CCLIST, "&Set", IDC_CCSET, IDC_CCEDIT, "&to class", IDC_CCSTATIC2); @@ -1005,7 +1014,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == sshpanelstart) { - /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bd i */ + /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bds i */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); if (dlgtype == 0) { @@ -1031,10 +1040,12 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { radioline(&cp, "Preferred SSH protocol version:", IDC_SSHPROTSTATIC, 2, "&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2, NULL); - radioline(&cp, "Preferred encryption algorithm:", IDC_CIPHERSTATIC, 3, + radioline(&cp, "Preferred encryption algorithm:", IDC_CIPHERSTATIC, 4, "&3DES", IDC_CIPHER3DES, "&Blowfish", IDC_CIPHERBLOWF, - "&DES", IDC_CIPHERDES, NULL); + "&DES", IDC_CIPHERDES, + "AE&S", IDC_CIPHERAES, + NULL); checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x", IDC_BUGGYMAC); endbox(&cp); @@ -1545,7 +1556,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, cfg.font[sizeof(cfg.font)-1] = '\0'; cfg.fontisbold = (lf.lfWeight == FW_BOLD); cfg.fontcharset = lf.lfCharSet; - cfg.fontheight = lf.lfHeight; + cfg.fontheight = cf.iPointSize / 10; fmtfont (fontstatic); SetDlgItemText (hwnd, IDC_FONTSTATIC, fontstatic); } @@ -1779,6 +1790,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, case IDC_CIPHER3DES: case IDC_CIPHERBLOWF: case IDC_CIPHERDES: + case IDC_CIPHERAES: if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == BN_DOUBLECLICKED) { if (IsDlgButtonChecked (hwnd, IDC_CIPHER3DES)) @@ -1787,6 +1799,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, cfg.cipher = CIPHER_BLOWFISH; else if (IsDlgButtonChecked (hwnd, IDC_CIPHERDES)) cfg.cipher = CIPHER_DES; + else if (IsDlgButtonChecked (hwnd, IDC_CIPHERAES)) + cfg.cipher = CIPHER_AES; } break; case IDC_SSHPROT1: @@ -1836,6 +1850,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, SetDlgItemText (hwnd, IDC_PKEDIT, cfg.keyfile); } break; + case IDC_RAWCNP: + cfg.rawcnp = IsDlgButtonChecked (hwnd, IDC_RAWCNP); case IDC_MBWINDOWS: case IDC_MBXTERM: cfg.mouse_is_xterm = IsDlgButtonChecked (hwnd, IDC_MBXTERM); @@ -2058,14 +2074,14 @@ void logevent (char *string) { events[nevents] = smalloc(strlen(timebuf)+strlen(string)+1); strcpy(events[nevents], timebuf); strcat(events[nevents], string); - nevents++; if (logbox) { int count; SendDlgItemMessage (logbox, IDN_LIST, LB_ADDSTRING, - 0, (LPARAM)string); + 0, (LPARAM)events[nevents]); count = SendDlgItemMessage (logbox, IDN_LIST, LB_GETCOUNT, 0, 0); SendDlgItemMessage (logbox, IDN_LIST, LB_SETTOPINDEX, count-1, 0); } + nevents++; } void showeventlog (HWND hwnd) {