aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-popup.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-08-03 11:09:35 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-08-03 11:09:35 +0800
commit5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6 (patch)
treea7bd3df4d06e8bd33f148b6f47209c76a9ae4021 /addressbook/gui/component/select-names/e-select-names-popup.c
parent7fe5d849e52dced4b5dfd5289e59d87e2d092f6c (diff)
downloadgsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.tar
gsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.tar.gz
gsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.tar.bz2
gsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.tar.lz
gsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.tar.xz
gsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.tar.zst
gsoc2013-evolution-5b11f6dc1de45412cdfb5aded38b20f1d8bb8ce6.zip
Add camel dependency.
2001-08-02 Jon Trowbridge <trow@ximian.com> * printing/Makefile.am (ecpsdir): Add camel dependency. * gui/component/Makefile.am: Add camel dependency. * backend/ebook/Makefile.am: Add camel dependency. * gui/component/addressbook-factory.c (main): Properly init camel. * backend/ebook/e-destination.c (e_destination_clear_strings): Clear ->raw. (e_destination_is_empty): We aren't empty if ->raw is set.. (e_destination_set_raw): Replaces e_destination_set_string. (e_destination_get_name): Use camel's parser to extract the name from ->raw. (e_destination_get_email): Use camel's parser to extract the email address from ->raw. (e_destination_get_address): Use camel to produce properly quoted, RFC-compliant addresses. Thanks camel! (Bug #5860) * gui/component/select-names/e-select-names-completion.c (emailify_match): Always append an e-mail address, as long as it doesn't have one already at it's beginning or end. Don't limit self to just emailifying entries tied to cards with multiple addresses. (I didn't really want to do this, but people seem to like keeping multiple cards for the same person, and other solutions (like scanning all matches for duplicate names, and only emailifying those) just seemed like way too much work for such a limited payoff.) * gui/component/select-names/e-select-names-text-model.c: s/e_destination_set_string/e_destination_set_raw/. * gui/component/select-names/e-select-names-popup.c (popup_menu_card): Quote _'s in our popup menus, so that "foo_bar" doesn't get displayed as "foobar" w/ the 'b' underlined. (Bug #5558) (popup_menu_nocard): Ditto. 2001-08-02 Jon Trowbridge <trow@ximian.com> * Makefile.am: Added camel dependency (now needed by ebook). 2001-08-02 Jon Trowbridge <trow@ximian.com> * gui/Makefile.am: Added camel dependency (now needed by ebook). 2001-08-02 Jon Trowbridge <trow@ximian.com> * Makefile.am: Added camel dependency (now needed by ebook). svn path=/trunk/; revision=11602
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-popup.c')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-popup.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-popup.c b/addressbook/gui/component/select-names/e-select-names-popup.c
index c4cb57533d..61de3a3c1f 100644
--- a/addressbook/gui/component/select-names/e-select-names-popup.c
+++ b/addressbook/gui/component/select-names/e-select-names-popup.c
@@ -205,6 +205,40 @@ init_html_mail (GnomeUIInfo *uiinfo, PopupInfo *info)
}
+/* Duplicate the string, mapping _ to __. This is to make sure that underscores in
+ e-mail addresses don't get mistaken for keyboard accelerators. */
+static gchar *
+quote_label (const gchar *str)
+{
+ gint len = str ? strlen (str) : -1;
+ const gchar *c = str;
+ gchar *d, *q;
+
+ if (len < 0)
+ return NULL;
+
+ while (*c) {
+ if (*c == '_')
+ ++len;
+ ++c;
+ }
+
+ q = g_new (gchar, len+1);
+ c = str;
+ d = q;
+ while (*c) {
+ *d = *c;
+ if (*c == '_') {
+ ++d;
+ *d = '_';
+ }
+ ++c;
+ ++d;
+ }
+ *d = '\0';
+ return q;
+}
+
#define ARBITRARY_UIINFO_LIMIT 64
static GtkWidget *
popup_menu_card (PopupInfo *info)
@@ -217,6 +251,7 @@ popup_menu_card (PopupInfo *info)
GtkWidget *pop;
EIterator *iterator;
gint html_toggle;
+ gchar *name_label;
/*
* Build up our GnomeUIInfo array.
@@ -228,7 +263,8 @@ popup_menu_card (PopupInfo *info)
card = e_destination_get_card (info->dest);
uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = (gchar *) e_destination_get_name (info->dest);
+ name_label = quote_label (e_destination_get_name (info->dest));
+ uiinfo[i].label = name_label;
++i;
uiinfo[i].type = GNOME_APP_UI_SEPARATOR;
@@ -301,6 +337,8 @@ popup_menu_card (PopupInfo *info)
init_html_mail (&(uiinfo[html_toggle]), info);
+ g_free (name_label);
+
return pop;
}
@@ -318,16 +356,20 @@ popup_menu_nocard (PopupInfo *info)
gint i=0;
GtkWidget *pop;
const gchar *str;
+ gchar *name_label;
gint html_toggle;
memset (uiinfo, 0, sizeof (uiinfo));
str = e_destination_get_name (info->dest);
if (str == NULL)
+ str = e_destination_get_email (info->dest);
+ if (str == NULL)
str = _("Unnamed Contact");
+ name_label = quote_label (str);
uiinfo[i].type = GNOME_APP_UI_ITEM;
- uiinfo[i].label = (gchar *) str;
+ uiinfo[i].label = name_label;
++i;
uiinfo[i].type = GNOME_APP_UI_SEPARATOR;
@@ -354,6 +396,8 @@ popup_menu_nocard (PopupInfo *info)
init_html_mail (&(uiinfo[html_toggle]), info);
+ g_free (name_label);
+
return pop;
}