static GtkItemFactoryEntry textview_link_popup_entries[] =
{
- {N_("/_Open link"), NULL, open_uri_cb, 0, NULL},
- {N_("/_Copy link location"), NULL, copy_uri_cb, 0, NULL},
+ {N_("/_Open with Web browser"), NULL, open_uri_cb, 0, NULL},
+ {N_("/Copy this _link"), NULL, copy_uri_cb, 0, NULL},
};
static GtkItemFactoryEntry textview_mail_popup_entries[] =
{
- {N_("/_Add to addressbook"), NULL, add_uri_to_addrbook_cb, 0, NULL},
- {N_("/_Email"), NULL, mail_to_uri_cb, 0, NULL},
- {N_("/_Copy"), NULL, copy_mail_to_uri_cb, 0, NULL},
+ {N_("/Compose _new message"), NULL, mail_to_uri_cb, 0, NULL},
+ {N_("/Add to _address book"), NULL, add_uri_to_addrbook_cb, 0, NULL},
+ {N_("/Copy this add_ress"), NULL, copy_mail_to_uri_cb, 0, NULL},
};
static GtkItemFactoryEntry textview_file_popup_entries[] =
for (ep_ = scanpos; *ep_ != '\0'; ep_++) {
if (!isgraph(*(const guchar *)ep_) ||
!IS_ASCII(*(const guchar *)ep_) ||
- strchr("()<>\"", *ep_))
+ strchr("[]{}()<>\"", *ep_))
break;
}
GtkTextView *text = GTK_TEXT_VIEW(textview->text);
GtkTextBuffer *buffer = gtk_text_view_get_buffer(text);
GtkTextIter iter;
-
+ gchar *mybuf = g_strdup(linebuf);
+
/* parse table - in order of priority */
struct table {
const gchar *needle; /* token */
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 */
- for (walk = linebuf, n = 0;;) {
+ for (walk = mybuf, n = 0;;) {
gint last_index = PARSE_ELEMS;
gchar *scanpos = NULL;
/* colorize this line */
if (head.next) {
- const gchar *normal_text = linebuf;
+ const gchar *normal_text = mybuf;
/* insert URIs */
for (last = head.next; last != NULL;
(buffer, &iter, normal_text, -1, fg_tag, NULL);
} else {
gtk_text_buffer_insert_with_tags_by_name
- (buffer, &iter, linebuf, -1, fg_tag, NULL);
+ (buffer, &iter, mybuf, -1, fg_tag, NULL);
}
+ g_free(mybuf);
}
#undef ADD_TXT_POS
if (!conv)
strncpy2(buf, str, sizeof(buf));
else if (conv_convert(conv, buf, sizeof(buf), str) < 0)
- conv_utf8todisp(buf, sizeof(buf), str);
-
+ conv_localetodisp(buf, sizeof(buf), str);
+
strcrchomp(buf);
//if (prefs_common.conv_mb_alnum) conv_mb_alnum(buf);
fg_color = NULL;
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;
if (uri == NULL)
return;
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), uri->uri, -1);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), uri->uri, -1);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), uri->uri, -1);
g_object_set_data(G_OBJECT(textview->link_popup_menu), "menu_button",
NULL);
}
if (uri == NULL)
return;
- gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), uri->uri + 7, -1);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), uri->uri +7, -1);
+ gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), uri->uri +7, -1);
g_object_set_data(G_OBJECT(textview->mail_popup_menu), "menu_button",
NULL);
}