mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Implement Warn On Close.
[originally from svn r3099]
This commit is contained in:
parent
ed46f3aa53
commit
8e3c37d309
@ -2269,6 +2269,19 @@ static int string_width(char *text)
|
|||||||
return req.width;
|
return req.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int reallyclose(void *frontend)
|
||||||
|
{
|
||||||
|
char *title = dupcat(appname, " Exit Confirmation", NULL);
|
||||||
|
int ret = messagebox(GTK_WIDGET(get_window(frontend)),
|
||||||
|
title, "Are you sure you want to close this session?",
|
||||||
|
string_width("Most of the width of the above text"),
|
||||||
|
"Yes", 'y', +1, 1,
|
||||||
|
"No", 'n', -1, 0,
|
||||||
|
NULL);
|
||||||
|
sfree(title);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
|
void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
|
||||||
char *keystr, char *fingerprint)
|
char *keystr, char *fingerprint)
|
||||||
{
|
{
|
||||||
|
@ -349,10 +349,11 @@ char *get_window_title(void *frontend, int icon)
|
|||||||
|
|
||||||
gint delete_window(GtkWidget *widget, GdkEvent *event, gpointer data)
|
gint delete_window(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||||
{
|
{
|
||||||
/*
|
struct gui_data *inst = (struct gui_data *)data;
|
||||||
* We could implement warn-on-close here if we really wanted
|
if (inst->cfg.warn_on_close) {
|
||||||
* to.
|
if (!reallyclose(inst->term))
|
||||||
*/
|
return TRUE;
|
||||||
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ void about_box(void *window);
|
|||||||
void *eventlogstuff_new(void);
|
void *eventlogstuff_new(void);
|
||||||
void showeventlog(void *estuff, void *parentwin);
|
void showeventlog(void *estuff, void *parentwin);
|
||||||
void logevent_dlg(void *estuff, char *string);
|
void logevent_dlg(void *estuff, char *string);
|
||||||
|
int reallyclose(void *frontend);
|
||||||
|
|
||||||
/* Things pterm.c needs from {ptermm,uxputty}.c */
|
/* Things pterm.c needs from {ptermm,uxputty}.c */
|
||||||
char *make_default_wintitle(char *hostname);
|
char *make_default_wintitle(char *hostname);
|
||||||
|
Loading…
Reference in New Issue
Block a user