#include <commdlg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <ctype.h>
#include "ssh.h"
#include "putty.h"
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,
IDC_SESSSAVE,
IDC_SESSDEL,
IDC_CLOSEEXIT,
+ IDC_COEALWAYS,
+ IDC_COENEVER,
+ IDC_COENORMAL,
sessionpanelend,
loggingpanelstart,
CheckDlgButton (hwnd, IDC_BLINKCUR, cfg.blink_cur);
CheckDlgButton (hwnd, IDC_SCROLLBAR, cfg.scrollbar);
CheckDlgButton (hwnd, IDC_LOCKSIZE, cfg.locksize);
- CheckDlgButton (hwnd, IDC_CLOSEEXIT, cfg.close_on_exit);
+ CheckRadioButton (hwnd, IDC_COEALWAYS, IDC_COENORMAL,
+ cfg.close_on_exit==COE_NORMAL ? IDC_COENORMAL :
+ cfg.close_on_exit==COE_NEVER ? IDC_COENEVER : IDC_COEALWAYS);
CheckDlgButton (hwnd, IDC_CLOSEWARN, cfg.warn_on_close);
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
*/
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 w */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Basic options for your PuTTY session",
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
endbox(&cp);
}
beginbox(&cp, NULL, IDC_BOX_SESSION3);
- checkbox(&cp, "Close Window on E&xit", IDC_CLOSEEXIT);
+ radioline(&cp, "Close &window on exit:", IDC_CLOSEEXIT, 4,
+ "Always", IDC_COEALWAYS,
+ "Never", IDC_COENEVER,
+ "Only on clean exit", IDC_COENORMAL, NULL);
endbox(&cp);
}
if (panel == loggingpanelstart) {
- /* The Logging panel. Accelerators used: [acgo] lpt */
+ /* The Logging panel. Accelerators used: [acgo] tplfw */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Options controlling session logging",
}
if (panel == terminalpanelstart) {
- /* The Terminal panel. Accelerators used: [acgo] &dflbentuw */
+ /* The Terminal panel. Accelerators used: [acgo] wdlben ht */
struct ctlpos cp;
ctlposinit(&cp, hwnd, 80, 3, 13);
bartitle(&cp, "Options controlling the terminal emulation",
beginbox(&cp, "Line discipline options",
IDC_BOX_TERMINAL2);
- radioline(&cp, "Local echo:", IDC_ECHOSTATIC, 3,
- "A&uto", IDC_ECHOBACKEND,
+ radioline(&cp, "Local ec&ho:", IDC_ECHOSTATIC, 3,
+ "Auto", IDC_ECHOBACKEND,
"Force on", IDC_ECHOYES,
"Force off", IDC_ECHONO, NULL);
- radioline(&cp, "Local line editing:", IDC_EDITSTATIC, 3,
- "Au&to", IDC_EDITBACKEND,
+ 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",
}
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",
"&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);
}
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",
}
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",
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);
}
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",
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);
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) {
}
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) {
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);
"&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);
}
GetDlgItemText (hwnd, IDC_WINEDIT, cfg.wintitle,
sizeof(cfg.wintitle)-1);
break;
- case IDC_CLOSEEXIT:
- if (HIWORD(wParam) == BN_CLICKED ||
- HIWORD(wParam) == BN_DOUBLECLICKED)
- cfg.close_on_exit = IsDlgButtonChecked (hwnd, IDC_CLOSEEXIT);
- break;
+ case IDC_COEALWAYS:
+ case IDC_COENEVER:
+ case IDC_COENORMAL:
+ if (HIWORD(wParam) == BN_CLICKED ||
+ HIWORD(wParam) == BN_DOUBLECLICKED) {
+ cfg.close_on_exit = IsDlgButtonChecked (hwnd, IDC_COEALWAYS) ? COE_ALWAYS :
+ IsDlgButtonChecked (hwnd, IDC_COENEVER) ? COE_NEVER :
+ COE_NORMAL;
+ }
+ break;
case IDC_CLOSEWARN:
if (HIWORD(wParam) == BN_CLICKED ||
HIWORD(wParam) == BN_DOUBLECLICKED)
static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
- static HWND page = NULL;
-
if (msg == WM_COMMAND && LOWORD(wParam) == IDOK) {
}
if (msg == WM_COMMAND && LOWORD(wParam) == IDCX_ABOUT) {
static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam) {
- static HWND page;
return GenericMainDlgProc (hwnd, msg, wParam, lParam, 1);
}