diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-02-06 23:24:00 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-02-06 23:24:00 +0800 |
commit | 2350726ebb24246a691acd2ced3a760150593cbb (patch) | |
tree | 7204702694124b2343439d6f52105040e8d61b31 /composer | |
parent | 3ffbfb9523a24f9c7330905837da27447a3b7c49 (diff) | |
download | gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.tar gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.tar.gz gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.tar.bz2 gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.tar.lz gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.tar.xz gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.tar.zst gsoc2013-evolution-2350726ebb24246a691acd2ced3a760150593cbb.zip |
Set the default argument to
2001-02-06 Christopher James Lahey <clahey@ximian.com>
* e-msg-composer-hdrs.c (address_button_clicked_cb, add_header):
Set the default argument to
GNOME_Evolution_Addressbook_SelectNames_activateDialog correctly.
svn path=/trunk/; revision=8018
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 6 | ||||
-rw-r--r-- | composer/e-msg-composer-hdrs.c | 43 |
2 files changed, 42 insertions, 7 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index a6c25bccd7..2d8f902b48 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2001-02-06 Christopher James Lahey <clahey@ximian.com> + + * e-msg-composer-hdrs.c (address_button_clicked_cb, add_header): + Set the default argument to + GNOME_Evolution_Addressbook_SelectNames_activateDialog correctly. + 2001-01-30 Larry Ewing <lewing@ximian.com> * e-msg-composer-hdrs.c (create_optionmenu): make sure we convert diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index 436ae39cb4..147b5ffbde 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -108,22 +108,49 @@ setup_corba (EMsgComposerHdrs *hdrs) return TRUE; } - +typedef struct { + EMsgComposerHdrs *hdrs; + char *string; +} EMsgComposerHdrsAndString; + +static void +e_msg_composer_hdrs_and_string_free(EMsgComposerHdrsAndString *emchas) +{ + if (emchas->hdrs) + gtk_object_unref(GTK_OBJECT(emchas->hdrs)); + g_free(emchas->string); +} + +static EMsgComposerHdrsAndString * +e_msg_composer_hdrs_and_string_create(EMsgComposerHdrs *hdrs, const char *string) +{ + EMsgComposerHdrsAndString *emchas; + + emchas = g_new(EMsgComposerHdrsAndString, 1); + emchas->hdrs = hdrs; + emchas->string = g_strdup(string); + if (emchas->hdrs) + gtk_object_ref(GTK_OBJECT(emchas->hdrs)); + + return emchas; +} + static void address_button_clicked_cb (GtkButton *button, gpointer data) { + EMsgComposerHdrsAndString *emchas; EMsgComposerHdrs *hdrs; EMsgComposerHdrsPrivate *priv; CORBA_Environment ev; - hdrs = E_MSG_COMPOSER_HDRS (data); + emchas = data; + hdrs = emchas->hdrs; priv = hdrs->priv; CORBA_exception_init (&ev); - /* FIXME: Section ID */ - GNOME_Evolution_Addressbook_SelectNames_activateDialog (priv->corba_select_names, "", &ev); + GNOME_Evolution_Addressbook_SelectNames_activateDialog (priv->corba_select_names, emchas->string, &ev); CORBA_exception_free (&ev); } @@ -293,9 +320,11 @@ add_header (EMsgComposerHdrs *hdrs, if (type == HEADER_ADDRBOOK) { label = gtk_button_new_with_label (name); GTK_OBJECT_UNSET_FLAGS (label, GTK_CAN_FOCUS); - gtk_signal_connect (GTK_OBJECT (label), "clicked", - GTK_SIGNAL_FUNC (address_button_clicked_cb), - hdrs); + gtk_signal_connect_full (GTK_OBJECT (label), "clicked", + GTK_SIGNAL_FUNC (address_button_clicked_cb), NULL, + e_msg_composer_hdrs_and_string_create(hdrs, name), + (GtkDestroyNotify) e_msg_composer_hdrs_and_string_free, + FALSE, FALSE); pad = 2; gtk_tooltips_set_tip (hdrs->priv->tooltips, label, _("Click here for the address book"), |