From 052f07e466e1f69b8c14bc1bbbe8a1df7e38cccc Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 10 Oct 2000 08:33:49 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.tartarus.org/sgt/putty@697 cda61777-01e9-0310-a592-d414129be87e --- windlg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/windlg.c b/windlg.c index 8ada1f48..57a444b3 100644 --- a/windlg.c +++ b/windlg.c @@ -1047,9 +1047,6 @@ static void init_dlg_ctrls(HWND hwnd) { SetDlgItemText (hwnd, IDC_HOST, cfg.host); SetDlgItemText (hwnd, IDC_SESSEDIT, savedsession); 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, cfg.protocol==PROT_SSH ? IDC_PROTSSH : cfg.protocol==PROT_TELNET ? IDC_PROTTELNET : IDC_PROTRAW ); @@ -1585,6 +1582,9 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, } 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. -- 2.11.0