fix 'Reply to all' bugs
[claws.git] / src / compose.c
index 2bf2660c59dd04b27a7dcc1e9f2ecc48b4d0742f..e7eac161a7a73a9604fcb020ee8ddc97e1e326cc 100644 (file)
@@ -450,11 +450,10 @@ void compose_headerentry_key_press_event_cb(GtkWidget            *entry,
 
 static void compose_show_first_last_header (Compose *compose, gboolean show_first);
 
-
 #if USE_PSPELL
 static void compose_check_all             (Compose *compose);
+static void compose_highlight_all         (Compose *compose);
 static void compose_check_backwards       (Compose *compose);
-
 static void compose_check_forwards_go     (Compose *compose);
 #endif
 
@@ -462,7 +461,6 @@ static gboolean compose_send_control_enter (Compose *compose);
 static void text_activated                (GtkWidget   *widget,
                                            Compose     *compose);
 
-
 static GtkItemFactoryEntry compose_popup_entries[] =
 {
        {N_("/_Add..."),        NULL, compose_attach_cb, 0, NULL},
@@ -545,7 +543,7 @@ static GtkItemFactoryEntry compose_entries[] =
                                        COMPOSE_CALL_GTK_STEXT_DELETE_BACKWARD_WORD,
                                        NULL},
        {N_("/_Edit/A_dvanced/Delete a word forward"),
-                                       "<alt>D",
+                                       NULL, /* "<alt>D", */
                                        compose_gtk_stext_action_cb,
                                        COMPOSE_CALL_GTK_STEXT_DELETE_FORWARD_WORD,
                                        NULL},
@@ -565,14 +563,20 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Edit/Wrap all long _lines"),
                                        "<control><alt>L", compose_wrap_line_all, 0, NULL},
        {N_("/_Edit/Edit with e_xternal editor"),
-                                       "<control>X", compose_ext_editor_cb, 0, NULL},
+                                       "<shift><control>X", compose_ext_editor_cb, 0, NULL},
 #if USE_PSPELL
        {N_("/_Spelling"),              NULL, NULL, 0, "<Branch>"},
-       {N_("/_Spelling/Check all or selection"),NULL, compose_check_all, 0, NULL},
-       {N_("/_Spelling/Check backwards misspelled word"),      NULL, compose_check_backwards , 0, NULL},
-       {N_("/_Spelling/Forward to next misspelled word"),      NULL, compose_check_forwards_go, 0, NULL},
+       {N_("/_Spelling/_Check all or check selection"),
+                                       NULL, compose_check_all, 0, NULL},
+       {N_("/_Spelling/_Highlight all misspelled words"),
+                                       NULL, compose_highlight_all, 0, NULL},
+       {N_("/_Spelling/Check _backwards misspelled word"),
+                                       NULL, compose_check_backwards , 0, NULL},
+       {N_("/_Spelling/_Forward to next misspelled word"),
+                                       NULL, compose_check_forwards_go, 0, NULL},
        {N_("/_Spelling/---"),          NULL, NULL, 0, "<Separator>"},
-       {N_("/_Spelling/Spelling Configuration"),NULL, NULL, 0, "<Branch>"},
+       {N_("/_Spelling/_Spelling Configuration"),
+                                       NULL, NULL, 0, "<Branch>"},
 #endif
 #if 0 /* NEW COMPOSE GUI */
        {N_("/_View"),                  NULL, NULL, 0, "<Branch>"},
@@ -590,10 +594,11 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Message"),               NULL, NULL, 0, "<Branch>"},
        {N_("/_Message/_Send"),         "<control>Return",
                                        compose_send_cb, 0, NULL},
-       {N_("/_Message/Send _later"),   "<shift><alt>S",
+       {N_("/_Message/Send _later"),   "<shift><control>S",
                                        compose_send_later_cb,  0, NULL},
+       {N_("/_Message/---"),           NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/Save to _draft folder"),
-                                       "<alt>D", compose_draft_cb, 0, NULL},
+                                       "<shift><control>D", compose_draft_cb, 0, NULL},
        {N_("/_Message/Save and _keep editing"),
                                        "<control>S", compose_draft_cb, 1, NULL},
 #if 0 /* NEW COMPOSE GUI */
@@ -616,7 +621,7 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Message/_Request Return Receipt"),       NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
        {N_("/_Tool"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_Tool/Show _ruler"),      NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
-       {N_("/_Tool/_Address book"),    "<control><alt>A", compose_address_cb , 0, NULL},
+       {N_("/_Tool/_Address book"),    "<shift><control>A", compose_address_cb , 0, NULL},
        {N_("/_Tool/_Template"),        NULL, NULL, 0, "<Branch>"},
        {N_("/_Help"),                  NULL, NULL, 0, "<Branch>"},
        {N_("/_Help/_About"),           NULL, about_show, 0, NULL}
@@ -1759,6 +1764,12 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                                     ? compose->mailinglist
                                     : msginfo->from ? msginfo->from : ""),
                                     COMPOSE_TO);
+
+       if (compose->replyto && to_all)
+               compose_entry_append
+                       (compose, compose->replyto, COMPOSE_CC);
+
+
        if (compose->account->protocol == A_NNTP) {
                if (ignore_replyto)
                        compose_entry_append
@@ -4655,16 +4666,22 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
         if (prefs_common.enable_pspell) {
                gtkpspell = gtkpspell_new((const gchar*)prefs_common.dictionary,
                                          conv_get_current_charset_str(),
+                                         prefs_common.misspelled_col,
                                          prefs_common.check_while_typing,
                                          GTK_STEXT(text));
                if (!gtkpspell) {
                        alertpanel_error(_("Spell checker could not be started.\n%s"), gtkpspellcheckers->error_message);
-                       gtkpspell_checkers_reset();
+                       gtkpspell_checkers_reset_error();
                } else {
 
                        GtkWidget *menuitem;
 
-                       gtkpspell_set_sug_mode(gtkpspell, prefs_common.pspell_sugmode);
+                       if (!gtkpspell_set_sug_mode(gtkpspell, prefs_common.pspell_sugmode)) {
+                               debug_print(_("Pspell: could not set suggestion mode %s"),
+                                   gtkpspellcheckers->error_message);
+                               gtkpspell_checkers_reset_error();
+                       }
+
                        menuitem = gtk_item_factory_get_item(ifactory, "/Spelling/Spelling Configuration");
                        gtkpspell_populate_submenu(gtkpspell, menuitem);
                        menu_set_sensitive(ifactory, "/Spelling", TRUE);
@@ -6647,6 +6664,12 @@ static void compose_check_all(Compose *compose)
                gtkpspell_check_all(compose->gtkpspell);
 }
 
+static void compose_highlight_all(Compose *compose)
+{
+       if (compose->gtkpspell)
+               gtkpspell_highlight_all(compose->gtkpspell);
+}
+
 static void compose_check_backwards(Compose *compose)
 {
        if (compose->gtkpspell)