aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c20
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.h3
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c11
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.h3
4 files changed, 28 insertions, 9 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;
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;
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
index f9293116b6..574f9a5b55 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.h
@@ -68,6 +68,9 @@ struct _EContactListEditor
/* Whether we are editing a new contact or an existing one */
guint is_new_list : 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;