Removed attempts to use Radek's evil <DATA> hacks, which were just causing

2001-04-23  Jon Trowbridge  <trow@ximian.com>

        * e-html-utils.c (e_text_to_html_full): Removed attempts to use
        Radek's evil <DATA> hacks, which were just causing me
        (and GtkHTML) grief.

2001-04-23  Jon Trowbridge  <trow@ximian.com>

        * gui/component/e-address-popup.c: Lots of code has been
        simplified here.
        (e_address_popup_factory_new_control): Rather than directly pop
        our control up in a window (via the e_address_popup_popup
        function, which is now gone), just return the widget and let the
        caller do the popping.  This works better, since it means we don't
        have to work around the vagaries of bonobo focus & event handling.
        (e_address_popup_set_name): Refresh when both name & email have
        been set, rather than checking a stupid counter.
        (e_address_popup_set_email): Ditto.

2001-04-23  Jon Trowbridge  <trow@ximian.com>

        * mail-display.c (html_button_press_event): Check for mailto:
        links, and pop up our mail address menu when we find one.
        (make_popup_window): The main piece of code (ignoring a zillion
        little callbacks) to pop up our windows with reasonable semantics
        for having them close automatically.
        (mail_text_write): Enable converting addresses to mailto links
        in message bodies.

        * mail-format.c (write_address): Simplify code, removing Radek's
        <DATA> hacks.  Write out addresses as mailto: links.

svn path=/trunk/; revision=9534
This commit is contained in:
Jon Trowbridge
2001-04-24 02:51:45 +00:00
committed by Jon Trowbridge
parent e37b58efec
commit 038d1a932c
8 changed files with 298 additions and 149 deletions

View File

@ -65,12 +65,15 @@ url_extract (const unsigned char **text, gboolean check)
return out;
}
/* FIXME */
/* FIXME -- this should be smarter */
static gboolean
is_email_address (const unsigned char *c)
{
gboolean seen_at = FALSE, seen_postat = FALSE;
if (c == NULL)
return FALSE;
if (*c == '<')
++c;
@ -100,6 +103,9 @@ email_address_extract (const unsigned char **text)
const unsigned char *end = *text;
char *out;
if (end == NULL)
return NULL;
while (*end && !isspace (*end) && (*end != '>') && (*end < 0x80))
++end;
@ -293,12 +299,8 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color)
dispaddr = e_text_to_html (addr, 0);
if (addr) {
gchar *outaddr = g_strdup_printf ("<a href=\"mailto:%s\">"
"<!--+GtkHTML:<DATA class=\"Text\" key=\"email\" value=\"%s\">-->"
"%s"
"<!--+GtkHTML:<DATA class=\"Text\" clear=\"email\">--> "
"</a>",
addr, addr, dispaddr);
gchar *outaddr = g_strdup_printf ("<a href=\"mailto:%s\">%s</a>",
addr, dispaddr);
out = check_size (&buffer, &buffer_size, out, strlen(outaddr));
out += sprintf (out, "%s", outaddr);
col += strlen (addr);