From bc20187dc0782187ccedec5edd9c744ce652a803 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Tue, 16 Jul 2002 20:05:02 +0000 Subject: Instead of doing this with a weakref, do it by connecting to the destroy 2002-07-16 Peter Williams * e-msg-composer.c (create_composer): Instead of doing this with a weakref, do it by connecting to the destroy signal. The weakref was not getting notified in certain conditions that I could never really pin down, and this caused problems at exit. * e-msg-composer-hdrs.c (create_headers): Reorder to create reply_to before from, because create_from_optionmenu causes from_changed to be called, which expects reply_to.entry to exist. svn path=/trunk/; revision=17480 --- composer/ChangeLog | 11 +++++++++++ composer/e-msg-composer-hdrs.c | 16 ++++++++++------ composer/e-msg-composer.c | 6 +++--- 3 files changed, 24 insertions(+), 9 deletions(-) (limited to 'composer') diff --git a/composer/ChangeLog b/composer/ChangeLog index 28e5b175a0..a19f850fbc 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,14 @@ +2002-07-16 Peter Williams + + * e-msg-composer.c (create_composer): Instead of doing this with a + weakref, do it by connecting to the destroy signal. The weakref was + not getting notified in certain conditions that I could never really + pin down, and this caused problems at exit. + + * e-msg-composer-hdrs.c (create_headers): Reorder to create reply_to + before from, because create_from_optionmenu causes from_changed to + be called, which expects reply_to.entry to exist. + 2002-07-15 Radek Doulik * e-msg-composer.c (build_message): added save_html_object_data diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index a39fd806c6..d98b452cff 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -364,14 +364,12 @@ create_headers (EMsgComposerHdrs *hdrs) { EMsgComposerHdrsPrivate *priv = hdrs->priv; - /* - * From: - */ - priv->from.label = gtk_label_new (_("From:")); - priv->from.entry = create_from_optionmenu (hdrs); - /* * Reply-To: + * + * Create this before we call create_from_optionmenu, + * because that causes from_changed to be called, which + * expects the reply_to fields to be initialized. */ priv->reply_to.label = gtk_label_new (_("Reply-To:")); priv->reply_to.entry = e_entry_new (); @@ -381,6 +379,12 @@ create_headers (EMsgComposerHdrs *hdrs) "allow_newlines", FALSE, NULL); + /* + * From: + */ + priv->from.label = gtk_label_new (_("From:")); + priv->from.entry = create_from_optionmenu (hdrs); + /* * Subject: */ diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 769d8afbbd..f0ec802c7e 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2695,9 +2695,9 @@ create_composer (void) all_composers = g_slist_prepend (all_composers, composer); - gtk_object_weakref (GTK_OBJECT (composer), - msg_composer_destroy_notify, - composer); + gtk_signal_connect (GTK_OBJECT (composer), "destroy", + GTK_SIGNAL_FUNC (msg_composer_destroy_notify), + NULL); gtk_window_set_default_size (GTK_WINDOW (composer), DEFAULT_WIDTH, DEFAULT_HEIGHT); -- cgit v1.2.3