diff options
author | Chris Toshok <toshok@ximian.com> | 2003-03-24 08:22:42 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-03-24 08:22:42 +0800 |
commit | e72b58b2450931ae9e694a41eb4a73fe8706e1f8 (patch) | |
tree | 8b2b174f8506199db6c0f87f892f2b29bca39c27 | |
parent | b88d0715276fd4e57540232b9abe0efbfe691044 (diff) | |
download | gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.tar gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.tar.gz gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.tar.bz2 gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.tar.lz gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.tar.xz gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.tar.zst gsoc2013-evolution-e72b58b2450931ae9e694a41eb4a73fe8706e1f8.zip |
[ fixes bug #40026 ] add EContactEditor arg, and block/unblock signals
2003-03-23 Chris Toshok <toshok@ximian.com>
[ fixes bug #40026 ]
* gui/contact-editor/e-contact-editor.c (set_field): add
EContactEditor arg, and block/unblock signals around the
gtk_entry_set_text, since that generates a "changed" signal which
causes problems.
(set_phone_field): take and pass along an EContactEditor arg.
(set_fields): pass editor to set_field.
svn path=/trunk/; revision=20474
-rw-r--r-- | addressbook/ChangeLog | 10 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 25 |
2 files changed, 26 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 670b6b74b1..4ee5f49a45 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,15 @@ 2003-03-23 Chris Toshok <toshok@ximian.com> + [ fixes bug #40026 ] + * gui/contact-editor/e-contact-editor.c (set_field): add + EContactEditor arg, and block/unblock signals around the + gtk_entry_set_text, since that generates a "changed" signal which + causes problems. + (set_phone_field): take and pass along an EContactEditor arg. + (set_fields): pass editor to set_field. + +2003-03-23 Chris Toshok <toshok@ximian.com> + * gui/contact-editor/arrow.png: nuke. * gui/contact-editor/Makefile.am (EXTRA_DIST): remove images_DATA diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index bfe09c729f..a51b066ad7 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -1956,19 +1956,26 @@ find_address_mailing (EContactEditor *editor) } static void -set_field(GtkEntry *entry, const char *string) +set_field(EContactEditor *editor, GtkEntry *entry, const char *string) { const char *oldstring = gtk_entry_get_text(entry); if (!string) string = ""; - if (strcmp(string, oldstring)) + if (strcmp(string, oldstring)) { + g_signal_handlers_block_matched (entry, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, editor); gtk_entry_set_text(entry, string); + g_signal_handlers_unblock_matched (entry, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, editor); + } } static void -set_phone_field(GtkWidget *entry, const ECardPhone *phone) +set_phone_field(EContactEditor *editor, GtkWidget *entry, const ECardPhone *phone) { - set_field(GTK_ENTRY(entry), phone ? phone->number : ""); + set_field(editor, GTK_ENTRY(entry), phone ? phone->number : ""); } static void @@ -1980,23 +1987,23 @@ set_fields(EContactEditor *editor) entry = glade_xml_get_widget(editor->gui, "entry-phone1"); if (entry && GTK_IS_ENTRY(entry)) - set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[0])); + set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[0])); entry = glade_xml_get_widget(editor->gui, "entry-phone2"); if (entry && GTK_IS_ENTRY(entry)) - set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[1])); + set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[1])); entry = glade_xml_get_widget(editor->gui, "entry-phone3"); if (entry && GTK_IS_ENTRY(entry)) - set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[2])); + set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[2])); entry = glade_xml_get_widget(editor->gui, "entry-phone4"); if (entry && GTK_IS_ENTRY(entry)) - set_phone_field(entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[3])); + set_phone_field(editor, entry, e_card_simple_get_phone(editor->simple, editor->phone_choice[3])); entry = glade_xml_get_widget(editor->gui, "entry-email1"); if (entry && GTK_IS_ENTRY(entry)) - set_field(GTK_ENTRY(entry), e_card_simple_get_email(editor->simple, editor->email_choice)); + set_field(editor, GTK_ENTRY(entry), e_card_simple_get_email(editor->simple, editor->email_choice)); |