static struct prefslist cipherlist;
+#define PRINTER_DISABLED_STRING "None (printing disabled)"
+
void force_normal(HWND hwnd)
{
static int recurse = 0;
IDC_KPNORMAL,
IDC_KPAPPLIC,
IDC_KPNH,
- IDC_NOAPPLICK,
- IDC_NOAPPLICC,
IDC_CURSTATIC,
IDC_CURNORMAL,
IDC_CURAPPLIC,
IDC_TITLE_TERMINAL,
IDC_BOX_TERMINAL1,
IDC_BOX_TERMINAL2,
+ IDC_BOX_TERMINAL3,
IDC_WRAPMODE,
IDC_DECOM,
IDC_LFHASCR,
IDC_EDITBACKEND,
IDC_EDITYES,
IDC_EDITNO,
+ IDC_PRINTERSTATIC,
+ IDC_PRINTER,
terminalpanelend,
+ featurespanelstart,
+ IDC_TITLE_FEATURES,
+ IDC_BOX_FEATURES1,
+ IDC_NOAPPLICK,
+ IDC_NOAPPLICC,
+ IDC_NOMOUSEREP,
+ IDC_NORESIZE,
+ IDC_NOALTSCREEN,
+ IDC_NOWINTITLE,
+ IDC_NODBACKSPACE,
+ IDC_NOCHARSET,
+ featurespanelend,
+
bellpanelstart,
IDC_TITLE_BELL,
IDC_BOX_BELL1,
IDC_NODELAY,
connectionpanelend,
+ proxypanelstart,
+ IDC_TITLE_PROXY,
+ IDC_BOX_PROXY1,
+ IDC_PROXYTYPESTATIC,
+ IDC_PROXYTYPENONE,
+ IDC_PROXYTYPEHTTP,
+ IDC_PROXYTYPESOCKS,
+ IDC_PROXYTYPETELNET,
+ IDC_PROXYHOSTSTATIC,
+ IDC_PROXYHOSTEDIT,
+ IDC_PROXYPORTSTATIC,
+ IDC_PROXYPORTEDIT,
+ IDC_PROXYEXCLUDESTATIC,
+ IDC_PROXYEXCLUDEEDIT,
+ IDC_PROXYUSERSTATIC,
+ IDC_PROXYUSEREDIT,
+ IDC_PROXYPASSSTATIC,
+ IDC_PROXYPASSEDIT,
+ IDC_BOX_PROXY2,
+ IDC_PROXYTELNETCMDSTATIC,
+ IDC_PROXYTELNETCMDEDIT,
+ IDC_PROXYSOCKSVERSTATIC,
+ IDC_PROXYSOCKSVER5,
+ IDC_PROXYSOCKSVER4,
+ proxypanelend,
+
telnetpanelstart,
IDC_TITLE_TELNET,
IDC_BOX_TELNET1,
IDC_BUGGYMAC,
IDC_SSH2DES,
IDC_SSHPROTSTATIC,
+ IDC_SSHPROT1ONLY,
IDC_SSHPROT1,
IDC_SSHPROT2,
+ IDC_SSHPROT2ONLY,
IDC_CMDSTATIC,
IDC_CMDEDIT,
IDC_COMPRESS,
case IDC_KPSTATIC:
case IDC_KPNORMAL:
case IDC_KPAPPLIC:
- case IDC_NOAPPLICK:
return "JI(`',`keyboard.appkeypad')";
- case IDC_NOAPPLICC:
case IDC_CURSTATIC:
case IDC_CURNORMAL:
case IDC_CURAPPLIC:
case IDC_CTRLALTKEYS:
return "JI(`',`keyboard.ctrlalt')";
+ case IDC_NOAPPLICK:
+ case IDC_NOAPPLICC:
+ return "JI(`',`features.application')";
+ case IDC_NOMOUSEREP:
+ return "JI(`',`features.mouse')";
+ case IDC_NORESIZE:
+ return "JI(`',`features.resize')";
+ case IDC_NOALTSCREEN:
+ return "JI(`',`features.altscreen')";
+ case IDC_NOWINTITLE:
+ return "JI(`',`features.retitle')";
+ case IDC_NODBACKSPACE:
+ return "JI(`',`features.dbackspace')";
+ case IDC_NOCHARSET:
+ return "JI(`',`features.charset')";
+
case IDC_WRAPMODE:
return "JI(`',`terminal.autowrap')";
case IDC_DECOM:
case IDC_EDITYES:
case IDC_EDITNO:
return "JI(`',`terminal.localedit')";
+ case IDC_PRINTERSTATIC:
+ case IDC_PRINTER:
+ return "JI(`',`terminal.printing')";
case IDC_BELLSTATIC:
case IDC_BELL_DISABLED:
case IDC_BUGGYMAC:
return "JI(`',`ssh.buggymac')";
case IDC_SSHPROTSTATIC:
+ case IDC_SSHPROT1ONLY:
case IDC_SSHPROT1:
case IDC_SSHPROT2:
+ case IDC_SSHPROT2ONLY:
return "JI(`',`ssh.protocol')";
case IDC_CMDSTATIC:
case IDC_CMDEDIT:
cfg.funky_type == 5 ? IDC_FUNCSCO : IDC_FUNCTILDE);
CheckDlgButton(hwnd, IDC_NOAPPLICC, cfg.no_applic_c);
CheckDlgButton(hwnd, IDC_NOAPPLICK, cfg.no_applic_k);
+ CheckDlgButton(hwnd, IDC_NOMOUSEREP, cfg.no_mouse_rep);
+ CheckDlgButton(hwnd, IDC_NORESIZE, cfg.no_remote_resize);
+ CheckDlgButton(hwnd, IDC_NOALTSCREEN, cfg.no_alt_screen);
+ CheckDlgButton(hwnd, IDC_NOWINTITLE, cfg.no_remote_wintitle);
+ CheckDlgButton(hwnd, IDC_NODBACKSPACE, cfg.no_dbackspace);
+ CheckDlgButton(hwnd, IDC_NOCHARSET, cfg.no_remote_charset);
CheckRadioButton(hwnd, IDC_CURNORMAL, IDC_CURAPPLIC,
cfg.app_cursor ? IDC_CURAPPLIC : IDC_CURNORMAL);
CheckRadioButton(hwnd, IDC_KPNORMAL, IDC_KPNH,
CheckDlgButton(hwnd, IDC_SSH2DES, cfg.ssh2_des_cbc);
CheckDlgButton(hwnd, IDC_AGENTFWD, cfg.agentfwd);
CheckDlgButton(hwnd, IDC_CHANGEUSER, cfg.change_username);
- CheckRadioButton(hwnd, IDC_SSHPROT1, IDC_SSHPROT2,
- cfg.sshprot == 1 ? IDC_SSHPROT1 : IDC_SSHPROT2);
+ CheckRadioButton(hwnd, IDC_SSHPROT1ONLY, IDC_SSHPROT2ONLY,
+ cfg.sshprot == 1 ? IDC_SSHPROT1 :
+ cfg.sshprot == 2 ? IDC_SSHPROT2 :
+ cfg.sshprot == 3 ? IDC_SSHPROT2ONLY : IDC_SSHPROT1ONLY);
CheckDlgButton(hwnd, IDC_AUTHTIS, cfg.try_tis_auth);
CheckDlgButton(hwnd, IDC_AUTHKI, cfg.try_ki_auth);
SetDlgItemText(hwnd, IDC_PKEDIT, cfg.keyfile);
}
SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage);
}
-
+
+ {
+ int i, nprinters;
+ printer_enum *pe;
+ pe = printer_start_enum(&nprinters);
+ SendDlgItemMessage(hwnd, IDC_PRINTER, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_PRINTER, CB_ADDSTRING,
+ 0, (LPARAM) PRINTER_DISABLED_STRING);
+ for (i = 0; i < nprinters; i++) {
+ char *printer_name = printer_get_name(pe, i);
+ SendDlgItemMessage(hwnd, IDC_PRINTER, CB_ADDSTRING,
+ 0, (LPARAM) printer_name);
+ }
+ printer_finish_enum(pe);
+ SetDlgItemText(hwnd, IDC_PRINTER,
+ *cfg.printer ? cfg.printer : PRINTER_DISABLED_STRING);
+ }
+
CheckRadioButton(hwnd, IDC_VTXWINDOWS, IDC_VTUNICODE,
cfg.vtmode == VT_XWINDOWS ? IDC_VTXWINDOWS :
cfg.vtmode == VT_OEMANSI ? IDC_VTOEMANSI :
CheckDlgButton(hwnd, IDC_LPORT_ALL, cfg.lport_acceptall);
CheckDlgButton(hwnd, IDC_RPORT_ALL, cfg.rport_acceptall);
CheckRadioButton(hwnd, IDC_PFWDLOCAL, IDC_PFWDREMOTE, IDC_PFWDLOCAL);
+
+ /* proxy config */
+ CheckRadioButton(hwnd, IDC_PROXYTYPENONE, IDC_PROXYTYPETELNET,
+ cfg.proxy_type == PROXY_HTTP ? IDC_PROXYTYPEHTTP :
+ cfg.proxy_type == PROXY_SOCKS ? IDC_PROXYTYPESOCKS :
+ cfg.proxy_type == PROXY_TELNET ? IDC_PROXYTYPETELNET : IDC_PROXYTYPENONE);
+ SetDlgItemText(hwnd, IDC_PROXYHOSTEDIT, cfg.proxy_host);
+ SetDlgItemInt(hwnd, IDC_PROXYPORTEDIT, cfg.proxy_port, FALSE);
+ SetDlgItemText(hwnd, IDC_PROXYEXCLUDEEDIT, cfg.proxy_exclude_list);
+ SetDlgItemText(hwnd, IDC_PROXYTELNETCMDEDIT, cfg.proxy_telnet_command);
+ SetDlgItemText(hwnd, IDC_PROXYUSEREDIT, cfg.proxy_username);
+ SetDlgItemText(hwnd, IDC_PROXYPASSEDIT, cfg.proxy_password);
+ CheckRadioButton(hwnd, IDC_PROXYSOCKSVER5, IDC_PROXYSOCKSVER4,
+ cfg.proxy_socks_version == 4 ? IDC_PROXYSOCKSVER4 : IDC_PROXYSOCKSVER5);
}
struct treeview_faff {
}
if (panel == terminalpanelstart) {
- /* The Terminal panel. Accelerators used: [acgoh] wdren lts */
+ /* The Terminal panel. Accelerators used: [acgoh] wdren lts p */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Options controlling the terminal emulation",
"Auto", IDC_EDITBACKEND,
"Force on", IDC_EDITYES, "Force off", IDC_EDITNO, NULL);
endbox(&cp);
+
+ beginbox(&cp, "Remote-controlled printing", IDC_BOX_TERMINAL3);
+ combobox(&cp, "&Printer to send ANSI printer output to:",
+ IDC_PRINTERSTATIC, IDC_PRINTER);
+ endbox(&cp);
+ }
+
+ if (panel == featurespanelstart) {
+ /* The Features panel. Accelerators used: [acgoh] ukswtbrx */
+ struct ctlpos cp;
+ ctlposinit(&cp, hwnd, 80, 3, 13);
+ bartitle(&cp, "Enabling and disabling advanced terminal features ",
+ IDC_TITLE_FEATURES);
+ beginbox(&cp, NULL, IDC_BOX_FEATURES1);
+ checkbox(&cp, "Disable application c&ursor keys mode", IDC_NOAPPLICC);
+ checkbox(&cp, "Disable application &keypad mode", IDC_NOAPPLICK);
+ checkbox(&cp, "Disable &xterm-style mouse reporting", IDC_NOMOUSEREP);
+ checkbox(&cp, "Disable remote-controlled terminal re&sizing",
+ IDC_NORESIZE);
+ checkbox(&cp, "Disable s&witching to alternate terminal screen",
+ IDC_NOALTSCREEN);
+ checkbox(&cp, "Disable remote-controlled window &title changing",
+ IDC_NOWINTITLE);
+ checkbox(&cp, "Disable destructive &backspace on server sending ^?",
+ IDC_NODBACKSPACE);
+ checkbox(&cp, "Disable remote-controlled cha&racter set configuration",
+ IDC_NOCHARSET);
+ endbox(&cp);
}
if (panel == bellpanelstart) {
}
if (panel == keyboardpanelstart) {
- /* The Keyboard panel. Accelerators used: [acgoh] bef ruyntd */
+ /* The Keyboard panel. Accelerators used: [acgoh] bef rntd */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Options controlling the effects of keys",
"VT100+", IDC_FUNCVT100P, "SCO", IDC_FUNCSCO, NULL);
endbox(&cp);
beginbox(&cp, "Application keypad settings:", IDC_BOX_KEYBOARD2);
- checkbox(&cp,
- "Application c&ursor keys totally disabled",
- IDC_NOAPPLICC);
radioline(&cp, "Initial state of cu&rsor keys:", IDC_CURSTATIC, 2,
"Normal", IDC_CURNORMAL,
"Application", IDC_CURAPPLIC, NULL);
- checkbox(&cp,
- "Application ke&ypad keys totally disabled",
- IDC_NOAPPLICK);
radioline(&cp, "Initial state of &numeric keypad:", IDC_KPSTATIC,
3, "Normal", IDC_KPNORMAL, "Application", IDC_KPAPPLIC,
"NetHack", IDC_KPNH, NULL);
}
}
+ if (panel == proxypanelstart) {
+ /* The Proxy panel. Accelerators used: [acgoh] ntslypeuwmv */
+ struct ctlpos cp;
+ ctlposinit(&cp, hwnd, 80, 3, 13);
+ if (dlgtype == 0) {
+ bartitle(&cp, "Options controlling proxy usage",
+ IDC_TITLE_PROXY);
+ beginbox(&cp, "Proxy basics", IDC_BOX_PROXY1);
+ radioline(&cp, "Proxy type:", IDC_PROXYTYPESTATIC, 4,
+ "&None", IDC_PROXYTYPENONE,
+ "H&TTP", IDC_PROXYTYPEHTTP,
+ "&SOCKS", IDC_PROXYTYPESOCKS,
+ "Te&lnet", IDC_PROXYTYPETELNET, NULL);
+ multiedit(&cp,
+ "Prox&y Host", IDC_PROXYHOSTSTATIC, IDC_PROXYHOSTEDIT, 80,
+ "&Port", IDC_PROXYPORTSTATIC, IDC_PROXYPORTEDIT, 20, NULL);
+ multiedit(&cp,
+ "&Exclude Hosts/IPs", IDC_PROXYEXCLUDESTATIC,
+ IDC_PROXYEXCLUDEEDIT, 100, NULL);
+ staticedit(&cp, "&Username", IDC_PROXYUSERSTATIC,
+ IDC_PROXYUSEREDIT, 60);
+ staticedit(&cp, "Pass&word", IDC_PROXYPASSSTATIC,
+ IDC_PROXYPASSEDIT, 60);
+ endbox(&cp);
+ beginbox(&cp, "Misc. proxy settings", IDC_BOX_PROXY2);
+ multiedit(&cp,
+ "Telnet co&mmand", IDC_PROXYTELNETCMDSTATIC,
+ IDC_PROXYTELNETCMDEDIT, 100, NULL);
+ radioline(&cp, "SOCKS &Version", IDC_PROXYSOCKSVERSTATIC,
+ 2, "Version 5", IDC_PROXYSOCKSVER5, "Version 4",
+ IDC_PROXYSOCKSVER4, NULL);
+ endbox(&cp);
+ }
+ }
+
if (panel == telnetpanelstart) {
/* The Telnet panel. Accelerators used: [acgoh] svldr bftk */
struct ctlpos cp;
}
if (panel == sshpanelstart) {
- /* The SSH panel. Accelerators used: [acgoh] r pe12i sd */
+ /* The SSH panel. Accelerators used: [acgoh] r pe12ni sd */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
if (dlgtype == 0) {
checkbox(&cp, "Don't allocate a &pseudo-terminal", IDC_NOPTY);
checkbox(&cp, "Enable compr&ession", IDC_COMPRESS);
radioline(&cp, "Preferred SSH protocol version:",
- IDC_SSHPROTSTATIC, 2,
- "&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2, NULL);
+ IDC_SSHPROTSTATIC, 4,
+ "1 on&ly", IDC_SSHPROT1ONLY,
+ "&1", IDC_SSHPROT1, "&2", IDC_SSHPROT2,
+ "2 o&nly", IDC_SSHPROT2ONLY, NULL);
checkbox(&cp, "&Imitate SSH 2 MAC bug in commercial <= v2.3.x",
IDC_BUGGYMAC);
endbox(&cp);
treeview_insert(&tvfaff, 0, "Terminal");
treeview_insert(&tvfaff, 1, "Keyboard");
treeview_insert(&tvfaff, 1, "Bell");
+ treeview_insert(&tvfaff, 1, "Features");
treeview_insert(&tvfaff, 0, "Window");
treeview_insert(&tvfaff, 1, "Appearance");
treeview_insert(&tvfaff, 1, "Behaviour");
treeview_insert(&tvfaff, 1, "Colours");
treeview_insert(&tvfaff, 0, "Connection");
if (dlgtype == 0) {
+ treeview_insert(&tvfaff, 1, "Proxy");
treeview_insert(&tvfaff, 1, "Telnet");
treeview_insert(&tvfaff, 1, "Rlogin");
if (backends[3].backend != NULL) {
create_controls(hwnd, dlgtype, terminalpanelstart);
if (!strcmp(buffer, "Bell"))
create_controls(hwnd, dlgtype, bellpanelstart);
+ if (!strcmp(buffer, "Features"))
+ create_controls(hwnd, dlgtype, featurespanelstart);
if (!strcmp(buffer, "Window"))
create_controls(hwnd, dlgtype, windowpanelstart);
if (!strcmp(buffer, "Appearance"))
create_controls(hwnd, dlgtype, tunnelspanelstart);
if (!strcmp(buffer, "Connection"))
create_controls(hwnd, dlgtype, connectionpanelstart);
+ if (!strcmp(buffer, "Proxy"))
+ create_controls(hwnd, dlgtype, proxypanelstart);
if (!strcmp(buffer, "Telnet"))
create_controls(hwnd, dlgtype, telnetpanelstart);
if (!strcmp(buffer, "Rlogin"))
cfg.no_applic_k =
IsDlgButtonChecked(hwnd, IDC_NOAPPLICK);
break;
+ case IDC_NOMOUSEREP:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_mouse_rep =
+ IsDlgButtonChecked(hwnd, IDC_NOMOUSEREP);
+ break;
+ case IDC_NORESIZE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_remote_resize =
+ IsDlgButtonChecked(hwnd, IDC_NORESIZE);
+ break;
+ case IDC_NOALTSCREEN:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_alt_screen =
+ IsDlgButtonChecked(hwnd, IDC_NOALTSCREEN);
+ break;
+ case IDC_NOWINTITLE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_remote_wintitle =
+ IsDlgButtonChecked(hwnd, IDC_NOWINTITLE);
+ break;
+ case IDC_NODBACKSPACE:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_dbackspace =
+ IsDlgButtonChecked(hwnd, IDC_NODBACKSPACE);
+ break;
+ case IDC_NOCHARSET:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED)
+ cfg.no_remote_charset =
+ IsDlgButtonChecked(hwnd, IDC_NOCHARSET);
+ break;
case IDC_ALTF4:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
GetDlgItemText(hwnd, IDC_TTEDIT, cfg.termtype,
sizeof(cfg.termtype) - 1);
break;
+
+ /* proxy config */
+ case IDC_PROXYHOSTEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText(hwnd, IDC_PROXYHOSTEDIT, cfg.proxy_host,
+ sizeof(cfg.proxy_host) - 1);
+ break;
+ case IDC_PROXYPORTEDIT:
+ if (HIWORD(wParam) == EN_CHANGE) {
+ GetDlgItemText(hwnd, IDC_PROXYPORTEDIT, portname, 31);
+ if (isdigit(portname[0]))
+ MyGetDlgItemInt(hwnd, IDC_PROXYPORTEDIT, &cfg.proxy_port);
+ else {
+ service = getservbyname(portname, NULL);
+ if (service)
+ cfg.proxy_port = ntohs(service->s_port);
+ else
+ cfg.proxy_port = 0;
+ }
+ }
+ break;
+ case IDC_PROXYEXCLUDEEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText(hwnd, IDC_PROXYEXCLUDEEDIT,
+ cfg.proxy_exclude_list,
+ sizeof(cfg.proxy_exclude_list) - 1);
+ break;
+ case IDC_PROXYUSEREDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText(hwnd, IDC_PROXYUSEREDIT,
+ cfg.proxy_username,
+ sizeof(cfg.proxy_username) - 1);
+ break;
+ case IDC_PROXYPASSEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText(hwnd, IDC_PROXYPASSEDIT,
+ cfg.proxy_password,
+ sizeof(cfg.proxy_password) - 1);
+ break;
+ case IDC_PROXYTELNETCMDEDIT:
+ if (HIWORD(wParam) == EN_CHANGE)
+ GetDlgItemText(hwnd, IDC_PROXYTELNETCMDEDIT,
+ cfg.proxy_telnet_command,
+ sizeof(cfg.proxy_telnet_command) - 1);
+ break;
+ case IDC_PROXYSOCKSVER5:
+ case IDC_PROXYSOCKSVER4:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ cfg.proxy_socks_version =
+ IsDlgButtonChecked(hwnd, IDC_PROXYSOCKSVER4) ? 4 : 5;
+ }
+ break;
+ case IDC_PROXYTYPENONE:
+ case IDC_PROXYTYPEHTTP:
+ case IDC_PROXYTYPESOCKS:
+ case IDC_PROXYTYPETELNET:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ cfg.proxy_type =
+ IsDlgButtonChecked(hwnd, IDC_PROXYTYPEHTTP) ? PROXY_HTTP :
+ IsDlgButtonChecked(hwnd, IDC_PROXYTYPESOCKS) ? PROXY_SOCKS :
+ IsDlgButtonChecked(hwnd, IDC_PROXYTYPETELNET) ? PROXY_TELNET :
+ PROXY_NONE;
+ }
+ break;
+
case IDC_LGFEDIT:
if (HIWORD(wParam) == EN_CHANGE)
GetDlgItemText(hwnd, IDC_LGFEDIT, cfg.logfilename,
cfg.ssh_cipherlist, CIPHER_MAX,
0, hwnd, wParam, lParam);
break;
+ case IDC_SSHPROT1ONLY:
case IDC_SSHPROT1:
case IDC_SSHPROT2:
+ case IDC_SSHPROT2ONLY:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
+ if (IsDlgButtonChecked(hwnd, IDC_SSHPROT1ONLY))
+ cfg.sshprot = 0;
if (IsDlgButtonChecked(hwnd, IDC_SSHPROT1))
cfg.sshprot = 1;
else if (IsDlgButtonChecked(hwnd, IDC_SSHPROT2))
cfg.sshprot = 2;
+ else if (IsDlgButtonChecked(hwnd, IDC_SSHPROT2ONLY))
+ cfg.sshprot = 3;
}
break;
case IDC_AUTHTIS:
of.lStructSize = sizeof(of);
#endif
of.hwndOwner = hwnd;
- of.lpstrFilter = "All Files\0*\0\0\0";
+ of.lpstrFilter = "PuTTY Private Key Files\0*.PPK\0"
+ "AllFiles\0*\0\0\0";
of.lpstrCustomFilter = NULL;
of.nFilterIndex = 1;
of.lpstrFile = filename;
SetDlgItemText(hwnd, IDC_CODEPAGE, cfg.line_codepage);
}
break;
+ case IDC_PRINTER:
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
+ int index = SendDlgItemMessage(hwnd, IDC_PRINTER,
+ CB_GETCURSEL, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_PRINTER, CB_GETLBTEXT,
+ index, (LPARAM)cfg.printer);
+ } else if (HIWORD(wParam) == CBN_EDITCHANGE) {
+ GetDlgItemText(hwnd, IDC_PRINTER, cfg.printer,
+ sizeof(cfg.printer) - 1);
+ }
+ if (!strcmp(cfg.printer, PRINTER_DISABLED_STRING))
+ *cfg.printer = '\0';
+ break;
case IDC_CAPSLOCKCYR:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED) {
if (mbret == IDYES)
store_host_key(host, port, keytype, keystr);
if (mbret == IDCANCEL)
- exit(0);
+ cleanup_exit(0);
}
if (ret == 1) { /* key was absent */
int mbret;
if (mbret == IDYES)
store_host_key(host, port, keytype, keystr);
if (mbret == IDCANCEL)
- exit(0);
+ cleanup_exit(0);
}
}
if (mbret == IDYES)
return;
else
- exit(0);
+ cleanup_exit(0);
}
/*