2005-07-20 [colin] 1.9.12cvs87
[claws.git] / src / textview.c
index e23c607b94e98f0bbf43802f88dd6eaf80958076..09c59dc3545e74cdefba161f0e0bc79f859a5967 100644 (file)
@@ -836,7 +836,7 @@ static gboolean get_uri_part(const gchar *start, const gchar *scanpos,
        for (ep_ = scanpos; *ep_ != '\0'; ep_++) {
                if (!isgraph(*(const guchar *)ep_) ||
                    !IS_ASCII(*(const guchar *)ep_) ||
-                   strchr("()<>\"", *ep_))
+                   strchr("[]{}()<>\"", *ep_))
                        break;
        }
 
@@ -1160,11 +1160,6 @@ static void textview_make_clickable_parts(TextView *textview,
        GtkTextIter iter;
        gchar *mybuf = g_strdup(linebuf);
        
-       if (!g_utf8_validate(linebuf, -1, NULL)) {
-               mybuf = g_malloc(strlen(linebuf)*2 +1);
-               conv_localetodisp(mybuf, strlen(linebuf)*2 +1, linebuf);
-       }
-
        /* parse table - in order of priority */
        struct table {
                const gchar *needle; /* token */
@@ -1201,6 +1196,11 @@ static void textview_make_clickable_parts(TextView *textview,
                struct txtpos   *next;          /* next */
        } head = {NULL, NULL, 0,  NULL}, *last = &head;
 
+       if (!g_utf8_validate(linebuf, -1, NULL)) {
+               mybuf = g_malloc(strlen(linebuf)*2 +1);
+               conv_localetodisp(mybuf, strlen(linebuf)*2 +1, linebuf);
+       }
+
        gtk_text_buffer_get_end_iter(buffer, &iter);
 
        /* parse for clickable parts, and build a list of begin and end positions  */
@@ -2210,11 +2210,12 @@ static gboolean textview_uri_security_check(TextView *textview, RemoteURI *uri)
 
                msg = g_strdup_printf(_("The real URL (%s) is different from\n"
                                        "the apparent URL (%s).\n"
+                                       "\n"
                                        "Open it anyway?"),
                                      uri->uri, visible_str);
-               aval = alertpanel_with_type(_("Warning"), msg,
-                                           GTK_STOCK_YES, GTK_STOCK_NO,
-                                           NULL, NULL, ALERT_WARNING);
+               aval = alertpanel_full(_("Fake URL warning"), msg,
+                                      GTK_STOCK_YES, GTK_STOCK_NO, NULL, FALSE,
+                                      NULL, ALERT_WARNING, G_ALERTALTERNATE);
                g_free(msg);
                if (aval == G_ALERTDEFAULT)
                        retval = TRUE;