From 88f39730dd7b2615ab78dbc53f7218a2a15787e0 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 18 Feb 2004 07:30:06 +0000 Subject: add image_set slot. 2004-02-17 Chris Toshok * gui/contact-list-editor/e-contact-list-editor.h (struct _EContactListEditor): add image_set slot. * gui/contact-list-editor/e-contact-list-editor.c (list_image_changed_cb): set image_set = TRUE. (e_contact_list_editor_init): init image_set = FALSE (extract_info): only set the LOGO attribute if image_set = TRUE. * gui/contact-editor/e-contact-editor.h (struct _EContactEditor): add image_set slot. * gui/contact-editor/e-contact-editor.c (extract_info): only set the PHOTO attribute if image_set == TRUE. (image_chooser_changed): new function, set image_set = TRUE and call widget_changed. (e_contact_editor_init): init image_set to FALSE. (_address_arrow_pressed): quiet compiler. svn path=/trunk/; revision=24771 --- addressbook/gui/contact-list-editor/e-contact-list-editor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'addressbook/gui/contact-list-editor/e-contact-list-editor.c') diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index c8df169c70..84b6a769ea 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -9,7 +9,7 @@ * * 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 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public @@ -220,6 +220,7 @@ e_contact_list_editor_init (EContactListEditor *editor) editor->contact = NULL; editor->changed = FALSE; + editor->image_set = FALSE; editor->editable = TRUE; editor->in_async_call = FALSE; editor->is_new_list = FALSE; @@ -775,6 +776,7 @@ list_name_changed_cb (GtkWidget *w, EContactListEditor *editor) static void list_image_changed_cb (GtkWidget *w, EContactListEditor *editor) { + editor->image_set = TRUE; editor->changed = TRUE; command_state_changed (editor); } @@ -970,9 +972,10 @@ extract_info(EContactListEditor *editor) g_list_foreach (email_list, (GFunc) g_free, NULL); g_list_free (email_list); - if (e_image_chooser_get_image_data (E_IMAGE_CHOOSER (editor->list_image), - &image_data, - &image_data_len)) { + if (editor->image_set + && e_image_chooser_get_image_data (E_IMAGE_CHOOSER (editor->list_image), + &image_data, + &image_data_len)) { EContactPhoto photo; photo.data = image_data; -- cgit v1.2.3