aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-02-18 15:30:06 +0800
committerChris Toshok <toshok@src.gnome.org>2004-02-18 15:30:06 +0800
commit88f39730dd7b2615ab78dbc53f7218a2a15787e0 (patch)
tree7715bb0ac99d7320566ce1bef958af26bfd22c53 /addressbook/gui/contact-editor
parent6e0ff07291e87dcd216aa2d39e33857ea5b45088 (diff)
downloadgsoc2013-evolution-88f39730dd7b2615ab78dbc53f7218a2a15787e0.tar.gz
gsoc2013-evolution-88f39730dd7b2615ab78dbc53f7218a2a15787e0.tar.zst
gsoc2013-evolution-88f39730dd7b2615ab78dbc53f7218a2a15787e0.zip
add image_set slot.
2004-02-17 Chris Toshok <toshok@ximian.com> * 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
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c20
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.h3
2 files changed, 18 insertions, 5 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 0e60e5dea5..07e5ffd30e 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -1207,6 +1207,14 @@ company_entry_changed (GtkWidget *widget, EContactEditor *editor)
}
static void
+image_chooser_changed (GtkWidget *widget, EContactEditor *editor)
+{
+ editor->image_set = TRUE;
+
+ widget_changed (widget, editor);
+}
+
+static void
field_changed (GtkWidget *widget, EContactEditor *editor)
{
if (!editor->changed) {
@@ -1334,7 +1342,7 @@ set_entry_changed_signals(EContactEditor *editor)
widget = glade_xml_get_widget (editor->gui, "image-chooser");
if (widget && E_IS_IMAGE_CHOOSER (widget)) {
g_signal_connect (widget, "changed",
- G_CALLBACK (widget_changed), editor);
+ G_CALLBACK (image_chooser_changed), editor);
}
}
@@ -1952,6 +1960,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
e_contact_editor->contact = NULL;
e_contact_editor->changed = FALSE;
+ e_contact_editor->image_set = FALSE;
e_contact_editor->in_async_call = FALSE;
e_contact_editor->source_editable = TRUE;
e_contact_editor->target_editable = TRUE;
@@ -2640,7 +2649,7 @@ _address_arrow_pressed (GtkWidget *widget, GdkEventButton *button, EContactEdito
EContactAddress *address = e_contact_get (editor->contact, i);
gboolean checked;
- checked = address;
+ checked = (address != NULL);
gtk_check_menu_item_set_active (
GTK_CHECK_MENU_ITEM (editor->address_info [i - E_CONTACT_FIRST_ADDRESS_ID].widget),
checked);
@@ -3372,9 +3381,10 @@ extract_info(EContactEditor *editor)
char *image_data;
gsize image_data_len;
- if (e_image_chooser_get_image_data (E_IMAGE_CHOOSER (widget),
- &image_data,
- &image_data_len)) {
+ if (editor->image_set
+ && e_image_chooser_get_image_data (E_IMAGE_CHOOSER (widget),
+ &image_data,
+ &image_data_len)) {
EContactPhoto photo;
photo.data = image_data;
diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h
index 069cc7d0cc..220e2cf421 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.h
+++ b/addressbook/gui/contact-editor/e-contact-editor.h
@@ -89,6 +89,9 @@ struct _EContactEditor
/* Whether we are editing a new contact or an existing one */
guint is_new_contact : 1;
+ /* Whether the image chooser widget has been changed. */
+ guint image_set : 1;
+
/* Whether the contact has been changed since bringing up the contact editor */
guint changed : 1;