aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-account-gui.c
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-31 07:17:48 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-31 07:17:48 +0800
commit495a7e6a3c57aa86c0be011331bb20a505c96a58 (patch)
tree6ff09438bd749a7abfa00a0f5beaec5cff8d7ac2 /mail/mail-account-gui.c
parent05e3d8bbb943cdf3ede6768071b795b3da405659 (diff)
downloadgsoc2013-evolution-495a7e6a3c57aa86c0be011331bb20a505c96a58.tar.gz
gsoc2013-evolution-495a7e6a3c57aa86c0be011331bb20a505c96a58.tar.zst
gsoc2013-evolution-495a7e6a3c57aa86c0be011331bb20a505c96a58.zip
add delete_event_handler. (menu_file_save_close_cb): add save and close
2001-10-30 Larry Ewing <lewing@ximian.com> * mail-account-gui.c (delete_event_cb): add delete_event_handler. (menu_file_save_close_cb): add save and close command. (launch_signature_editor): initial the editor as having changed and attach the delete event handler. svn path=/trunk/; revision=14499
Diffstat (limited to 'mail/mail-account-gui.c')
-rw-r--r--mail/mail-account-gui.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index ef16de0ba3..3445b5cd60 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -1052,6 +1052,12 @@ do_exit (ESignatureEditor *editor)
destroy_editor (editor);
}
+static int
+delete_event_cb (GtkWidget *w, GdkEvent *event, ESignatureEditor *editor)
+{
+ do_exit (editor);
+}
+
static void
menu_file_close_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
{
@@ -1061,11 +1067,23 @@ menu_file_close_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
do_exit (editor);
}
+static void
+menu_file_save_close_cb (BonoboUIComponent *uic, gpointer data, const gchar *path)
+{
+ ESignatureEditor *editor;
+
+ editor = E_SIGNATURE_EDITOR (data);
+
+ menu_file_save_cb (uic, editor, path);
+ destroy_editor (editor);
+}
+
static BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("FileSave", menu_file_save_cb),
- BONOBO_UI_VERB ("FileClose", menu_file_close_cb),
-
+ BONOBO_UI_VERB ("FileSave", menu_file_save_cb),
+ BONOBO_UI_VERB ("FileClose", menu_file_close_cb),
+ BONOBO_UI_VERB ("FileSaveClose", menu_file_save_close_cb),
+
BONOBO_UI_VERB_END
};
@@ -1133,7 +1151,8 @@ launch_signature_editor (MailAccountGui *gui, const gchar *filename, gboolean ht
editor->html = html;
editor->filename = g_strdup (filename);
-
+ editor->has_changed = TRUE;
+
title = g_strdup_printf ("Edit %ssignature (%s)", html ? "HTML " : "", filename);
editor->win = bonobo_window_new ("e-sig-editor", title);
editor->gui = gui;
@@ -1161,7 +1180,10 @@ launch_signature_editor (MailAccountGui *gui, const gchar *filename, gboolean ht
}
load_signature (editor);
-
+
+ gtk_signal_connect (GTK_OBJECT (editor->win), "delete_event",
+ GTK_SIGNAL_FUNC (delete_event_cb), editor);
+
bonobo_window_set_contents (BONOBO_WINDOW (editor->win), editor->control);
bonobo_widget_set_property (BONOBO_WIDGET (editor->control), "FormatHTML", html, NULL);
gtk_widget_show (GTK_WIDGET (editor->win));