mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-20 04:28:07 -05:00
Saved-session name box now persists over panel switches
[originally from svn r610]
This commit is contained in:
parent
60b9871947
commit
c320531909
10
windlg.c
10
windlg.c
@ -508,6 +508,8 @@ static int GeneralPanelProc (HWND hwnd, UINT msg,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char savedsession[2048];
|
||||||
|
|
||||||
static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam) {
|
WPARAM wParam, LPARAM lParam) {
|
||||||
int i;
|
int i;
|
||||||
@ -515,6 +517,7 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
|||||||
switch (msg) {
|
switch (msg) {
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
SetDlgItemText (hwnd, IDC0_HOST, cfg.host);
|
SetDlgItemText (hwnd, IDC0_HOST, cfg.host);
|
||||||
|
SetDlgItemText (hwnd, IDC0_SESSEDIT, savedsession);
|
||||||
SetDlgItemInt (hwnd, IDC0_PORT, cfg.port, FALSE);
|
SetDlgItemInt (hwnd, IDC0_PORT, cfg.port, FALSE);
|
||||||
for (i = 0; i < nsessions; i++)
|
for (i = 0; i < nsessions; i++)
|
||||||
SendDlgItemMessage (hwnd, IDC0_SESSLIST, LB_ADDSTRING,
|
SendDlgItemMessage (hwnd, IDC0_SESSLIST, LB_ADDSTRING,
|
||||||
@ -571,9 +574,13 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
|||||||
cfg.warn_on_close = IsDlgButtonChecked (hwnd, IDC0_CLOSEWARN);
|
cfg.warn_on_close = IsDlgButtonChecked (hwnd, IDC0_CLOSEWARN);
|
||||||
break;
|
break;
|
||||||
case IDC0_SESSEDIT:
|
case IDC0_SESSEDIT:
|
||||||
if (HIWORD(wParam) == EN_CHANGE)
|
if (HIWORD(wParam) == EN_CHANGE) {
|
||||||
SendDlgItemMessage (hwnd, IDC0_SESSLIST, LB_SETCURSEL,
|
SendDlgItemMessage (hwnd, IDC0_SESSLIST, LB_SETCURSEL,
|
||||||
(WPARAM) -1, 0);
|
(WPARAM) -1, 0);
|
||||||
|
GetDlgItemText (hwnd, IDC0_SESSEDIT,
|
||||||
|
savedsession, sizeof(savedsession)-1);
|
||||||
|
savedsession[sizeof(savedsession)-1] = '\0';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case IDC0_SESSSAVE:
|
case IDC0_SESSSAVE:
|
||||||
if (HIWORD(wParam) == BN_CLICKED ||
|
if (HIWORD(wParam) == BN_CLICKED ||
|
||||||
@ -1528,6 +1535,7 @@ int do_config (void) {
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
get_sesslist(TRUE);
|
get_sesslist(TRUE);
|
||||||
|
savedsession[0] = '\0';
|
||||||
ret = DialogBox (hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL, MainDlgProc);
|
ret = DialogBox (hinst, MAKEINTRESOURCE(IDD_MAINBOX), NULL, MainDlgProc);
|
||||||
get_sesslist(FALSE);
|
get_sesslist(FALSE);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user