From 4f7b40c17176b49d2135466f29783bbb30c74490 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Sat, 19 May 2001 17:17:04 +0000 Subject: [PATCH] Added new command "Reply to author". --- ChangeLog.claws | 19 +++++++++++++++++++ src/compose.c | 15 +++++++++------ src/compose.h | 6 +++++- src/mainwindow.c | 15 ++++++++++++--- src/summaryview.c | 29 ++++++++++++++++++++++------- 5 files changed, 67 insertions(+), 17 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 469866195..3713dd04b 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/src/compose.c b/src/compose.c index fe5ed023b..49506c73b 100644 --- a/src/compose.c +++ b/src/compose.c @@ -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 diff --git a/src/compose.h b/src/compose.h index a6ceb139d..50c19a695 100644 --- a/src/compose.h +++ b/src/compose.h @@ -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); diff --git a/src/mainwindow.c b/src/mainwindow.c index 99d38c998..2884c3a94 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -468,6 +468,7 @@ static GtkItemFactoryEntry mainwin_entries[] = {N_("/_Message/Compose _new message"), "N", compose_cb, 0, NULL}, {N_("/_Message/_Reply"), "R", reply_cb, COMPOSE_REPLY, NULL}, {N_("/_Message/Reply to a_ll"), "R", reply_cb, COMPOSE_REPLY_TO_ALL, NULL}, + {N_("/_Message/Reply to author"), NULL, reply_cb, COMPOSE_REPLY_TO_AUTHOR, NULL}, {N_("/_Message/_Forward"), "F", reply_cb, COMPOSE_FORWARD, NULL}, {N_("/_Message/Forward as an a_ttachment"), "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); diff --git a/src/summaryview.c b/src/summaryview.c index 97c2d3be4..bbdd58e85 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -320,6 +320,7 @@ static GtkItemFactoryEntry summary_popup_entries[] = {N_("/---"), NULL, NULL, 0, ""}, {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); -- 2.25.1