mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-27 02:02:26 +00:00
Stop throwing out the Connection panel during midsession reconfig.
Instead, only throw out the useless parts of it. See, the new auto- layout features bear fruit immediately! [originally from svn r685]
This commit is contained in:
parent
942d7f0533
commit
0129f94d1c
31
windlg.c
31
windlg.c
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#define NPANELS 9
|
#define NPANELS 9
|
||||||
#define MAIN_NPANELS 9
|
#define MAIN_NPANELS 9
|
||||||
#define RECONF_NPANELS 6
|
#define RECONF_NPANELS 7
|
||||||
|
|
||||||
static char **events = NULL;
|
static char **events = NULL;
|
||||||
static int nevents = 0, negsize = 0;
|
static int nevents = 0, negsize = 0;
|
||||||
@ -822,6 +822,7 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
|||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Accelerators used: [aco] dehlnprstwx */
|
/* Accelerators used: [aco] dehlnprstwx */
|
||||||
ctlposinit(&cp, hwnd);
|
ctlposinit(&cp, hwnd);
|
||||||
|
if (wParam == 0) {
|
||||||
multiedit(&cp,
|
multiedit(&cp,
|
||||||
"Host &Name", IDC_HOSTSTATIC, IDC_HOST, 75,
|
"Host &Name", IDC_HOSTSTATIC, IDC_HOST, 75,
|
||||||
"&Port", IDC_PORTSTATIC, IDC_PORT, 25, NULL);
|
"&Port", IDC_PORTSTATIC, IDC_PORT, 25, NULL);
|
||||||
@ -846,6 +847,7 @@ static int CALLBACK ConnectionProc (HWND hwnd, UINT msg,
|
|||||||
"&Load", IDC_SESSLOAD,
|
"&Load", IDC_SESSLOAD,
|
||||||
"&Save", IDC_SESSSAVE,
|
"&Save", IDC_SESSSAVE,
|
||||||
"&Delete", IDC_SESSDEL, NULL);
|
"&Delete", IDC_SESSDEL, NULL);
|
||||||
|
}
|
||||||
checkbox(&cp, "Close Window on E&xit", IDC_CLOSEEXIT);
|
checkbox(&cp, "Close Window on E&xit", IDC_CLOSEEXIT);
|
||||||
checkbox(&cp, "&Warn on Close", IDC_CLOSEWARN);
|
checkbox(&cp, "&Warn on Close", IDC_CLOSEWARN);
|
||||||
|
|
||||||
@ -1300,6 +1302,7 @@ static int CALLBACK WindowProc (HWND hwnd, UINT msg,
|
|||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Accelerators used: [aco] bikty */
|
/* Accelerators used: [aco] bikty */
|
||||||
ctlposinit(&cp, hwnd);
|
ctlposinit(&cp, hwnd);
|
||||||
|
if (wParam == 0)
|
||||||
multiedit(&cp,
|
multiedit(&cp,
|
||||||
"Initial window &title:", IDC_WINTITLE, IDC_WINEDIT, 100,
|
"Initial window &title:", IDC_WINTITLE, IDC_WINEDIT, 100,
|
||||||
NULL);
|
NULL);
|
||||||
@ -1375,6 +1378,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
|||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Accelerators used: [aco] bdflrstuv */
|
/* Accelerators used: [aco] bdflrstuv */
|
||||||
ctlposinit(&cp, hwnd);
|
ctlposinit(&cp, hwnd);
|
||||||
|
if (wParam == 0) {
|
||||||
staticedit(&cp, "Terminal-&type string", IDC_TTSTATIC, IDC_TTEDIT);
|
staticedit(&cp, "Terminal-&type string", IDC_TTSTATIC, IDC_TTEDIT);
|
||||||
staticedit(&cp, "Terminal-&speed string", IDC_TSSTATIC, IDC_TSEDIT);
|
staticedit(&cp, "Terminal-&speed string", IDC_TSSTATIC, IDC_TSEDIT);
|
||||||
staticedit(&cp, "Auto-login &username", IDC_LOGSTATIC, IDC_LOGEDIT);
|
staticedit(&cp, "Auto-login &username", IDC_LOGSTATIC, IDC_LOGEDIT);
|
||||||
@ -1386,6 +1390,7 @@ static int CALLBACK TelnetProc (HWND hwnd, UINT msg,
|
|||||||
radioline(&cp, "Handling of OLD_ENVIRON ambiguity:", IDC_EMSTATIC, 2,
|
radioline(&cp, "Handling of OLD_ENVIRON ambiguity:", IDC_EMSTATIC, 2,
|
||||||
"&BSD (commonplace)", IDC_EMBSD,
|
"&BSD (commonplace)", IDC_EMBSD,
|
||||||
"R&FC 1408 (unusual)", IDC_EMRFC, NULL);
|
"R&FC 1408 (unusual)", IDC_EMRFC, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
|
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
|
||||||
SetDlgItemText (hwnd, IDC_TSEDIT, cfg.termspeed);
|
SetDlgItemText (hwnd, IDC_TSEDIT, cfg.termspeed);
|
||||||
@ -1528,6 +1533,7 @@ static int CALLBACK SshProc (HWND hwnd, UINT msg,
|
|||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
/* Accelerators used: [aco] 123abdkmprtuw */
|
/* Accelerators used: [aco] 123abdkmprtuw */
|
||||||
ctlposinit(&cp, hwnd);
|
ctlposinit(&cp, hwnd);
|
||||||
|
if (wParam == 0) {
|
||||||
staticedit(&cp, "Terminal-&type string", IDC_TTSTATIC, IDC_TTEDIT);
|
staticedit(&cp, "Terminal-&type string", IDC_TTSTATIC, IDC_TTEDIT);
|
||||||
staticedit(&cp, "Auto-login &username", IDC_LOGSTATIC, IDC_LOGEDIT);
|
staticedit(&cp, "Auto-login &username", IDC_LOGSTATIC, IDC_LOGEDIT);
|
||||||
multiedit(&cp,
|
multiedit(&cp,
|
||||||
@ -1546,6 +1552,7 @@ static int CALLBACK SshProc (HWND hwnd, UINT msg,
|
|||||||
"&3DES", IDC_CIPHER3DES,
|
"&3DES", IDC_CIPHER3DES,
|
||||||
"&Blowfish", IDC_CIPHERBLOWF,
|
"&Blowfish", IDC_CIPHERBLOWF,
|
||||||
"&DES", IDC_CIPHERDES, NULL);
|
"&DES", IDC_CIPHERDES, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
|
SetDlgItemText (hwnd, IDC_TTEDIT, cfg.termtype);
|
||||||
SetDlgItemText (hwnd, IDC_LOGEDIT, cfg.username);
|
SetDlgItemText (hwnd, IDC_LOGEDIT, cfg.username);
|
||||||
@ -1959,9 +1966,10 @@ static char *names[NPANELS] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int mainp[MAIN_NPANELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8};
|
static int mainp[MAIN_NPANELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||||
static int reconfp[RECONF_NPANELS] = { 1, 2, 3, 6, 7, 8};
|
static int reconfp[RECONF_NPANELS] = { 0, 1, 2, 3, 6, 7, 8};
|
||||||
|
|
||||||
static HWND makesubdialog(HWND hwnd, int x, int y, int w, int h, int n) {
|
static HWND makesubdialog(HWND hwnd, int x, int y, int w, int h,
|
||||||
|
int n, int dlgtype) {
|
||||||
RECT r;
|
RECT r;
|
||||||
HWND ret;
|
HWND ret;
|
||||||
WPARAM font;
|
WPARAM font;
|
||||||
@ -1978,13 +1986,14 @@ static HWND makesubdialog(HWND hwnd, int x, int y, int w, int h, int n) {
|
|||||||
SetWindowLong (ret, DWL_DLGPROC, (LONG)panelproc[n]);
|
SetWindowLong (ret, DWL_DLGPROC, (LONG)panelproc[n]);
|
||||||
font = SendMessage(hwnd, WM_GETFONT, 0, 0);
|
font = SendMessage(hwnd, WM_GETFONT, 0, 0);
|
||||||
SendMessage (ret, WM_SETFONT, font, MAKELPARAM(0, 0));
|
SendMessage (ret, WM_SETFONT, font, MAKELPARAM(0, 0));
|
||||||
SendMessage (ret, WM_INITDIALOG, 0, 0);
|
SendMessage (ret, WM_INITDIALOG, dlgtype, 0);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam,
|
WPARAM wParam, LPARAM lParam,
|
||||||
int npanels, int *panelnums, HWND *page) {
|
int npanels, int dlgtype,
|
||||||
|
int *panelnums, HWND *page) {
|
||||||
HWND hw, tabctl;
|
HWND hw, tabctl;
|
||||||
|
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
@ -2039,7 +2048,7 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
|||||||
}
|
}
|
||||||
SendDlgItemMessage(hwnd, IDC_TABLIST, CB_SETCURSEL, 0, 0);
|
SendDlgItemMessage(hwnd, IDC_TABLIST, CB_SETCURSEL, 0, 0);
|
||||||
}
|
}
|
||||||
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[0]);
|
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[0], dlgtype);
|
||||||
SetFocus (*page);
|
SetFocus (*page);
|
||||||
return 0;
|
return 0;
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
@ -2048,7 +2057,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
|||||||
int i = TabCtrl_GetCurSel(((LPNMHDR)lParam)->hwndFrom);
|
int i = TabCtrl_GetCurSel(((LPNMHDR)lParam)->hwndFrom);
|
||||||
if (*page)
|
if (*page)
|
||||||
DestroyWindow (*page);
|
DestroyWindow (*page);
|
||||||
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[i]);
|
*page = makesubdialog(hwnd, 6, 30, 168, 163,
|
||||||
|
panelnums[i], dlgtype);
|
||||||
SetFocus (((LPNMHDR)lParam)->hwndFrom); /* ensure focus stays */
|
SetFocus (((LPNMHDR)lParam)->hwndFrom); /* ensure focus stays */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2061,7 +2071,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg,
|
|||||||
int i = SendMessage (tablist, CB_GETCURSEL, 0, 0);
|
int i = SendMessage (tablist, CB_GETCURSEL, 0, 0);
|
||||||
if (*page)
|
if (*page)
|
||||||
DestroyWindow (*page);
|
DestroyWindow (*page);
|
||||||
*page = makesubdialog(hwnd, 6, 30, 168, 163, panelnums[i]);
|
*page = makesubdialog(hwnd, 6, 30, 168, 163,
|
||||||
|
panelnums[i], dlgtype);
|
||||||
SetFocus(tablist); /* ensure focus stays */
|
SetFocus(tablist); /* ensure focus stays */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -2104,14 +2115,14 @@ static int CALLBACK MainDlgProc (HWND hwnd, UINT msg,
|
|||||||
SetActiveWindow(hwnd);
|
SetActiveWindow(hwnd);
|
||||||
}
|
}
|
||||||
return GenericMainDlgProc (hwnd, msg, wParam, lParam,
|
return GenericMainDlgProc (hwnd, msg, wParam, lParam,
|
||||||
MAIN_NPANELS, mainp, &page);
|
MAIN_NPANELS, 0, mainp, &page);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
|
static int CALLBACK ReconfDlgProc (HWND hwnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam) {
|
WPARAM wParam, LPARAM lParam) {
|
||||||
static HWND page;
|
static HWND page;
|
||||||
return GenericMainDlgProc (hwnd, msg, wParam, lParam,
|
return GenericMainDlgProc (hwnd, msg, wParam, lParam,
|
||||||
RECONF_NPANELS, reconfp, &page);
|
RECONF_NPANELS, 1, reconfp, &page);
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_config (void) {
|
int do_config (void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user