Added new command "Reply to author".
authorSergey Vlasov <vsu@users.sourceforge.net>
Sat, 19 May 2001 17:17:04 +0000 (17:17 +0000)
committerSergey Vlasov <vsu@users.sourceforge.net>
Sat, 19 May 2001 17:17:04 +0000 (17:17 +0000)
ChangeLog.claws
src/compose.c
src/compose.h
src/mainwindow.c
src/summaryview.c

index 4698661..3713dd0 100644 (file)
@@ -1,3 +1,22 @@
+2001-05-19 [sergey]
+
+       * src/compose.h (ComposeReplyMode): new modes
+       COMPOSE_REPLY_TO_AUTHOR, COMPOSE_REPLY_TO_AUTHOR_WITH_QUOTE,
+       COMPOSE_REPLY_TO_AUTHOR_WITHOUT_QUOTE.
+
+       * src/compose.c (compose_reply): new argument to_author; all
+       callers changed.
+       (compose_reply_set_entry): new argument to_author; ignore
+       compose->replyto if to_author==TRUE.
+
+       * src/mainwindow.c: new command "Message/Reply to author".
+       (main_window_set_menu_sensitive): enable/disable it.
+       (reply_cb): handle it.
+
+       * src/summaryview.c: new command "Reply to author".
+       (summary_set_menu_sensitive): enable/disable it.
+       (summary_reply_cb): handle it.
+
 2001-05-18 [paul]
 
         0.4.99claws1
index fe5ed02..49506c7 100644 (file)
@@ -140,7 +140,8 @@ static gchar *compose_quote_parse_fmt               (Compose        *compose,
                                                 const gchar    *fmt);
 static void compose_reply_set_entry            (Compose        *compose,
                                                 MsgInfo        *msginfo,
-                                                gboolean        to_all);
+                                                gboolean        to_all,
+                                                gboolean        to_author);
 static void compose_reedit_set_entry           (Compose        *compose,
                                                 MsgInfo        *msginfo);
 static void compose_insert_sig                 (Compose        *compose);
@@ -462,7 +463,8 @@ Compose * compose_new_with_recipient(PrefsAccount *account, const gchar *to)
        return compose;
 }
 
-void compose_reply(MsgInfo *msginfo, gboolean quote, gboolean to_all)
+void compose_reply(MsgInfo *msginfo, gboolean quote, gboolean to_all,
+                  gboolean to_author)
 {
        Compose *compose;
        PrefsAccount *account;
@@ -482,7 +484,7 @@ void compose_reply(MsgInfo *msginfo, gboolean quote, gboolean to_all)
        compose->mode = COMPOSE_REPLY;
 
        if (compose_parse_header(compose, msginfo) < 0) return;
-       compose_reply_set_entry(compose, msginfo, to_all);
+       compose_reply_set_entry(compose, msginfo, to_all, to_author);
 
        text = GTK_STEXT(compose->text);
        gtk_stext_freeze(text);
@@ -1068,7 +1070,7 @@ static gchar *compose_quote_parse_fmt(Compose *compose, MsgInfo *msginfo,
 }
 
 static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
-                                   gboolean to_all)
+                                   gboolean to_all, gboolean to_author)
 {
        GSList *cc_list;
        GSList *cur;
@@ -1080,8 +1082,9 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
 
        if (compose->account->protocol != A_NNTP)
                gtk_entry_set_text(GTK_ENTRY(compose->to_entry),
-                                  compose->replyto ? compose->replyto
-                                  : msginfo->from ? msginfo->from : "");
+                                  ( (compose->replyto && !to_author) 
+                                    ? compose->replyto
+                                    : msginfo->from ? msginfo->from : ""));
        if (compose->account->protocol == A_NNTP)
                gtk_entry_set_text(GTK_ENTRY(compose->newsgroups_entry),
                                   compose->followup_to ? compose->followup_to
index a6ceb13..50c19a6 100644 (file)
@@ -54,6 +54,9 @@ typedef enum
        COMPOSE_REPLY_TO_ALL,
        COMPOSE_REPLY_TO_ALL_WITH_QUOTE,
        COMPOSE_REPLY_TO_ALL_WITHOUT_QUOTE,
+       COMPOSE_REPLY_TO_AUTHOR,
+       COMPOSE_REPLY_TO_AUTHOR_WITH_QUOTE,
+       COMPOSE_REPLY_TO_AUTHOR_WITHOUT_QUOTE,
        COMPOSE_FORWARD,
        COMPOSE_FORWARD_AS_ATTACH,
        COMPOSE_NEW,
@@ -172,7 +175,8 @@ Compose * compose_new_with_recipient        (PrefsAccount   *account,
 
 void compose_reply             (MsgInfo        *msginfo,
                                 gboolean        quote,
-                                gboolean        to_all);
+                                gboolean        to_all,
+                                gboolean        to_author);
 Compose * compose_forward      (PrefsAccount *account,
                                 MsgInfo        *msginfo,
                                 gboolean        as_attach);
index 99d38c9..2884c3a 100644 (file)
@@ -468,6 +468,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Message/Compose _new message"),  "<alt>N",       compose_cb, 0, NULL},
        {N_("/_Message/_Reply"),                "<alt>R",       reply_cb, COMPOSE_REPLY, NULL},
        {N_("/_Message/Reply to a_ll"),         "<shift><alt>R", reply_cb, COMPOSE_REPLY_TO_ALL, NULL},
+       {N_("/_Message/Reply to author"),       NULL, reply_cb, COMPOSE_REPLY_TO_AUTHOR, NULL},
        {N_("/_Message/_Forward"),              "<control>F",   reply_cb, COMPOSE_FORWARD, NULL},
        {N_("/_Message/Forward as an a_ttachment"),
                                                "<shift><control>F", reply_cb, COMPOSE_FORWARD_AS_ATTACH, NULL},
@@ -1063,6 +1064,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin, gint selection)
        menu_set_sensitive(ifactory, "/File/Save as...", sens);
        menu_set_sensitive(ifactory, "/Message/Reply", sens);
        menu_set_sensitive(ifactory, "/Message/Reply to all", sens);
+       menu_set_sensitive(ifactory, "/Message/Reply to author", sens);
        menu_set_sensitive(ifactory, "/Message/Forward", sens);
        menu_set_sensitive(ifactory, "/Message/Forward as an attachment", sens);
        menu_set_sensitive(ifactory, "/Message/Open in new window", sens);
@@ -1853,10 +1855,16 @@ static void reply_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 
        switch (action) {
        case COMPOSE_REPLY:
-               compose_reply(msginfo, prefs_common.reply_with_quote, FALSE);
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             FALSE, FALSE);
                break;
        case COMPOSE_REPLY_TO_ALL:
-               compose_reply(msginfo, prefs_common.reply_with_quote, TRUE);
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             TRUE, FALSE);
+               break;
+       case COMPOSE_REPLY_TO_AUTHOR:
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             FALSE, TRUE);
                break;
        case COMPOSE_FORWARD:
                compose_forward(NULL, msginfo, FALSE);
@@ -1865,7 +1873,8 @@ static void reply_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
                compose_forward(NULL, msginfo, TRUE);
                break;
        default:
-               compose_reply(msginfo, prefs_common.reply_with_quote, FALSE);
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             FALSE, FALSE);
        }
 
        summary_set_marks_selected(mainwin->summaryview);
index 97c2d3b..bbdd58e 100644 (file)
@@ -320,6 +320,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/---"),                    NULL, NULL,             0, "<Separator>"},
        {N_("/_Reply"),                 NULL, summary_reply_cb, COMPOSE_REPLY, NULL},
        {N_("/Reply to a_ll"),          NULL, summary_reply_cb, COMPOSE_REPLY_TO_ALL, NULL},
+       {N_("/Reply to author"),        NULL, summary_reply_cb, COMPOSE_REPLY_TO_AUTHOR, NULL},
        {N_("/_Forward"),               NULL, summary_reply_cb, COMPOSE_FORWARD, NULL},
        {N_("/Forward as an a_ttachment"),
                                        NULL, summary_reply_cb, COMPOSE_FORWARD_AS_ATTACH, NULL},
@@ -838,6 +839,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        sens = (selection == SUMMARY_SELECTED_MULTIPLE) ? FALSE : TRUE;
        menu_set_sensitive(ifactory, "/Reply",                    sens);
        menu_set_sensitive(ifactory, "/Reply to all",             sens);
+       menu_set_sensitive(ifactory, "/Reply to author",          sens);
        menu_set_sensitive(ifactory, "/Forward",                  sens);
        menu_set_sensitive(ifactory, "/Forward as an attachment", sens);
 
@@ -3006,22 +3008,34 @@ static void summary_reply_cb(SummaryView *summaryview, guint action,
 
        switch ((ComposeReplyMode)action) {
        case COMPOSE_REPLY:
-               compose_reply(msginfo, prefs_common.reply_with_quote, FALSE);
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             FALSE, FALSE);
                break;
        case COMPOSE_REPLY_WITH_QUOTE:
-               compose_reply(msginfo, TRUE, FALSE);
+               compose_reply(msginfo, TRUE, FALSE, FALSE);
                break;
        case COMPOSE_REPLY_WITHOUT_QUOTE:
-               compose_reply(msginfo, FALSE, FALSE);
+               compose_reply(msginfo, FALSE, FALSE, FALSE);
                break;
        case COMPOSE_REPLY_TO_ALL:
-               compose_reply(msginfo, prefs_common.reply_with_quote, TRUE);
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             TRUE, FALSE);
                break;
        case COMPOSE_REPLY_TO_ALL_WITH_QUOTE:
-               compose_reply(msginfo, TRUE, TRUE);
+               compose_reply(msginfo, TRUE, TRUE, FALSE);
                break;
        case COMPOSE_REPLY_TO_ALL_WITHOUT_QUOTE:
-               compose_reply(msginfo, FALSE, TRUE);
+               compose_reply(msginfo, FALSE, TRUE, FALSE);
+               break;
+       case COMPOSE_REPLY_TO_AUTHOR:
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             FALSE, TRUE);
+               break;
+       case COMPOSE_REPLY_TO_AUTHOR_WITH_QUOTE:
+               compose_reply(msginfo, TRUE, FALSE, TRUE);
+               break;
+       case COMPOSE_REPLY_TO_AUTHOR_WITHOUT_QUOTE:
+               compose_reply(msginfo, FALSE, FALSE, TRUE);
                break;
        case COMPOSE_FORWARD:
                compose_forward(NULL, msginfo, FALSE);
@@ -3030,7 +3044,8 @@ static void summary_reply_cb(SummaryView *summaryview, guint action,
                compose_forward(NULL, msginfo, TRUE);
                break;
        default:
-               compose_reply(msginfo, prefs_common.reply_with_quote, FALSE);
+               compose_reply(msginfo, prefs_common.reply_with_quote,
+                             FALSE, FALSE);
        }
 
        summary_set_marks_selected(summaryview);