diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-04-22 03:00:23 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-04-22 03:00:23 +0800 |
commit | 247a808a5bde5b7c9ea05d2966e47c927f347ccf (patch) | |
tree | 061865f6e501f5f6c2d9e6d8c88ba15c31c13dda /addressbook/gui/contact-editor | |
parent | d1eb29bd2e34264ae1b722ef7746bbbe8145beaa (diff) | |
download | gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.tar gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.tar.gz gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.tar.bz2 gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.tar.lz gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.tar.xz gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.tar.zst gsoc2013-evolution-247a808a5bde5b7c9ea05d2966e47c927f347ccf.zip |
Properly convert to utf8. (Bug #2256) (build_quick_add_dialog): Properly
2001-04-21 Jon Trowbridge <trow@ximian.com>
* contact-editor/e-contact-quick-add.c (clicked_cb): Properly
convert to utf8. (Bug #2256)
(build_quick_add_dialog): Properly convert from utf8. (Bug #2256)
svn path=/trunk/; revision=9485
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 0ab39701d3..f9556f6758 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -36,6 +36,7 @@ #include <libgnomeui/gnome-app.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-stock.h> +#include <gal/widgets/e-unicode.h> #include <addressbook/backend/ebook/e-book.h> #include <addressbook/backend/ebook/e-book-util.h> #include <addressbook/backend/ebook/e-card.h> @@ -179,10 +180,19 @@ clicked_cb (GtkWidget *w, gint button, gpointer user_data) name_entry = gtk_object_get_data (GTK_OBJECT (card), "e-contact-quick-add-name-entry"); email_entry = gtk_object_get_data (GTK_OBJECT (card), "e-contact-quick-add-email-entry"); - if (name_entry) - name = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1); - if (email_entry) - email = gtk_editable_get_chars (GTK_EDITABLE (email_entry), 0, -1); + if (name_entry) { + gchar *tmp; + tmp = gtk_editable_get_chars (GTK_EDITABLE (name_entry), 0, -1); + name = e_utf8_from_gtk_string (name_entry, tmp); + g_free (tmp); + } + + if (email_entry) { + gchar *tmp; + tmp = gtk_editable_get_chars (GTK_EDITABLE (email_entry), 0, -1); + email = e_utf8_from_gtk_string (email_entry, tmp); + g_free (tmp); + } e_card_quick_set_name (card, name); e_card_quick_set_email (card, email); @@ -235,8 +245,10 @@ build_quick_add_dialog (ECard *new_card, EContactQuickAddCallback cb, gpointer u if (new_card->name) { gchar *str = e_card_name_to_string (new_card->name); - gtk_entry_set_text (GTK_ENTRY (name_entry), str); + gchar *s2 = e_utf8_to_gtk_string (name_entry, str); + gtk_entry_set_text (GTK_ENTRY (name_entry), s2); g_free (str); + g_free (s2); } @@ -248,7 +260,9 @@ build_quick_add_dialog (ECard *new_card, EContactQuickAddCallback cb, gpointer u e_iterator_reset (iterator); if (e_iterator_is_valid (iterator)) { const gchar *str = e_iterator_get (iterator); - gtk_entry_set_text (GTK_ENTRY (email_entry), str); + gchar *s2 = e_utf8_to_gtk_string (email_entry, str); + gtk_entry_set_text (GTK_ENTRY (email_entry), s2); + g_free (s2); } } } |