IDC_BELL_WAVESTATIC,
IDC_BELL_WAVEEDIT,
IDC_BELL_WAVEBROWSE,
+ IDC_B_IND_STATIC,
+ IDC_B_IND_DISABLED,
+ IDC_B_IND_FLASH,
+ IDC_B_IND_STEADY,
IDC_BELLOVL,
IDC_BELLOVLNSTATIC,
IDC_BELLOVLN,
tunnelspanelstart,
IDC_TITLE_TUNNELS,
- IDC_BOX_TUNNELS,
+ IDC_BOX_TUNNELS1,
+ IDC_BOX_TUNNELS2,
IDC_X11_FORWARD,
IDC_X11_DISPSTATIC,
IDC_X11_DISPLAY,
+ IDC_LPORT_ALL,
+ IDC_PFWDSTATIC,
+ IDC_PFWDSTATIC2,
+ IDC_PFWDREMOVE,
+ IDC_PFWDLIST,
+ IDC_PFWDADD,
+ IDC_SPORTSTATIC,
+ IDC_SPORTEDIT,
+ IDC_DPORTSTATIC,
+ IDC_DPORTEDIT,
+ IDC_PFWDLOCAL,
+ IDC_PFWDREMOTE,
+
tunnelspanelend,
controlendvalue
cfg.beep == BELL_WAVEFILE ? IDC_BELL_WAVEFILE :
cfg.beep ==
BELL_VISUAL ? IDC_BELL_VISUAL : IDC_BELL_DEFAULT);
+ CheckRadioButton(hwnd, IDC_B_IND_DISABLED, IDC_B_IND_STEADY,
+ cfg.beep_ind ==
+ B_IND_DISABLED ? IDC_B_IND_DISABLED : cfg.beep_ind ==
+ B_IND_FLASH ? IDC_B_IND_FLASH : cfg.beep_ind ==
+ B_IND_STEADY ? IDC_B_IND_STEADY : IDC_B_IND_DISABLED);
SetDlgItemText(hwnd, IDC_BELL_WAVEEDIT, cfg.bell_wavefile);
CheckDlgButton(hwnd, IDC_BELLOVL, cfg.bellovl);
SetDlgItemInt(hwnd, IDC_BELLOVLN, cfg.bellovl_n, FALSE);
IDC_LSTATXAPN);
{
char *p = cfg.environmt;
+ SendDlgItemMessage(hwnd, IDC_ENVLIST, LB_RESETCONTENT, 0, 0);
while (*p) {
SendDlgItemMessage(hwnd, IDC_ENVLIST, LB_ADDSTRING, 0,
(LPARAM) p);
p += strlen(p) + 1;
}
+ p = cfg.portfwd;
+ while (*p) {
+ SendDlgItemMessage(hwnd, IDC_PFWDLIST, LB_ADDSTRING, 0,
+ (LPARAM) p);
+ p += strlen(p) + 1;
+ }
}
CheckRadioButton(hwnd, IDC_EMBSD, IDC_EMRFC,
cfg.rfc_environ ? IDC_EMRFC : IDC_EMBSD);
SetDlgItemInt(hwnd, IDC_GVALUE, cfg.colours[0][1], FALSE);
SetDlgItemInt(hwnd, IDC_BVALUE, cfg.colours[0][2], FALSE);
- SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage);
+ {
+ int i;
+ char *cp;
+ int index = 0;
+ SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_RESETCONTENT, 0, 0);
+ for (i = 0; (cp = cp_enumerate(i)) != NULL; i++) {
+ SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_ADDSTRING,
+ 0, (LPARAM) cp);
+ if (!strcmp(cp, cfg.line_codepage))
+ index = i;
+ }
+ SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_SETCURSEL, index, 0);
+ }
+
CheckRadioButton(hwnd, IDC_VTXWINDOWS, IDC_VTUNICODE,
cfg.vtmode == VT_XWINDOWS ? IDC_VTXWINDOWS :
cfg.vtmode == VT_OEMANSI ? IDC_VTOEMANSI :
CheckDlgButton(hwnd, IDC_X11_FORWARD, cfg.x11_forward);
SetDlgItemText(hwnd, IDC_X11_DISPLAY, cfg.x11_display);
+
+ CheckDlgButton(hwnd, IDC_LPORT_ALL, cfg.lport_acceptall);
+ CheckRadioButton(hwnd, IDC_PFWDLOCAL, IDC_PFWDREMOTE, IDC_PFWDLOCAL);
}
struct treeview_faff {
}
if (panel == bellpanelstart) {
- /* The Bell panel. Accelerators used: [acgo] bdsm wt */
+ /* The Bell panel. Accelerators used: [acgo] bdsm wit */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Options controlling the terminal bell",
editbutton(&cp, "Custom sound file to play as a bell:",
IDC_BELL_WAVESTATIC, IDC_BELL_WAVEEDIT,
"Bro&wse...", IDC_BELL_WAVEBROWSE);
+ radioline(&cp, "Taskbar/caption &indication on bell:",
+ IDC_B_IND_STATIC, 3, "Disabled", IDC_B_IND_DISABLED,
+ "Flashing", IDC_B_IND_FLASH, "Steady", IDC_B_IND_STEADY,
+ NULL);
endbox(&cp);
beginbox(&cp, "Control the bell overload behaviour",
IDC_BOX_BELL2);
"&Poor man's line drawing (" "+" ", " "-" " and " "|" ")",
IDC_VTPOORMAN, "&Unicode mode", IDC_VTUNICODE, NULL);
endbox(&cp);
- beginbox(&cp, "Enable character set translation on received data",
+ beginbox(&cp, "Character set translation on received data",
IDC_BOX_TRANSLATION2);
- multiedit(&cp, "Line codepage:", IDC_CODEPAGESTATIC,
- IDC_CODEPAGE, 100, NULL);
+ dropdownlist(&cp,
+ "Received data assumed to be in which character set:",
+ IDC_CODEPAGESTATIC, IDC_CODEPAGE);
endbox(&cp);
}
}
if (panel == tunnelspanelstart) {
- /* The Tunnels panel. Accelerators used: [acgo] ex */
+ /* The Tunnels panel. Accelerators used: [acgo] deilmrstx */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) {
bartitle(&cp, "Options controlling SSH tunnelling",
IDC_TITLE_TUNNELS);
- beginbox(&cp, "X11 forwarding options", IDC_BOX_TUNNELS);
+ beginbox(&cp, "X11 forwarding", IDC_BOX_TUNNELS1);
checkbox(&cp, "&Enable X11 forwarding", IDC_X11_FORWARD);
multiedit(&cp, "&X display location", IDC_X11_DISPSTATIC,
IDC_X11_DISPLAY, 50, NULL);
endbox(&cp);
+ beginbox(&cp, "Port forwarding", IDC_BOX_TUNNELS2);
+ checkbox(&cp, "Local ports accept connections from o&ther hosts", IDC_LPORT_ALL);
+ staticbtn(&cp, "Forwarded ports:", IDC_PFWDSTATIC,
+ "&Remove", IDC_PFWDREMOVE);
+ fwdsetter(&cp, IDC_PFWDLIST,
+ "Add new forwarded port:", IDC_PFWDSTATIC2,
+ "&Source port", IDC_SPORTSTATIC, IDC_SPORTEDIT,
+ "Dest&ination", IDC_DPORTSTATIC, IDC_DPORTEDIT,
+ "A&dd", IDC_PFWDADD);
+ bareradioline(&cp, 2,
+ "&Local", IDC_PFWDLOCAL, "Re&mote", IDC_PFWDREMOTE, NULL);
+ endbox(&cp);
+
}
}
}
}
SetWindowLong(hwnd, GWL_USERDATA, 1);
+ sesslist_has_focus = 0;
return 0;
case WM_LBUTTONUP:
/*
cfg.beep = BELL_VISUAL;
}
break;
+ case IDC_B_IND_DISABLED:
+ case IDC_B_IND_FLASH:
+ case IDC_B_IND_STEADY:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ if (LOWORD(wParam) == IDC_B_IND_DISABLED)
+ cfg.beep_ind = B_IND_DISABLED;
+ if (LOWORD(wParam) == IDC_B_IND_FLASH)
+ cfg.beep_ind = B_IND_FLASH;
+ if (LOWORD(wParam) == IDC_B_IND_STEADY)
+ cfg.beep_ind = B_IND_STEADY;
+ }
+ break;
case IDC_BELL_WAVEBROWSE:
memset(&of, 0, sizeof(of));
#ifdef OPENFILENAME_SIZE_VERSION_400
}
break;
case IDC_CODEPAGE:
- if (HIWORD(wParam) == EN_CHANGE)
- GetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage,
- sizeof(cfg.line_codepage) - 1);
- if (HIWORD(wParam) == EN_KILLFOCUS) {
- int cp = decode_codepage(cfg.line_codepage);
- char buf[256];
- if (cp < -1) {
- if (cp == -2)
- sprintf(buf,
- "Unable to identify character set '%s', "
- "translation disabled.",
- cfg.line_codepage);
- if (cp == -3)
- sprintf(buf,
- "Character set '%s' is a DBCS, "
- "translation is not available.",
- cfg.line_codepage);
- MessageBox(hwnd, buf, "PuTTY Error",
- MB_ICONERROR | MB_OK);
- }
- strcpy(cfg.line_codepage, cp_name(cp));
- SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage);
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
+ int index = SendDlgItemMessage(hwnd, IDC_CODEPAGE,
+ CB_GETCURSEL, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_CODEPAGE, CB_GETLBTEXT,
+ index, (LPARAM)cfg.line_codepage);
}
break;
case IDC_VTXWINDOWS:
cfg.x11_forward =
IsDlgButtonChecked(hwnd, IDC_X11_FORWARD);
break;
+ case IDC_LPORT_ALL:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.lport_acceptall =
+ IsDlgButtonChecked(hwnd, IDC_LPORT_ALL);
+ break;
case IDC_X11_DISPLAY:
if (HIWORD(wParam) == EN_CHANGE)
GetDlgItemText(hwnd, IDC_X11_DISPLAY, cfg.x11_display,
sizeof(cfg.x11_display) - 1);
break;
+ case IDC_PFWDADD:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ char str[sizeof(cfg.portfwd)];
+ char *p;
+ if (IsDlgButtonChecked(hwnd, IDC_PFWDLOCAL))
+ str[0] = 'L';
+ else
+ str[0] = 'R';
+ GetDlgItemText(hwnd, IDC_SPORTEDIT, str+1,
+ sizeof(str) - 2);
+ if (!str[1]) {
+ MessageBox(hwnd,
+ "You need to specify a source port number",
+ "PuTTY Error", MB_OK | MB_ICONERROR);
+ break;
+ }
+ p = str + strlen(str);
+ *p++ = '\t';
+ GetDlgItemText(hwnd, IDC_DPORTEDIT, p,
+ sizeof(str) - 1 - (p - str));
+ if (!*p || !strchr(p, ':')) {
+ MessageBox(hwnd,
+ "You need to specify a destination address\n"
+ "in the form \"host.name:port\"",
+ "PuTTY Error", MB_OK | MB_ICONERROR);
+ break;
+ }
+ p = cfg.portfwd;
+ while (*p) {
+ while (*p)
+ p++;
+ p++;
+ }
+ if ((p - cfg.portfwd) + strlen(str) + 2 <
+ sizeof(cfg.portfwd)) {
+ strcpy(p, str);
+ p[strlen(str) + 1] = '\0';
+ SendDlgItemMessage(hwnd, IDC_PFWDLIST, LB_ADDSTRING,
+ 0, (LPARAM) str);
+ SetDlgItemText(hwnd, IDC_SPORTEDIT, "");
+ SetDlgItemText(hwnd, IDC_DPORTEDIT, "");
+ } else {
+ MessageBox(hwnd, "Too many forwardings",
+ "PuTTY Error", MB_OK | MB_ICONERROR);
+ }
+ }
+ break;
+ case IDC_PFWDREMOVE:
+ if (HIWORD(wParam) != BN_CLICKED &&
+ HIWORD(wParam) != BN_DOUBLECLICKED) break;
+ i = SendDlgItemMessage(hwnd, IDC_PFWDLIST,
+ LB_GETCURSEL, 0, 0);
+ if (i == LB_ERR)
+ MessageBeep(0);
+ else {
+ char *p, *q;
+
+ SendDlgItemMessage(hwnd, IDC_PFWDLIST, LB_DELETESTRING,
+ i, 0);
+ p = cfg.portfwd;
+ while (i > 0) {
+ if (!*p)
+ goto disaster2;
+ while (*p)
+ p++;
+ p++;
+ i--;
+ }
+ q = p;
+ if (!*p)
+ goto disaster2;
+ while (*p)
+ p++;
+ p++;
+ while (*p) {
+ while (*p)
+ *q++ = *p++;
+ *q++ = *p++;
+ }
+ *q = '\0';
+ disaster2:;
+ }
+ break;
}
return 0;
case WM_CLOSE:
}
if (msg == WM_COMMAND && LOWORD(wParam) == IDCX_ABOUT) {
EnableWindow(hwnd, 0);
- DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX),
- GetParent(hwnd), AboutProc);
+ DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProc);
EnableWindow(hwnd, 1);
SetActiveWindow(hwnd);
}
hwnd = CreateDialog(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX),
NULL, NullDlgProc);
ShowWindow(hwnd, SW_HIDE);
+ SetActiveWindow(hwnd);
DestroyWindow(hwnd);
}
}
"%s\n"
"If you trust this host, hit Yes to add the key to\n"
"PuTTY's cache and carry on connecting.\n"
- "If you do not trust this host, hit No to abandon the\n"
+ "If you want to carry on connecting just once, without\n"
+ "adding the key to the cache, hit No.\n"
+ "If you do not trust this host, hit Cancel to abandon the\n"
"connection.\n";
static const char wrongmsg[] =
static const char mbtitle[] = "PuTTY Security Alert";
-
char message[160 +
/* sensible fingerprint max size */
(sizeof(absentmsg) > sizeof(wrongmsg) ?
int mbret;
sprintf(message, absentmsg, fingerprint);
mbret = MessageBox(NULL, message, mbtitle,
- MB_ICONWARNING | MB_YESNO);
- if (mbret == IDNO)
+ MB_ICONWARNING | MB_YESNOCANCEL);
+ if (mbret == IDYES)
+ store_host_key(host, port, keytype, keystr);
+ if (mbret == IDCANCEL)
exit(0);
- store_host_key(host, port, keytype, keystr);
}
}