From 367a76d810b3935607313ac53f5360fc396fbf60 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Tue, 20 Sep 2005 17:24:22 +0000 Subject: [PATCH] 2005-09-20 [colin] 1.9.14cvs45 * src/mainwindow.c * src/messageview.c GUI fixups: add accels, set message view title to displayed mail's subject * src/prefs_spelling.c * src/gtk/gtkaspell.c GUI fixups: allow underlining misspelled words instead of coloring them (a11y!) --- ChangeLog-gtk2.claws | 11 ++++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/gtk/gtkaspell.c | 7 ++++++- src/mainwindow.c | 2 +- src/messageview.c | 48 ++++++++++++++++++++++++++++++-------------- src/prefs_spelling.c | 14 +++++++++++++ 7 files changed, 67 insertions(+), 18 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index ce4080a1e..102325bf2 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,14 @@ +2005-09-20 [colin] 1.9.14cvs45 + + * src/mainwindow.c + * src/messageview.c + GUI fixups: add accels, set message + view title to displayed mail's subject + * src/prefs_spelling.c + * src/gtk/gtkaspell.c + GUI fixups: allow underlining misspelled + words instead of coloring them (a11y!) + 2005-09-19 [colin] 1.9.15rc3 released diff --git a/PATCHSETS b/PATCHSETS index 506b2ff50..f8ac7440d 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -813,3 +813,4 @@ ( cvs diff -u -r 1.65.2.36 -r 1.65.2.37 src/codeconv.c; cvs diff -u -r 1.15.2.10 -r 1.15.2.11 src/codeconv.h; cvs diff -u -r 1.49.2.61 -r 1.49.2.62 src/procmime.c; ) > 1.9.14cvs42.patchset ( cvs diff -u -r 1.60.2.30 -r 1.60.2.31 src/addressbook.c; cvs diff -u -r 1.382.2.171 -r 1.382.2.172 src/compose.c; cvs diff -u -r 1.3.2.10 -r 1.3.2.11 src/exphtmldlg.c; cvs diff -u -r 1.1.4.12 -r 1.1.4.13 src/expldifdlg.c; cvs diff -u -r 1.179.2.70 -r 1.179.2.71 src/imap.c; cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/imap_gtk.c; cvs diff -u -r 1.14.2.4 -r 1.14.2.5 src/importldif.c; cvs diff -u -r 1.4.12.6 -r 1.4.12.7 src/importmutt.c; cvs diff -u -r 1.1.14.6 -r 1.1.14.7 src/importpine.c; cvs diff -u -r 1.149.2.32 -r 1.149.2.33 src/inc.c; cvs diff -u -r 1.29.2.5 -r 1.29.2.6 src/inc.h; cvs diff -u -r 1.94.2.62 -r 1.94.2.63 src/messageview.c; cvs diff -u -r 1.101.2.14 -r 1.101.2.15 src/news.c; cvs diff -u -r 1.2.2.9 -r 1.2.2.10 src/news_gtk.c; cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/news_gtk.h; cvs diff -u -r 1.105.2.34 -r 1.105.2.35 src/prefs_account.c; cvs diff -u -r 1.49.2.14 -r 1.49.2.15 src/prefs_account.h; cvs diff -u -r 1.17.2.17 -r 1.17.2.18 src/send_message.c; cvs diff -u -r 1.2 -r 1.3 src/common/ssl.h; cvs diff -u -r 1.9.2.24 -r 1.9.2.25 src/gtk/gtkaspell.c; ) > 1.9.14cvs43.patchset ( cvs diff -u -r 1.382.2.172 -r 1.382.2.173 src/compose.c; cvs diff -u -r 1.9.2.25 -r 1.9.2.26 src/gtk/gtkaspell.c; ) > 1.9.14cvs44.patchset +( cvs diff -u -r 1.274.2.66 -r 1.274.2.67 src/mainwindow.c; cvs diff -u -r 1.94.2.63 -r 1.94.2.64 src/messageview.c; cvs diff -u -r 1.5.2.11 -r 1.5.2.12 src/prefs_spelling.c; cvs diff -u -r 1.9.2.26 -r 1.9.2.27 src/gtk/gtkaspell.c; ) > 1.9.14cvs45.patchset diff --git a/configure.ac b/configure.ac index 33b9715d7..ba3640eeb 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=14 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=44 +EXTRA_VERSION=45 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/gtk/gtkaspell.c b/src/gtk/gtkaspell.c index f1c00f368..ad834db0c 100644 --- a/src/gtk/gtkaspell.c +++ b/src/gtk/gtkaspell.c @@ -2401,8 +2401,13 @@ static void allocate_color(GtkAspell *gtkaspell, gint rgbvalue) color->blue = (int) (((gdouble) (rgbvalue & 0x0000ff) / 255.0) * 65535.0); - gtk_text_buffer_create_tag(buffer, "misspelled", + if (rgbvalue != 0) + gtk_text_buffer_create_tag(buffer, "misspelled", "foreground-gdk", color, NULL); + else + gtk_text_buffer_create_tag(buffer, "misspelled", + "underline", PANGO_UNDERLINE_ERROR, NULL); + } static void change_color(GtkAspell * gtkaspell, diff --git a/src/mainwindow.c b/src/mainwindow.c index 745c19a1b..4e0ae96e3 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -461,7 +461,7 @@ static GtkItemFactoryEntry mainwin_entries[] = {N_("/_File/Empty all _Trash folders"), "D", empty_trash_cb, 0, NULL}, {N_("/_File/---"), NULL, NULL, 0, ""}, {N_("/_File/_Save as..."), "S", save_as_cb, 0, NULL}, - {N_("/_File/_Print..."), NULL, print_cb, 0, NULL}, + {N_("/_File/_Print..."), "P", print_cb, 0, NULL}, {N_("/_File/---"), NULL, NULL, 0, ""}, {N_("/_File/_Work offline"), "W", toggle_work_offline_cb, 0, ""}, {N_("/_File/---"), NULL, NULL, 0, ""}, diff --git a/src/messageview.c b/src/messageview.c index caef74548..721356b21 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -154,17 +154,17 @@ static GList *msgview_list = NULL; static GtkItemFactoryEntry msgview_entries[] = { {N_("/_File"), NULL, NULL, 0, ""}, - {N_("/_File/_Save as..."), NULL, save_as_cb, 0, NULL}, - {N_("/_File/_Print..."), NULL, print_cb, 0, NULL}, + {N_("/_File/_Save as..."), "S", save_as_cb, 0, NULL}, + {N_("/_File/_Print..."), "P", print_cb, 0, NULL}, {N_("/_File/---"), NULL, NULL, 0, ""}, - {N_("/_File/_Close"), NULL, close_cb, 0, NULL}, + {N_("/_File/_Close"), "W", close_cb, 0, NULL}, {N_("/_Edit"), NULL, NULL, 0, ""}, - {N_("/_Edit/_Copy"), NULL, copy_cb, 0, NULL}, - {N_("/_Edit/Select _all"), NULL, allsel_cb, 0, NULL}, + {N_("/_Edit/_Copy"), "C", copy_cb, 0, NULL}, + {N_("/_Edit/Select _all"), "A", allsel_cb, 0, NULL}, {N_("/_Edit/---"), NULL, NULL, 0, ""}, {N_("/_Edit/_Find in current message..."), - NULL, search_cb, 0, NULL}, + "F", search_cb, 0, NULL}, {N_("/_View"), NULL, NULL, 0, ""}, @@ -266,22 +266,22 @@ static GtkItemFactoryEntry msgview_entries[] = #undef DEC_ACTION {N_("/_View/---"), NULL, NULL, 0, ""}, - {N_("/_View/Mess_age source"), NULL, view_source_cb, 0, NULL}, - {N_("/_View/Show all _headers"),NULL, show_all_header_cb, 0, ""}, + {N_("/_View/Mess_age source"), "U", view_source_cb, 0, NULL}, + {N_("/_View/Show all _headers"),"H", show_all_header_cb, 0, ""}, {N_("/_Message"), NULL, NULL, 0, ""}, {N_("/_Message/Compose _new message"), - NULL, compose_cb, 0, NULL}, + "M", compose_cb, 0, NULL}, {N_("/_Message/---"), NULL, NULL, 0, ""}, - {N_("/_Message/_Reply"), NULL, reply_cb, COMPOSE_REPLY, NULL}, + {N_("/_Message/_Reply"), "R", reply_cb, COMPOSE_REPLY, NULL}, {N_("/_Message/Repl_y to/_all"), - NULL, reply_cb, COMPOSE_REPLY_TO_ALL, NULL}, + "R", reply_cb, COMPOSE_REPLY_TO_ALL, NULL}, {N_("/_Message/Repl_y to/_sender"), NULL, reply_cb, COMPOSE_REPLY_TO_SENDER, NULL}, {N_("/_Message/Repl_y to/mailing _list"), - NULL, reply_cb, COMPOSE_REPLY_TO_LIST, NULL}, + "L", reply_cb, COMPOSE_REPLY_TO_LIST, NULL}, {N_("/_Message/---"), NULL, NULL, 0, ""}, - {N_("/_Message/_Forward"), NULL, reply_cb, COMPOSE_FORWARD, NULL}, + {N_("/_Message/_Forward"), "F", reply_cb, COMPOSE_FORWARD, NULL}, {N_("/_Message/For_ward as attachment"), NULL, reply_cb, COMPOSE_FORWARD_AS_ATTACH, NULL}, {N_("/_Message/Redirec_t"), NULL, reply_cb, COMPOSE_REDIRECT, NULL}, @@ -289,7 +289,7 @@ static GtkItemFactoryEntry msgview_entries[] = {N_("/_Message/Re-_edit"), NULL, reedit_cb, 0, NULL}, {N_("/_Tools"), NULL, NULL, 0, ""}, - {N_("/_Tools/_Address book"), NULL, addressbook_open_cb, 0, NULL}, + {N_("/_Tools/_Address book"), "A", addressbook_open_cb, 0, NULL}, {N_("/_Tools/Add sender to address boo_k"), NULL, add_address_cb, 0, NULL}, {N_("/_Tools/---"), NULL, NULL, 0, ""}, @@ -739,7 +739,7 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo, { gchar *file; MimeInfo *mimeinfo, *encinfo; - + gchar *subject = NULL; g_return_val_if_fail(msginfo != NULL, -1); mimeinfo = procmime_scan_message(msginfo); @@ -774,6 +774,24 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo, messageview->all_headers); mimeview_show_message(messageview->mimeview, mimeinfo, file); + + if (messageview->window) + gtk_window_set_title(GTK_WINDOW(messageview->window), + _("Sylpheed - Message View")); + if (messageview->window && msginfo->subject) { + subject = g_strdup(msginfo->subject); + if (!g_utf8_validate(subject, -1, NULL)) { + g_free(subject); + subject = g_malloc(strlen(msginfo->subject)*2 +1); + conv_localetodisp(subject, strlen(msginfo->subject)*2 +1, + msginfo->subject); + } + if (g_utf8_validate(subject, -1, NULL)) + gtk_window_set_title(GTK_WINDOW(messageview->window), + subject); + g_free(subject); + } + messageview_set_position(messageview, 0); if (messageview->msginfo->partial_recv) diff --git a/src/prefs_spelling.c b/src/prefs_spelling.c index 9fcffc4bf..914c3ac0a 100644 --- a/src/prefs_spelling.c +++ b/src/prefs_spelling.c @@ -152,6 +152,8 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer GtkWidget *hbox1; GtkWidget *misspelled_btn; GtkTooltips *tooltips; + PangoFontDescription *font_desc; + gint size; tooltips = gtk_tooltips_new (); @@ -258,6 +260,18 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer gtk_box_pack_start(GTK_BOX(hbox1), misspelled_btn, FALSE, FALSE, 0); gtk_widget_set_size_request(misspelled_btn, 30, 20); + label5 = gtk_label_new(_("(Black to use underline)")); + gtk_misc_set_alignment(GTK_MISC(label5), 0, 0.5); + gtk_label_set_justify(GTK_LABEL(label4), GTK_JUSTIFY_LEFT); + gtk_widget_show(label5); + font_desc = pango_font_description_new(); + size = pango_font_description_get_size + (label5->style->font_desc); + pango_font_description_set_size(font_desc, size * PANGO_SCALE_SMALL); + gtk_widget_modify_font(label5, font_desc); + pango_font_description_free(font_desc); + gtk_box_pack_start(GTK_BOX(hbox1), label5, FALSE, FALSE, + 4); /* END GLADE CODE */ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_aspell), -- 2.25.1