X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/b65d182beff5f0a5a2b743c886416c8d65a5b921..c91409da0ac0d3fb4a225ab85e14370514e4094e:/windlg.c diff --git a/windlg.c b/windlg.c index 36cbf5c8..62b49d0a 100644 --- a/windlg.c +++ b/windlg.c @@ -189,6 +189,7 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_PROTSTATIC, IDC_PROTRAW, IDC_PROTTELNET, + IDC_PROTRLOGIN, IDC_PROTSSH, IDC_SESSSTATIC, IDC_SESSEDIT, @@ -274,6 +275,10 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_BOX_APPEARANCE1, IDC_BOXT_APPEARANCE1, IDC_BOX_APPEARANCE2, IDC_BOXT_APPEARANCE2, IDC_BOX_APPEARANCE3, IDC_BOXT_APPEARANCE3, + IDC_CURSORSTATIC, + IDC_CURBLOCK, + IDC_CURUNDER, + IDC_CURVERT, IDC_BLINKCUR, IDC_FONTSTATIC, IDC_CHOOSEFONT, @@ -313,6 +318,16 @@ enum { IDCX_ABOUT = IDC_ABOUT, IDCX_TVSTATIC, IDCX_TREEVIEW, controlstartvalue, IDC_EMRFC, telnetpanelend, + rloginpanelstart, + IDC_TITLE_RLOGIN, + IDC_BOX_RLOGIN1, IDC_BOXT_RLOGIN1, + IDC_BOX_RLOGIN2, IDC_BOXT_RLOGIN2, + IDC_R_TSSTATIC, + IDC_R_TSEDIT, + IDC_RLLUSERSTATIC, + IDC_RLLUSEREDIT, + rloginpanelend, + sshpanelstart, IDC_TITLE_SSH, IDC_BOX_SSH1, IDC_BOXT_SSH1, @@ -429,7 +444,8 @@ static void init_dlg_ctrls(HWND hwnd) { SetDlgItemInt (hwnd, IDC_PORT, cfg.port, FALSE); CheckRadioButton (hwnd, IDC_PROTRAW, IDC_PROTSSH, cfg.protocol==PROT_SSH ? IDC_PROTSSH : - cfg.protocol==PROT_TELNET ? IDC_PROTTELNET : IDC_PROTRAW ); + cfg.protocol==PROT_TELNET ? IDC_PROTTELNET : + cfg.protocol==PROT_RLOGIN ? IDC_PROTRLOGIN : IDC_PROTRAW ); SetDlgItemInt (hwnd, IDC_PINGEDIT, cfg.ping_interval, FALSE); CheckRadioButton (hwnd, IDC_DEL008, IDC_DEL127, @@ -472,6 +488,9 @@ static void init_dlg_ctrls(HWND hwnd) { SetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle); CheckDlgButton (hwnd, IDC_WINNAME, cfg.win_name_always); + CheckRadioButton (hwnd, IDC_CURBLOCK, IDC_CURVERT, + cfg.cursor_type==0 ? IDC_CURBLOCK : + cfg.cursor_type==1 ? IDC_CURUNDER : IDC_CURVERT); CheckDlgButton (hwnd, IDC_BLINKCUR, cfg.blink_cur); CheckDlgButton (hwnd, IDC_SCROLLBAR, cfg.scrollbar); CheckDlgButton (hwnd, IDC_LOCKSIZE, cfg.locksize); @@ -480,6 +499,8 @@ static void init_dlg_ctrls(HWND hwnd) { SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype); SetDlgItemText (hwnd, IDC_TSEDIT, cfg.termspeed); + SetDlgItemText (hwnd, IDC_R_TSEDIT, cfg.termspeed); + SetDlgItemText (hwnd, IDC_RLLUSEREDIT, cfg.localusername); SetDlgItemText (hwnd, IDC_LOGEDIT, cfg.username); SetDlgItemText (hwnd, IDC_LGFEDIT, cfg.logfilename); CheckRadioButton(hwnd, IDC_LSTATOFF, IDC_LSTATRAW, @@ -686,13 +707,15 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, "&Port", IDC_PORTSTATIC, IDC_PORT, 25, NULL); if (backends[2].backend == NULL) { /* this is PuTTYtel, so only two protocols available */ - radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3, + radioline(&cp, "Protocol:", IDC_PROTSTATIC, 4, "&Raw", IDC_PROTRAW, - "&Telnet", IDC_PROTTELNET, NULL); + "&Telnet", IDC_PROTTELNET, + "R&login", IDC_PROTRLOGIN, NULL); } else { - radioline(&cp, "Protocol:", IDC_PROTSTATIC, 3, + radioline(&cp, "Protocol:", IDC_PROTSTATIC, 4, "&Raw", IDC_PROTRAW, "&Telnet", IDC_PROTTELNET, + "R&login", IDC_PROTRLOGIN, #ifdef FWHACK "SS&H/hack", #else @@ -828,7 +851,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, treeview_insert(&tvfaff, 0, "Window"); } - /* The Appearance panel. Accelerators used: [acgo] rmkhti */ + /* The Appearance panel. Accelerators used: [acgo] rmkhtibluv */ { struct ctlpos cp; ctlposinit(&cp, hwnd, 80, 3, 13); @@ -836,6 +859,11 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, IDC_TITLE_APPEARANCE); beginbox(&cp, "Adjust the use of the cursor", IDC_BOX_APPEARANCE1, IDC_BOXT_APPEARANCE1); + radioline(&cp, "Cursor appearance:", IDC_CURSORSTATIC, 3, + "B&lock", IDC_CURBLOCK, + "&Underline", IDC_CURUNDER, + "&Vertical line", IDC_CURVERT, + NULL); checkbox(&cp, "Cursor &blinks", IDC_BLINKCUR); endbox(&cp); beginbox(&cp, "Set the font used in the terminal window", @@ -948,7 +976,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, } beginbox(&cp, "Sending of null packets to keep session active", IDC_BOX_CONNECTION2, IDC_BOXT_CONNECTION2); - staticedit(&cp, "Minutes between &keepalives (0 to turn off)", + staticedit(&cp, "Seconds between &keepalives (0 to turn off)", IDC_PINGSTATIC, IDC_PINGEDIT, 25); endbox(&cp); @@ -981,6 +1009,23 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, } } + + /* The Rlogin Panel */ + { + struct ctlpos cp; + ctlposinit(&cp, hwnd, 80, 3, 13); + if (dlgtype == 0) { + bartitle(&cp, "Options controlling Rlogin connections", IDC_TITLE_RLOGIN); + beginbox(&cp, "Data to send to the server", + IDC_BOX_RLOGIN1, IDC_BOXT_RLOGIN1); + staticedit(&cp, "Terminal-&speed string", IDC_R_TSSTATIC, IDC_R_TSEDIT, 50); + staticedit(&cp, "&Local username:", IDC_RLLUSERSTATIC, IDC_RLLUSEREDIT, 50); + endbox(&cp); + + treeview_insert(&tvfaff, 1, "Rlogin"); + } + } + /* The SSH panel. Accelerators used: [acgo] rmakwp123bd */ if (backends[2].backend != NULL) { struct ctlpos cp; @@ -1083,6 +1128,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, hide(hwnd, FALSE, connectionpanelstart, connectionpanelend); if (!strcmp(buffer, "Telnet")) hide(hwnd, FALSE, telnetpanelstart, telnetpanelend); + if (!strcmp(buffer, "Rlogin")) + hide(hwnd, FALSE, rloginpanelstart, rloginpanelend); if (!strcmp(buffer, "SSH")) hide(hwnd, FALSE, sshpanelstart, sshpanelend); if (!strcmp(buffer, "Selection")) @@ -1111,16 +1158,19 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, EndDialog (hwnd, 0); return 0; case IDC_PROTTELNET: + case IDC_PROTRLOGIN: case IDC_PROTSSH: case IDC_PROTRAW: if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == BN_DOUBLECLICKED) { int i = IsDlgButtonChecked (hwnd, IDC_PROTSSH); int j = IsDlgButtonChecked (hwnd, IDC_PROTTELNET); - cfg.protocol = i ? PROT_SSH : j ? PROT_TELNET : PROT_RAW ; - if ((cfg.protocol == PROT_SSH && cfg.port == 23) || - (cfg.protocol == PROT_TELNET && cfg.port == 22)) { - cfg.port = i ? 22 : 23; + int k = IsDlgButtonChecked (hwnd, IDC_PROTRLOGIN); + cfg.protocol = i ? PROT_SSH : j ? PROT_TELNET : k ? PROT_RLOGIN : PROT_RAW ; + if ((cfg.protocol == PROT_SSH && cfg.port != 22) || + (cfg.protocol == PROT_TELNET && cfg.port != 23) || + (cfg.protocol == PROT_RLOGIN && cfg.port != 513)) { + cfg.port = i ? 22 : j ? 23 : 513; SetDlgItemInt (hwnd, IDC_PORT, cfg.port, FALSE); } } @@ -1417,6 +1467,21 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, HIWORD(wParam) == BN_DOUBLECLICKED) cfg.win_name_always = IsDlgButtonChecked (hwnd, IDC_WINNAME); break; + case IDC_CURBLOCK: + if (HIWORD(wParam) == BN_CLICKED || + HIWORD(wParam) == BN_DOUBLECLICKED) + cfg.cursor_type = 0; + break; + case IDC_CURUNDER: + if (HIWORD(wParam) == BN_CLICKED || + HIWORD(wParam) == BN_DOUBLECLICKED) + cfg.cursor_type = 1; + break; + case IDC_CURVERT: + if (HIWORD(wParam) == BN_CLICKED || + HIWORD(wParam) == BN_DOUBLECLICKED) + cfg.cursor_type = 2; + break; case IDC_BLINKCUR: if (HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == BN_DOUBLECLICKED) @@ -1490,8 +1555,9 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, } break; case IDC_TSEDIT: + case IDC_R_TSEDIT: if (HIWORD(wParam) == EN_CHANGE) - GetDlgItemText (hwnd, IDC_TSEDIT, cfg.termspeed, + GetDlgItemText (hwnd, LOWORD(wParam), cfg.termspeed, sizeof(cfg.termspeed)-1); break; case IDC_LOGEDIT: @@ -1499,6 +1565,11 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, GetDlgItemText (hwnd, IDC_LOGEDIT, cfg.username, sizeof(cfg.username)-1); break; + case IDC_RLLUSEREDIT: + if (HIWORD(wParam) == EN_CHANGE) + GetDlgItemText (hwnd, IDC_RLLUSEREDIT, cfg.localusername, + sizeof(cfg.localusername)-1); + break; case IDC_EMBSD: case IDC_EMRFC: cfg.rfc_environ = IsDlgButtonChecked (hwnd, IDC_EMRFC);