X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/9fee0f0d916f6c3e903881fc742d35814e46dba9..bace54316e12bf47756c5c53cd97baf533d95db5:/windlg.c diff --git a/windlg.c b/windlg.c index 629e6892..84674a72 100644 --- a/windlg.c +++ b/windlg.c @@ -66,6 +66,11 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg, int *selitems; selcount = SendDlgItemMessage(hwnd, IDN_LIST, LB_GETSELCOUNT, 0, 0); + if (selcount == 0) { /* don't even try to copy zero items */ + MessageBeep(0); + break; + } + selitems = smalloc(selcount * sizeof(int)); if (selitems) { int count = SendDlgItemMessage(hwnd, IDN_LIST, @@ -200,6 +205,17 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_CLOSEEXIT, sessionpanelend, + loggingpanelstart, + IDC_BOX_LOGGING1, + IDC_LSTATSTATIC, + IDC_LSTATOFF, + IDC_LSTATASCII, + IDC_LSTATRAW, + IDC_LGFSTATIC, + IDC_LGFEDIT, + IDC_LGFBUTTON, + loggingpanelend, + keyboardpanelstart, IDC_TITLE_KEYBOARD, IDC_BOX_KEYBOARD1, @@ -238,14 +254,14 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_BEEP, IDC_BCE, IDC_BLINKTEXT, - IDC_LDISCTERM, - IDC_LSTATSTATIC, - IDC_LSTATOFF, - IDC_LSTATASCII, - IDC_LSTATRAW, - IDC_LGFSTATIC, - IDC_LGFEDIT, - IDC_LGFBUTTON, + IDC_ECHOSTATIC, + IDC_ECHOBACKEND, + IDC_ECHOYES, + IDC_ECHONO, + IDC_EDITSTATIC, + IDC_EDITBACKEND, + IDC_EDITYES, + IDC_EDITNO, terminalpanelend, windowpanelstart, @@ -489,7 +505,12 @@ static void init_dlg_ctrls(HWND hwnd) { CheckDlgButton (hwnd, IDC_ALTSPACE, cfg.alt_space); CheckDlgButton (hwnd, IDC_ALTONLY, cfg.alt_only); CheckDlgButton (hwnd, IDC_COMPOSEKEY, cfg.compose_key); - CheckDlgButton (hwnd, IDC_LDISCTERM, cfg.ldisc_term); + CheckRadioButton (hwnd, IDC_ECHOBACKEND, IDC_ECHONO, + cfg.localecho == LD_BACKEND ? IDC_ECHOBACKEND: + cfg.localecho == LD_YES ? IDC_ECHOYES : IDC_ECHONO); + CheckRadioButton (hwnd, IDC_EDITBACKEND, IDC_EDITNO, + cfg.localedit == LD_BACKEND ? IDC_EDITBACKEND: + cfg.localedit == LD_YES ? IDC_EDITYES : IDC_EDITNO); CheckDlgButton (hwnd, IDC_ALWAYSONTOP, cfg.alwaysontop); CheckDlgButton (hwnd, IDC_SCROLLKEY, cfg.scroll_on_key); CheckDlgButton (hwnd, IDC_SCROLLDISP, cfg.scroll_on_disp); @@ -637,7 +658,7 @@ static HTREEITEM treeview_insert(struct treeview_faff *faff, */ static void create_controls(HWND hwnd, int dlgtype, int panel) { if (panel == sessionpanelstart) { - /* The Session panel. Accelerators used: [acgo] nprthelsdx */ + /* The Session panel. Accelerators used: [acgo] nprtih elsd x */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Basic options for your PuTTY session", @@ -653,12 +674,12 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { radioline(&cp, "Protocol:", IDC_PROTSTATIC, 4, "&Raw", IDC_PROTRAW, "&Telnet", IDC_PROTTELNET, - "R&login", IDC_PROTRLOGIN, NULL); + "Rlog&in", IDC_PROTRLOGIN, NULL); } else { radioline(&cp, "Protocol:", IDC_PROTSTATIC, 4, "&Raw", IDC_PROTRAW, "&Telnet", IDC_PROTTELNET, - "R&login", IDC_PROTRLOGIN, + "Rlog&in", IDC_PROTRLOGIN, #ifdef FWHACK "SS&H/hack", #else @@ -681,8 +702,26 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { endbox(&cp); } + if (panel == loggingpanelstart) { + /* The Logging panel. Accelerators used: [acgo] tplfw */ + struct ctlpos cp; + ctlposinit(&cp, hwnd, 80, 3, 13); + bartitle(&cp, "Options controlling session logging", + IDC_TITLE_TERMINAL); + beginbox(&cp, NULL, IDC_BOX_LOGGING1); + radiobig(&cp, + "Session logging:", IDC_LSTATSTATIC, + "Logging &turned off completely", IDC_LSTATOFF, + "Log &printable output only", IDC_LSTATASCII, + "&Log all session output", IDC_LSTATRAW, NULL); + editbutton(&cp, "Log &file name:", + IDC_LGFSTATIC, IDC_LGFEDIT, "Bro&wse...", + IDC_LGFBUTTON); + endbox(&cp); + } + if (panel == terminalpanelstart) { - /* The Terminal panel. Accelerators used: [acgo] &dflbenuw */ + /* The Terminal panel. Accelerators used: [acgo] wdlben ht */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling the terminal emulation", @@ -695,24 +734,23 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { checkbox(&cp, "&Beep enabled", IDC_BEEP); checkbox(&cp, "Use background colour to &erase screen", IDC_BCE); checkbox(&cp, "Enable bli&nking text", IDC_BLINKTEXT); - checkbox(&cp, "&Use local terminal line discipline", IDC_LDISCTERM); endbox(&cp); - beginbox(&cp, "Control session logging", + beginbox(&cp, "Line discipline options", IDC_BOX_TERMINAL2); - radiobig(&cp, - "Session logging:", IDC_LSTATSTATIC, - "Logging turned &off completely", IDC_LSTATOFF, - "Log printable output only", IDC_LSTATASCII, - "Log all session output", IDC_LSTATRAW, NULL); - editbutton(&cp, "Log &file name:", - IDC_LGFSTATIC, IDC_LGFEDIT, "Bro&wse...", - IDC_LGFBUTTON); + radioline(&cp, "Local ec&ho:", IDC_ECHOSTATIC, 3, + "Auto", IDC_ECHOBACKEND, + "Force on", IDC_ECHOYES, + "Force off", IDC_ECHONO, NULL); + radioline(&cp, "Local line edi&ting:", IDC_EDITSTATIC, 3, + "Auto", IDC_EDITBACKEND, + "Force on", IDC_EDITYES, + "Force off", IDC_EDITNO, NULL); endbox(&cp); } if (panel == keyboardpanelstart) { - /* The Keyboard panel. Accelerators used: [acgo] h?srvlxvnpmietu */ + /* The Keyboard panel. Accelerators used: [acgo] h?sr~lxv unpymie t */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling the effects of keys", @@ -755,7 +793,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == windowpanelstart) { - /* The Window panel. Accelerators used: [acgo] bsdkw4ylpt */ + /* The Window panel. Accelerators used: [acgo] rmz sdkp w4ylt */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling PuTTY's window", @@ -766,7 +804,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { "&Rows", IDC_ROWSSTATIC, IDC_ROWSEDIT, 50, "Colu&mns", IDC_COLSSTATIC, IDC_COLSEDIT, 50, NULL); - checkbox(&cp, "Loc&k window size against resizing", IDC_LOCKSIZE); + checkbox(&cp, "Lock window size against resi&zing", IDC_LOCKSIZE); endbox(&cp); beginbox(&cp, "Control the scrollback in the window", IDC_BOX_WINDOW2); @@ -787,7 +825,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == appearancepanelstart) { - /* The Appearance panel. Accelerators used: [acgo] rmkhtibluv */ + /* The Appearance panel. Accelerators used: [acgo] luvb h ti p */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling PuTTY's appearance", @@ -820,7 +858,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == translationpanelstart) { - /* The Translation panel. Accelerators used: [acgo] xbepnkis */ + /* The Translation panel. Accelerators used: [acgo] xbep t s */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling character set translation", @@ -838,11 +876,11 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { beginbox(&cp, "Enable character set translation on received data", IDC_BOX_TRANSLATION2); radiobig(&cp, - "Character set translation:", IDC_XLATSTATIC, - "&None", IDC_NOXLAT, - "&KOI8 / Win-1251", IDC_KOI8WIN1251, - "&ISO-8859-2 / Win-1250", IDC_88592WIN1250, - "&ISO-8859-2 / CP852", IDC_88592CP852, NULL); + "Character set &translation:", IDC_XLATSTATIC, + "None", IDC_NOXLAT, + "KOI8 / Win-1251", IDC_KOI8WIN1251, + "ISO-8859-2 / Win-1250", IDC_88592WIN1250, + "ISO-8859-2 / CP852", IDC_88592CP852, NULL); endbox(&cp); beginbox(&cp, "Enable character set translation on input data", IDC_BOX_TRANSLATION3); @@ -852,7 +890,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == selectionpanelstart) { - /* The Selection panel. Accelerators used: [acgo] wxst */ + /* The Selection panel. Accelerators used: [acgo] wx hst */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); bartitle(&cp, "Options controlling copy and paste", @@ -866,7 +904,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { endbox(&cp); beginbox(&cp, "Control the select-one-word-at-a-time mode", IDC_BOX_SELECTION2); - charclass(&cp, "Character classes:", IDC_CCSTATIC, IDC_CCLIST, + charclass(&cp, "C&haracter classes:", IDC_CCSTATIC, IDC_CCLIST, "&Set", IDC_CCSET, IDC_CCEDIT, "&to class", IDC_CCSTATIC2); endbox(&cp); @@ -909,12 +947,12 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { beginbox(&cp, "Sending of null packets to keep session active", IDC_BOX_CONNECTION2); staticedit(&cp, "Seconds between &keepalives (0 to turn off)", - IDC_PINGSTATIC, IDC_PINGEDIT, 25); + IDC_PINGSTATIC, IDC_PINGEDIT, 20); endbox(&cp); } if (panel == telnetpanelstart) { - /* The Telnet panel. Accelerators used: [acgo] svldrbf */ + /* The Telnet panel. Accelerators used: [acgo] svldr bf */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); if (dlgtype == 0) { @@ -952,7 +990,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { } if (panel == sshpanelstart) { - /* The SSH panel. Accelerators used: [acgo] rmakwp123bd */ + /* The SSH panel. Accelerators used: [acgo] rmfkw pe123bd i */ struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); if (dlgtype == 0) { @@ -967,7 +1005,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { IDC_BOX_SSH2); checkbox(&cp, "Atte&mpt TIS or CryptoCard authentication", IDC_AUTHTIS); - checkbox(&cp, "Allow &agent forwarding", IDC_AGENTFWD); + checkbox(&cp, "Allow agent &forwarding", IDC_AGENTFWD); editbutton(&cp, "Private &key file for authentication:", IDC_PKSTATIC, IDC_PKEDIT, "Bro&wse...", IDC_PKBUTTON); endbox(&cp); @@ -982,7 +1020,7 @@ static void create_controls(HWND hwnd, int dlgtype, int panel) { "&3DES", IDC_CIPHER3DES, "&Blowfish", IDC_CIPHERBLOWF, "&DES", IDC_CIPHERDES, NULL); - checkbox(&cp, "Imitate SSH 2 MAC bug in commercial <= v2.3.x", + checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x", IDC_BUGGYMAC); endbox(&cp); } @@ -1081,6 +1119,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, * Set up the tree view contents. */ hsession = treeview_insert(&tvfaff, 0, "Session"); + treeview_insert(&tvfaff, 1, "Logging"); treeview_insert(&tvfaff, 0, "Terminal"); treeview_insert(&tvfaff, 1, "Keyboard"); treeview_insert(&tvfaff, 0, "Window"); @@ -1144,6 +1183,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, } if (!strcmp(buffer, "Session")) create_controls(hwnd, dlgtype, sessionpanelstart); + if (!strcmp(buffer, "Logging")) + create_controls(hwnd, dlgtype, loggingpanelstart); if (!strcmp(buffer, "Keyboard")) create_controls(hwnd, dlgtype, keyboardpanelstart); if (!strcmp(buffer, "Terminal")) @@ -1398,10 +1439,25 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, HIWORD(wParam) == BN_DOUBLECLICKED) cfg.alt_only = IsDlgButtonChecked (hwnd, IDC_ALTONLY); break; - case IDC_LDISCTERM: + case IDC_ECHOBACKEND: + case IDC_ECHOYES: + case IDC_ECHONO: if (HIWORD(wParam) == BN_CLICKED || - HIWORD(wParam) == BN_DOUBLECLICKED) - cfg.ldisc_term = IsDlgButtonChecked (hwnd, IDC_LDISCTERM); + HIWORD(wParam) == BN_DOUBLECLICKED) { + if (LOWORD(wParam)==IDC_ECHOBACKEND) cfg.localecho=LD_BACKEND; + if (LOWORD(wParam)==IDC_ECHOYES) cfg.localecho=LD_YES; + if (LOWORD(wParam)==IDC_ECHONO) cfg.localecho=LD_NO; + } + break; + case IDC_EDITBACKEND: + case IDC_EDITYES: + case IDC_EDITNO: + if (HIWORD(wParam) == BN_CLICKED || + HIWORD(wParam) == BN_DOUBLECLICKED) { + if (LOWORD(wParam)==IDC_EDITBACKEND) cfg.localedit=LD_BACKEND; + if (LOWORD(wParam)==IDC_EDITYES) cfg.localedit=LD_YES; + if (LOWORD(wParam)==IDC_EDITNO) cfg.localedit=LD_NO; + } break; case IDC_ALWAYSONTOP: if (HIWORD(wParam) == BN_CLICKED ||