aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog9
-rw-r--r--composer/e-msg-composer-hdrs.c14
-rw-r--r--composer/e-msg-composer-hdrs.h2
-rw-r--r--composer/e-msg-composer.c36
4 files changed, 44 insertions, 17 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 14a55ab116..cb0434ec1e 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,12 @@
+2001-01-03 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * e-msg-composer.c (do_exit): If the headers have changed, then
+ continue with the prompt else just destroy the window.
+
+ * e-msg-composer-hdrs.c (init): Initialize has_changed to FALSE.
+ (entry_changed): New callback to set the value of has_changed.
+ (add_header): Attach the "changed" signal.
+
2001-01-02 Dan Winship <danw@helixcode.com>
* e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 8ea0ea5d4e..edd8ff6803 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -215,6 +215,13 @@ create_addressbook_entry (EMsgComposerHdrs *hdrs,
return control_widget;
}
+static void
+entry_changed (GtkWidget *entry, EMsgComposerHdrs *hdrs)
+{
+ /* Set the has_changed var to TRUE */
+ hdrs->has_changed = TRUE;
+}
+
static GtkWidget *
add_header (EMsgComposerHdrs *hdrs,
const gchar *name,
@@ -275,6 +282,9 @@ add_header (EMsgComposerHdrs *hdrs,
2, 2);
gtk_tooltips_set_tip (hdrs->priv->tooltips, entry, tip, tip_private);
+
+ gtk_signal_connect (GTK_OBJECT (entry), "changed",
+ GTK_SIGNAL_FUNC (entry_changed), hdrs);
}
priv->num_hdrs++;
@@ -386,8 +396,10 @@ init (EMsgComposerHdrs *hdrs)
priv->tooltips = gtk_tooltips_new ();
priv->num_hdrs = 0;
-
+
hdrs->priv = priv;
+
+ hdrs->has_changed = FALSE;
}
diff --git a/composer/e-msg-composer-hdrs.h b/composer/e-msg-composer-hdrs.h
index a495fd853c..a343fb0b7d 100644
--- a/composer/e-msg-composer-hdrs.h
+++ b/composer/e-msg-composer-hdrs.h
@@ -47,6 +47,8 @@ struct _EMsgComposerHdrs {
GtkTable parent;
EMsgComposerHdrsPrivate *priv;
+
+ gboolean has_changed;
};
struct _EMsgComposerHdrsClass {
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index a494fce920..e53b3a8c64 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -737,20 +737,24 @@ do_exit (EMsgComposer *composer)
GtkWidget *label;
gint button;
- dialog = gnome_dialog_new (_("Evolution"),
- GNOME_STOCK_BUTTON_YES, /* Save */
- GNOME_STOCK_BUTTON_NO, /* Don't save */
- GNOME_STOCK_BUTTON_CANCEL, /* Cancel */
- NULL);
-
- label = gtk_label_new (_("This message has not been sent.\n\nDo you wish to save your changes?"));
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0);
- gtk_widget_show (label);
- gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (composer));
- gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
- button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- exit_dialog_cb (button, composer);
+ if (E_MSG_COMPOSER_HDRS (composer->hdrs)->has_changed) {
+ dialog = gnome_dialog_new (_("Evolution"),
+ GNOME_STOCK_BUTTON_YES, /* Save */
+ GNOME_STOCK_BUTTON_NO, /* Don't save */
+ GNOME_STOCK_BUTTON_CANCEL, /* Cancel */
+ NULL);
+
+ label = gtk_label_new (_("This message has not been sent.\n\nDo you wish to save your changes?"));
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0);
+ gtk_widget_show (label);
+ gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (composer));
+ gnome_dialog_set_default (GNOME_DIALOG (dialog), 0);
+ button = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+
+ exit_dialog_cb (button, composer);
+ } else {
+ gtk_widget_destroy (GTK_WIDGET (composer));
+ }
}
/* Menu callbacks. */
@@ -1406,8 +1410,8 @@ e_msg_composer_construct (EMsgComposer *composer)
/* Set focus on the `To:' field.
gtk_widget_grab_focus (e_msg_composer_hdrs_get_to_entry (E_MSG_COMPOSER_HDRS (composer->hdrs)));
- GTK_WIDGET_SET_FLAGS (composer->editor, GTK_CAN_FOCUS);
- gtk_window_set_focus (GTK_WINDOW (composer), composer->editor); */
+ GTK_WIDGET_SET_FLAGS (composer->editor, GTK_CAN_FOCUS);
+ gtk_window_set_focus (GTK_WINDOW (composer), composer->editor); */
gtk_widget_grab_focus (composer->editor);
}