textview->cur_pos = 0;
textview->show_all_headers = FALSE;
textview->last_buttonpress = GDK_NOTHING;
+ textview->show_url_msgid = 0;
return textview;
}
TEXT_INSERT(_("To display this part as a text message, select "));
TEXT_INSERT(_("`Display as text', or press `t' key.\n\n"));
+ TEXT_INSERT(_("To display this part as an image, select "));
+ TEXT_INSERT(_("`Display image', or press `i' key.\n\n"));
+
TEXT_INSERT(_("To open this part with external program, select "));
TEXT_INSERT(_("`Open' or `Open with...', "));
TEXT_INSERT(_("or double-click, or click the center button, "));
(ch) > 32 && \
(ch) != 127 && \
!isspace(ch) && \
- !strchr("()<>\"", (ch)))
+ !strchr("(),;<>\"", (ch)))
/* alphabet and number within 7bit ASCII */
#define IS_ASCII_ALNUM(ch) (isascii(ch) && isalnum(ch))
uri = g_new(RemoteURI, 1);
uri->uri = g_strdup(url);
uri->start = gtk_stext_get_point(text);
- gtk_stext_insert(text, textview->msgfont, link_color, NULL, buf,
- strlen(buf));
+ gtk_stext_insert(text, textview->msgfont, link_color, NULL, str,
+ strlen(str));
uri->end = gtk_stext_get_point(text);
textview->uri_list = g_slist_append(textview->uri_list, uri);
}
>, foo>, _> ... ok, <foo>, foo bar>, foo-> ... ng
Up to 3 levels of quotations are detected, and each
level is colored using a different color. */
- if (prefs_common.enable_color && strchr(buf, '>')) {
- quotelevel = get_quote_level(buf);
+ if (prefs_common.enable_color
+ && line_has_quote_char(buf, prefs_common.quote_chars)) {
+ quotelevel = get_quote_level(buf, prefs_common.quote_chars);
/* set up the correct foreground color */
if (quotelevel > 2) {
if (text_len - pos < len) break;
if (gtkut_stext_match_string(text, pos, wcs, len, case_sens)
== TRUE) {
+ gtk_widget_hide(GTK_WIDGET(textview->scrolledwin));
gtk_editable_set_position(GTK_EDITABLE(text),
pos + len);
gtk_editable_select_region(GTK_EDITABLE(text),
pos, pos + len);
+ gtk_widget_show(GTK_WIDGET(textview->scrolledwin));
textview_set_position(textview, pos + len);
found = TRUE;
break;
}
if (text_len - pos == len) break;
}
-
g_free(wcs);
return found;
}
return TRUE;
}
+static gint show_url_timeout_cb(TextView *textview ){
+ if (textview->messageview->mainwin)
+ if (textview->show_url_msgid)
+ gtk_statusbar_remove(GTK_STATUSBAR(
+ textview->messageview->mainwin->statusbar),
+ textview->messageview->mainwin->folderview_cid,
+ textview->show_url_msgid);
+ return FALSE;
+}
+
static gint textview_button_pressed(GtkWidget *widget, GdkEventButton *event,
TextView *textview)
{
gtk_editable_get_position(GTK_EDITABLE(textview->text));
if (event &&
- ((event->button == 1 && textview->last_buttonpress == GDK_2BUTTON_PRESS)
+ ((event->button == 1)
|| event->button == 2 || event->button == 3)) {
GSList *cur;
if (textview->cur_pos >= uri->start &&
textview->cur_pos < uri->end) {
+ /* single click: display url in statusbar */
+ if (event->button == 1 && textview->last_buttonpress != GDK_2BUTTON_PRESS) {
+ if (textview->messageview->mainwin) {
+ if (textview->show_url_msgid) {
+ gtk_timeout_remove(textview->show_url_timeout_tag);
+ gtk_statusbar_remove(GTK_STATUSBAR(
+ textview->messageview->mainwin->statusbar),
+ textview->messageview->mainwin->folderview_cid,
+ textview->show_url_msgid);
+ textview->show_url_msgid = 0;
+ }
+ textview->show_url_msgid = gtk_statusbar_push(
+ GTK_STATUSBAR(textview->messageview->mainwin->statusbar),
+ textview->messageview->mainwin->folderview_cid,
+ uri->uri);
+ textview->show_url_timeout_tag = gtk_timeout_add( 2000, show_url_timeout_cb, textview );
+ gtkut_widget_wait_for_draw(textview->messageview->mainwin->hbox_stat);
+ }
+ } else
if (!g_strncasecmp(uri->uri, "mailto:", 7)) {
if (event->button == 3) {
gchar *fromname, *fromaddress;