1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 18:07:59 +00:00

Move initialisation of the saved session box outside init_dlg_ctrls() so

that you don't end up with twice as many items after clicking Load

[originally from svn r697]
This commit is contained in:
Simon Tatham 2000-10-10 08:33:49 +00:00
parent a453e02987
commit ef5965e430

View File

@ -1047,9 +1047,6 @@ static void init_dlg_ctrls(HWND hwnd) {
SetDlgItemText (hwnd, IDC_HOST, cfg.host); SetDlgItemText (hwnd, IDC_HOST, cfg.host);
SetDlgItemText (hwnd, IDC_SESSEDIT, savedsession); SetDlgItemText (hwnd, IDC_SESSEDIT, savedsession);
SetDlgItemInt (hwnd, IDC_PORT, cfg.port, FALSE); SetDlgItemInt (hwnd, IDC_PORT, cfg.port, FALSE);
for (i = 0; i < nsessions; i++)
SendDlgItemMessage (hwnd, IDC_SESSLIST, LB_ADDSTRING,
0, (LPARAM) (sessions[i]));
CheckRadioButton (hwnd, IDC_PROTRAW, IDC_PROTSSH, CheckRadioButton (hwnd, IDC_PROTRAW, IDC_PROTSSH,
cfg.protocol==PROT_SSH ? IDC_PROTSSH : cfg.protocol==PROT_SSH ? IDC_PROTSSH :
cfg.protocol==PROT_TELNET ? IDC_PROTTELNET : IDC_PROTRAW ); cfg.protocol==PROT_TELNET ? IDC_PROTTELNET : IDC_PROTRAW );
@ -1585,6 +1582,9 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
} }
init_dlg_ctrls(hwnd); init_dlg_ctrls(hwnd);
for (i = 0; i < nsessions; i++)
SendDlgItemMessage (hwnd, IDC_SESSLIST, LB_ADDSTRING,
0, (LPARAM) (sessions[i]));
/* /*
* Hide all the controls to start with. * Hide all the controls to start with.