aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-hdrs.c
diff options
context:
space:
mode:
authorJason Leach <jasonleach@usa.net>2001-01-26 03:35:54 +0800
committerJacob Leach <jleach@src.gnome.org>2001-01-26 03:35:54 +0800
commit024435f8ccbc749533474c882627680145649a4c (patch)
treec766fcebd81c22db378c3e10798485c1d571b45d /composer/e-msg-composer-hdrs.c
parent593f0036f8dfa204eb0d70c6ad5b5243ee2b49a7 (diff)
downloadgsoc2013-evolution-024435f8ccbc749533474c882627680145649a4c.tar.gz
gsoc2013-evolution-024435f8ccbc749533474c882627680145649a4c.tar.zst
gsoc2013-evolution-024435f8ccbc749533474c882627680145649a4c.zip
(Moving the flag for has_changed from the Hdrs to the Composer itself.
2001-01-25 Jason Leach <jasonleach@usa.net> (Moving the flag for has_changed from the Hdrs to the Composer itself. Providing public methods to set/unset a composer as changed. Adding attachments now flags the composer as changed) * e-msg-composer.c (e_msg_composer_unset_changed): New function. (e_msg_composer_set_changed): New function. * e-msg-composer.c (hdrs_changed_cb): Callback to the new signal, uses the new composer_set_changed. (attachment_bar_changed_cb): Add a call to the new _set_changed. * e-msg-composer-hdrs.c (class_init): New signal "hdrs_changed" to tell the parent composer that any of the headers have changed. (addressbook_entry_changed): emit the new signal here. (entry_changed): And here. svn path=/trunk/; revision=7818
Diffstat (limited to 'composer/e-msg-composer-hdrs.c')
-rw-r--r--composer/e-msg-composer-hdrs.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 4228bd5f4c..1ac061ed82 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -68,6 +68,7 @@ static GtkTableClass *parent_class = NULL;
enum {
SHOW_ADDRESS_DIALOG,
SUBJECT_CHANGED,
+ HDRS_CHANGED,
LAST_SIGNAL
};
@@ -209,7 +210,7 @@ addressbook_entry_changed (BonoboListener *listener,
{
EMsgComposerHdrs *hdrs = E_MSG_COMPOSER_HDRS (user_data);
- hdrs->has_changed = TRUE;
+ gtk_signal_emit (GTK_OBJECT (hdrs), signals[HDRS_CHANGED]);
}
static GtkWidget *
@@ -262,14 +263,13 @@ entry_changed (GtkWidget *entry, EMsgComposerHdrs *hdrs)
gchar *tmp;
gchar *subject;
- /* Mark the composer as changed so it prompts to save on close */
- hdrs->has_changed = TRUE;
-
tmp = e_msg_composer_hdrs_get_subject (hdrs);
subject = e_utf8_to_gtk_string (GTK_WIDGET (entry), tmp);
gtk_signal_emit (GTK_OBJECT (hdrs), signals[SUBJECT_CHANGED], subject);
g_free (tmp);
+
+ gtk_signal_emit (GTK_OBJECT (hdrs), signals[HDRS_CHANGED]);
}
static GtkWidget *
@@ -448,6 +448,15 @@ class_init (EMsgComposerHdrsClass *class)
GTK_TYPE_NONE,
1, GTK_TYPE_STRING);
+ signals[HDRS_CHANGED] =
+ gtk_signal_new ("hdrs_changed",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EMsgComposerHdrsClass,
+ hdrs_changed),
+ gtk_marshal_NONE__NONE,
+ GTK_TYPE_NONE, 0);
+
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
@@ -475,8 +484,6 @@ init (EMsgComposerHdrs *hdrs)
hdrs->priv = priv;
hdrs->account = NULL;
-
- hdrs->has_changed = FALSE;
}