Remove unnecessary line.
[claws.git] / src / compose.c
index a5291e55fb28f49f5ec9ad5abf27d1c2f042f651..1e098be9d0c78de0af5bc3b0d4271dc5bf7df6ad 100644 (file)
@@ -78,6 +78,7 @@
 #include "procmsg.h"
 #include "menu.h"
 #include "send.h"
+#include "imap.h"
 #include "news.h"
 #include "customheader.h"
 #include "prefs_common.h"
@@ -706,7 +707,8 @@ static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
 
        MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
        MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED);
-
+       if (MSG_IS_IMAP(msginfo->flags))
+               imap_msg_set_perm_flags(msginfo, MSG_REPLIED);
        CHANGE_FLAGS(msginfo);
 
        compose = compose_create(account, COMPOSE_REPLY);
@@ -996,22 +998,22 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
        g_return_val_if_fail(msginfo->folder != NULL, NULL);
 
        account = msginfo->folder->folder->account;
-        if (!account && msginfo->to && prefs_common.forward_account_autosel) {
+       if (!account && msginfo->to && prefs_common.forward_account_autosel) {
                gchar *to;
                Xstrdup_a(to, msginfo->to, return NULL);
                extract_address(to);
                account = account_find_from_address(to);
        }
 
-        if(!account && prefs_common.forward_account_autosel) {
-                       gchar cc[BUFFSIZE];
+       if(!account && prefs_common.forward_account_autosel) {
+               gchar cc[BUFFSIZE];
                if(!get_header_from_msginfo(msginfo,cc,sizeof(cc),"CC:")){ /* Found a CC header */
                        extract_address(cc);
                        account = account_find_from_address(cc);
                 }
        }
 
-        if (account == NULL) {
+       if (account == NULL) {
                account = cur_account;
                /*
                account = msginfo->folder->folder->account;
@@ -1022,6 +1024,8 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
 
        MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_REPLIED);
        MSG_SET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
+       if (MSG_IS_IMAP(msginfo->flags))
+               imap_msg_unset_perm_flags(msginfo, MSG_REPLIED);
        CHANGE_FLAGS(msginfo);
 
        compose = compose_create(account, COMPOSE_FORWARD);
@@ -1565,10 +1569,10 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
 
        if ((compose->account->protocol != A_NNTP) || followup_and_reply_to)
                compose_entry_append(compose,
-                                   ((compose->mailinglist && !ignore_replyto)
-                                    ? compose->mailinglist
-                                    : (compose->replyto && !ignore_replyto)
+                                   ((compose->replyto && !ignore_replyto)
                                     ? compose->replyto
+                                    : (compose->mailinglist && !ignore_replyto)
+                                    ? compose->mailinglist
                                     : msginfo->from ? msginfo->from : ""),
                                     COMPOSE_TO);
        if (compose->account->protocol == A_NNTP) {
@@ -2177,14 +2181,17 @@ static void compose_wrap_line_all(Compose *compose)
 
        for (; cur_pos < tlen; cur_pos++) {
                /* mark position of new line - needed for quotation wrap */
-               if (linewrap_quote && is_new_line) {
-                       qlen = gtkut_text_str_compare
-                               (text, cur_pos, tlen, qfmt);
+               if (is_new_line) {
+                       if (linewrap_quote) {
+                               qlen = gtkut_text_str_compare
+                                       (text, cur_pos, tlen, qfmt);
+                               if (qlen)
+                                       i_len = get_indent_length
+                                               (text, cur_pos, tlen);
+                               else
+                                       i_len = 0;
+                       }
                        is_new_line = FALSE;
-                       if (qlen)
-                               i_len = get_indent_length(text, cur_pos, tlen);
-                       else
-                               i_len = 0;
                        p_pos = cur_pos;
 #ifdef WRAP_DEBUG
                        printf("new line i_len=%d qlen=%d p_pos=", i_len, qlen);
@@ -4107,6 +4114,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
        gtk_widget_set_usize(window, -1, prefs_common.compose_height);
+       gtk_window_set_wmclass(GTK_WINDOW(window), "compose window", "Sylpheed");
        gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                           GTK_SIGNAL_FUNC(compose_delete_cb), compose);
        gtk_signal_connect(GTK_OBJECT(window), "destroy",
@@ -4451,10 +4459,11 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                                   account->auto_replyto);
 #endif
        }
+
        if (account->protocol != A_NNTP) {
-               gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), _("To:"));
+               gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), prefs_common.trans_hdr ? _("To:") : "To:");
        } else {
-               gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), _("Newsgroups:"));
+               gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), prefs_common.trans_hdr ? _("Newsgroups:") : "Newsgroups:");
        }
 
        menuitem = gtk_item_factory_get_item(ifactory, "/Tool/Show ruler");
@@ -5935,8 +5944,8 @@ static void compose_toggle_attach_cb(gpointer data, guint action,
        if (GTK_CHECK_MENU_ITEM(widget)->active) {
                gtk_widget_ref(compose->edit_vbox);
 
-               gtk_container_remove(GTK_CONTAINER(compose->vbox2),
-                                    compose->edit_vbox);
+               gtkut_container_remove(GTK_CONTAINER(compose->vbox2),
+                                      compose->edit_vbox);
                gtk_paned_add2(GTK_PANED(compose->paned), compose->edit_vbox);
                gtk_box_pack_start(GTK_BOX(compose->vbox2), compose->paned,
                                   TRUE, TRUE, 0);
@@ -5950,10 +5959,10 @@ static void compose_toggle_attach_cb(gpointer data, guint action,
                gtk_widget_ref(compose->paned);
                gtk_widget_ref(compose->edit_vbox);
 
-               gtk_container_remove(GTK_CONTAINER(compose->vbox2),
-                                    compose->paned);
-               gtk_container_remove(GTK_CONTAINER(compose->paned),
-                                    compose->edit_vbox);
+               gtkut_container_remove(GTK_CONTAINER(compose->vbox2),
+                                      compose->paned);
+               gtkut_container_remove(GTK_CONTAINER(compose->paned),
+                                      compose->edit_vbox);
                gtk_box_pack_start(GTK_BOX(compose->vbox2),
                                   compose->edit_vbox, TRUE, TRUE, 0);