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[] =
if (!text_cursor)
text_cursor = gdk_cursor_new(GDK_XTERM);
- textview_update_message_colors();
+ textview_reflect_prefs(textview);
textview_set_all_headers(textview, FALSE);
textview_set_font(textview, NULL);
textview_create_tags(GTK_TEXT_VIEW(textview->text), textview);
}
}
+void textview_reflect_prefs(TextView *textview)
+{
+ textview_update_message_colors();
+ gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(textview->text),
+ prefs_common.textview_cursor_visible);
+}
+
void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
const gchar *file)
{
void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
{
- GtkTextView *text;
-
g_return_if_fail(mimeinfo != NULL);
g_return_if_fail(fp != NULL);
&& (((bp_ + 1) < ep_) && isalnum(*(bp_ + 1)))) {
/* hyphens are allowed, but only in
between alnums */
- } else if (!strchr(",;:=?./+<>!&", *bp_)) {
+ } else if (!strchr(",;:=?./+<>!&\r\n\t", *bp_)) {
/* but anything not being a punctiation
is ok */
} else {
gchar *bufp;
RemoteURI *r_uri;
- if (*str == '\0')
+ if (!str || *str == '\0')
+ return;
+ if (!uri)
return;
text = GTK_TEXT_VIEW(textview->text);
else if (conv_convert(conv, buf, sizeof(buf), str) < 0)
conv_utf8todisp(buf, sizeof(buf), str);
+ if (g_utf8_validate(buf, -1, NULL) == FALSE)
+ return;
+
strcrchomp(buf);
gtk_text_buffer_get_end_iter(buffer, &iter);
+ for (bufp = buf; *bufp != '\0'; bufp = g_utf8_next_char(bufp)) {
+ gunichar ch;
- for (bufp = buf; isspace(*(guchar *)bufp); bufp++)
- gtk_text_buffer_insert(buffer, &iter, bufp, 1);
+ ch = g_utf8_get_char(bufp);
+ if (!g_unichar_isspace(ch))
+ break;
+ }
+ if (bufp > buf)
+ gtk_text_buffer_insert(buffer, &iter, buf, bufp - buf);
if (prefs_common.enable_color) {
link_color = &uri_color;
vadj->value = last_value;
g_signal_emit_by_name(G_OBJECT(vadj), "value_changed", 0);
+
+ gtk_widget_queue_draw(GTK_WIDGET(text));
}
static void textview_smooth_scroll_one_line(TextView *textview, gboolean up)
{
GdkEventButton *bevent;
RemoteURI *uri = NULL;
- GSList *cur;
- gchar *trimmed_uri;
if (!event)
return FALSE;
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);
}