From c0a255eb90769638d57ae4122932f75c46e4e531 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 11 Sep 2008 15:34:29 +0000 Subject: Merge revisions 36016:36303 from trunk. svn path=/branches/kill-bonobo/; revision=36307 --- composer/e-composer-name-header.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'composer/e-composer-name-header.c') diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index 829fc5b22b..70a126b1e0 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -1,20 +1,21 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * - * This library is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU Lesser General Public - * License as published by the Free Software Foundation. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. + * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * License along with the program; if not, see + * + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * */ #include "e-composer-name-header.h" -- cgit v1.2.3 From 7986af5369482c4feeaad6880045bf92a4d3f744 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 13 Feb 2009 04:32:51 +0000 Subject: Let the mail module handle composer "Post To:" button clicks, since EMFolderSelector and EMFolderTree are off-limits to the composer. This further weakens the composer's mail module dependency. Add class methods to EComposerHeader for "changed" and "clicked" signals. Allows subclasses to implement them without connecting to their own signals. svn path=/branches/kill-bonobo/; revision=37260 --- composer/e-composer-name-header.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'composer/e-composer-name-header.c') diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index 70a126b1e0..1b5acc19d5 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -46,18 +46,6 @@ struct _EComposerNameHeaderPrivate { static gpointer parent_class; -static void -composer_name_header_clicked_cb (EComposerNameHeader *header) -{ - ENameSelectorDialog *dialog; - - dialog = e_name_selector_peek_dialog (header->priv->name_selector); - e_name_selector_dialog_set_destination_index ( - dialog, header->priv->destination_index); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_hide (GTK_WIDGET (dialog)); -} - static void composer_name_header_entry_changed_cb (ENameSelectorEntry *entry, EComposerNameHeader *header) @@ -130,10 +118,6 @@ composer_name_header_constructor (GType type, NULL); E_COMPOSER_HEADER (object)->input_widget = g_object_ref_sink (entry); - g_signal_connect ( - object, "clicked", - G_CALLBACK (composer_name_header_clicked_cb), NULL); - return object; } @@ -191,10 +175,26 @@ composer_name_header_dispose (GObject *object) G_OBJECT_CLASS (parent_class)->dispose (object); } +static void +composer_name_header_clicked (EComposerHeader *header) +{ + EComposerNameHeaderPrivate *priv; + ENameSelectorDialog *dialog; + + priv = E_COMPOSER_NAME_HEADER_GET_PRIVATE (header); + + dialog = e_name_selector_peek_dialog (priv->name_selector); + e_name_selector_dialog_set_destination_index ( + dialog, priv->destination_index); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_hide (GTK_WIDGET (dialog)); +} + static void composer_name_header_class_init (EComposerNameHeaderClass *class) { GObjectClass *object_class; + EComposerHeaderClass *header_class; parent_class = g_type_class_peek_parent (class); g_type_class_add_private (class, sizeof (EComposerNameHeaderPrivate)); @@ -205,6 +205,9 @@ composer_name_header_class_init (EComposerNameHeaderClass *class) object_class->get_property = composer_name_header_get_property; object_class->dispose = composer_name_header_dispose; + header_class = E_COMPOSER_HEADER_CLASS (class); + header_class->clicked = composer_name_header_clicked; + g_object_class_install_property ( object_class, PROP_NAME_SELECTOR, -- cgit v1.2.3 From 5893a146f20f364042410aa7d8cd45f8194ae745 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 16 May 2009 17:19:51 -0400 Subject: =?UTF-8?q?Bug=20582744=20=E2=80=93=20CC=20field=20autofill=20does?= =?UTF-8?q?n't=20work=20for=20replies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer/e-composer-name-header.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'composer/e-composer-name-header.c') diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index 1b5acc19d5..a6618fdb4a 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -297,6 +297,27 @@ e_composer_name_header_get_destinations (EComposerNameHeader *header) return destinations; /* free with e_destination_freev() */ } +void +e_composer_name_header_add_destinations (EComposerNameHeader *header, + EDestination **destinations) +{ + EDestinationStore *store; + ENameSelectorEntry *entry; + gint ii; + + g_return_if_fail (E_IS_COMPOSER_NAME_HEADER (header)); + + entry = E_COMPOSER_NAME_HEADER_GET_ENTRY (header); + store = e_name_selector_entry_peek_destination_store (entry); + + if (destinations == NULL) + return; + + for (ii = 0; destinations[ii] != NULL; ii++) + e_destination_store_append_destination ( + store, destinations[ii]); +} + void e_composer_name_header_set_destinations (EComposerNameHeader *header, EDestination **destinations) @@ -304,7 +325,6 @@ e_composer_name_header_set_destinations (EComposerNameHeader *header, EDestinationStore *store; ENameSelectorEntry *entry; GList *list, *iter; - gint ii; g_return_if_fail (E_IS_COMPOSER_NAME_HEADER (header)); @@ -317,10 +337,5 @@ e_composer_name_header_set_destinations (EComposerNameHeader *header, e_destination_store_remove_destination (store, iter->data); g_list_free (list); - if (destinations == NULL) - return; - - for (ii = 0; destinations[ii] != NULL; ii++) - e_destination_store_append_destination ( - store, destinations[ii]); + e_composer_name_header_add_destinations (header, destinations); } -- cgit v1.2.3 From c0b6183c73fc170913bba39e65794af3f596e30e Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 22 May 2009 17:00:53 +0530 Subject: Johnny's composer changes for Anjal. --- composer/e-composer-name-header.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'composer/e-composer-name-header.c') diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index a6618fdb4a..1f9fc9fe8d 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -105,10 +105,12 @@ composer_name_header_constructor (GType type, entry = E_NAME_SELECTOR_ENTRY ( e_name_selector_peek_section_list ( priv->name_selector, label)); + e_name_selector_entry_set_contact_editor_func ( entry, e_contact_editor_new); e_name_selector_entry_set_contact_list_editor_func ( entry, e_contact_list_editor_new); + g_signal_connect ( entry, "changed", G_CALLBACK (composer_name_header_entry_changed_cb), object); @@ -264,6 +266,32 @@ e_composer_name_header_new (const gchar *label, "button", TRUE, "name-selector", name_selector, NULL); } +EComposerHeader * +e_composer_name_header_new_with_label (const gchar *label, + ENameSelector *name_selector) +{ + return g_object_new ( + E_TYPE_COMPOSER_NAME_HEADER, "label", label, + "button", FALSE, "name-selector", name_selector, + "addaction", FALSE, "visible", TRUE, + NULL); +} + +EComposerHeader * +e_composer_name_header_new_with_action (const gchar *label, + const gchar *action_label, + ENameSelector *name_selector) +{ + g_return_val_if_fail (E_IS_NAME_SELECTOR (name_selector), NULL); + + return g_object_new ( + E_TYPE_COMPOSER_NAME_HEADER, "label", label, + "button", FALSE, "name-selector", name_selector, + "addaction_text", action_label, + "addaction", action_label != NULL, + NULL); +} + ENameSelector * e_composer_name_header_get_name_selector (EComposerNameHeader *header) { -- cgit v1.2.3 From e4afd3f9fb962ea1295a0657ec9f83a427829171 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 May 2009 23:21:02 -0400 Subject: Remove trailing whitespace, again. --- composer/e-composer-name-header.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'composer/e-composer-name-header.c') diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c index ed4e60c6f9..bfc9441fb7 100644 --- a/composer/e-composer-name-header.c +++ b/composer/e-composer-name-header.c @@ -11,7 +11,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see + * License along with the program; if not, see * * * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) @@ -282,7 +282,7 @@ e_composer_name_header_new_with_action (const gchar *label, return g_object_new ( E_TYPE_COMPOSER_NAME_HEADER, "label", label, - "button", TRUE, "name-selector", name_selector, + "button", TRUE, "name-selector", name_selector, "addaction_text", action_label, "addaction", action_label != NULL, NULL); } -- cgit v1.2.3