1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-12 18:13:50 -05:00

Implement dlg_end().

[originally from svn r3059]
This commit is contained in:
Ben Harris 2003-04-05 15:01:16 +00:00
parent 000edf3233
commit 277ca3a397
3 changed files with 19 additions and 2 deletions

View File

@ -71,6 +71,7 @@ union macctrl;
struct macctrls {
WindowPtr window;
void (*end)(WindowPtr, int);
tree234 *byctrl;
void *data; /* private data for config box */
unsigned int npanels;

View File

@ -1,4 +1,4 @@
/* $Id: macctrls.c,v 1.24 2003/04/03 23:18:06 ben Exp $ */
/* $Id: macctrls.c,v 1.25 2003/04/05 15:01:16 ben Exp $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
@ -1092,7 +1092,10 @@ void dlg_error_msg(void *dlg, char *msg)
void dlg_end(void *dlg, int value)
{
struct macctrls *mcs = dlg;
if (mcs->end != NULL)
(*mcs->end)(mcs->window, value);
};
void dlg_refresh(union control *ctrl, void *dlg)

View File

@ -1,4 +1,4 @@
/* $Id: macdlg.c,v 1.17 2003/03/29 23:07:55 ben Exp $ */
/* $Id: macdlg.c,v 1.18 2003/04/05 15:01:16 ben Exp $ */
/*
* Copyright (c) 2002 Ben Harris
* All rights reserved.
@ -47,6 +47,7 @@
#include "storage.h"
static void mac_closedlg(WindowPtr);
static void mac_enddlg(WindowPtr, int);
void mac_newsession(void)
{
@ -69,6 +70,7 @@ void mac_newsession(void)
setup_config_box(s->ctrlbox, &sesslist, FALSE, 0);
s->settings_ctrls.data = &s->cfg;
s->settings_ctrls.end = &mac_enddlg;
macctrl_layoutbox(s->ctrlbox, s->settings_window, &s->settings_ctrls);
wi = snew(WinInfo);
@ -96,6 +98,17 @@ static void mac_closedlg(WindowPtr window)
sfree(s);
}
static void mac_enddlg(WindowPtr window, int value)
{
Session *s = mac_windowsession(window);
if (value == 0)
mac_closedlg(window);
else {
mac_startsession(s);
mac_closedlg(window);
}
}
void mac_dupsession(void)
{