1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-17 02:57:33 -05:00

Implemented Change Settings under Unix. We are gradually getting there.

[originally from svn r3092]
This commit is contained in:
Simon Tatham
2003-04-10 18:00:50 +00:00
parent f03cf02cc8
commit 2e1503e520
5 changed files with 269 additions and 153 deletions

View File

@ -256,8 +256,12 @@ static void sessionsaver_handler(union control *ctrl, void *dlg,
* allocate space to store the current contents of the saved
* session edit box (since it must persist even when we switch
* panels, but is not part of the Config).
*
* Of course, this doesn't need to be done mid-session.
*/
if (!dlg_get_privdata(ssd->editbox, dlg)) {
if (!ssd->editbox) {
savedsession = NULL;
} else if (!dlg_get_privdata(ssd->editbox, dlg)) {
savedsession = (char *)
dlg_alloc_privdata(ssd->editbox, dlg, SAVEDSESSION_LEN);
savedsession[0] = '\0';
@ -333,6 +337,11 @@ static void sessionsaver_handler(union control *ctrl, void *dlg,
dlg_refresh(ssd->listbox, dlg);
}
} else if (ctrl == ssd->okbutton) {
if (!savedsession) {
/* In a mid-session Change Settings, Apply is always OK. */
dlg_end(dlg, 1);
return;
}
/*
* Annoying special case. If the `Open' button is
* pressed while no host name is currently set, _and_
@ -730,6 +739,7 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
ssd = (struct sessionsaver_data *)
ctrl_alloc(b, sizeof(struct sessionsaver_data));
memset(ssd, 0, sizeof(*ssd));
ssd->sesslist = (midsession ? NULL : sesslist);
/*