Revert previous (mis-)commit.
authorTristan Chabredier <wwp@claws-mail.org>
Thu, 6 Mar 2008 12:54:05 +0000 (12:54 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Thu, 6 Mar 2008 12:54:05 +0000 (12:54 +0000)
src/common/template.c
src/common/template.h
src/compose.c
src/folder_item_prefs.c
src/folder_item_prefs.h
src/prefs_account.c
src/prefs_folder_item.c
src/prefs_quote.c
src/prefs_template.c
src/quote_fmt.c
src/quote_fmt.h

index 029f455..2a5a673 100644 (file)
@@ -48,7 +48,6 @@ static Template *template_load(gchar *filename)
        tmpl->load_filename = g_strdup(filename);;
        tmpl->name = NULL;
        tmpl->subject = NULL;
-       tmpl->from = NULL;
        tmpl->to = NULL;
        tmpl->cc = NULL;        
        tmpl->bcc = NULL;       
@@ -59,8 +58,6 @@ static Template *template_load(gchar *filename)
                        break;
                else if (!g_ascii_strncasecmp(buf, "Name:", 5))
                        tmpl->name = g_strdup(g_strstrip(buf + 5));
-               else if (!g_ascii_strncasecmp(buf, "From:", 5))
-                       tmpl->from = g_strdup(g_strstrip(buf + 5));
                else if (!g_ascii_strncasecmp(buf, "To:", 3))
                        tmpl->to = g_strdup(g_strstrip(buf + 3));
                else if (!g_ascii_strncasecmp(buf, "Cc:", 3))
@@ -247,8 +244,6 @@ static void template_write_config(GSList *tmpl_list)
                TRY(fprintf(fp, "Name: %s\n", tmpl->name) > 0);
                if (tmpl->subject && *tmpl->subject != '\0')
                        TRY(fprintf(fp, "Subject: %s\n", tmpl->subject) > 0);
-               if (tmpl->from && *tmpl->from != '\0')
-                       TRY(fprintf(fp, "From: %s\n", tmpl->from) > 0);
                if (tmpl->to && *tmpl->to != '\0')
                        TRY(fprintf(fp, "To: %s\n", tmpl->to) > 0);
                if (tmpl->cc && *tmpl->cc != '\0')
index 5806af4..458c170 100644 (file)
@@ -29,7 +29,6 @@ struct _Template {
        gchar *load_filename;
        gchar *name;
        gchar *subject;
-       gchar *from;
        gchar *to;
        gchar *cc;
        gchar *bcc;             
index d14f8d8..5400ac5 100644 (file)
@@ -1006,7 +1006,6 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        const gchar *body_format = NULL;
        gchar *mailto_from = NULL;
        PrefsAccount *mailto_account = NULL;
-       MsgInfo* dummyinfo = NULL;
 
        /* check if mailto defines a from */
        if (mailto && *mailto != '\0') {
@@ -1034,40 +1033,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        if (mailto_from) {
                gtk_entry_set_text(GTK_ENTRY(compose->from_name), mailto_from);
                g_free(mailto_from);
-       } else
-               /* override from name according to folder properties */
-               if (item && item->prefs &&
-                       item->prefs->compose_with_format &&
-                       item->prefs->compose_override_from_format &&
-                       *item->prefs->compose_override_from_format != '\0') {
-
-                       gchar *tmp = NULL;
-                       gchar *buf = NULL;
-
-                       dummyinfo = compose_msginfo_new_from_compose(compose);
-
-                       /* decode \-escape sequences in the internal representation of the quote format */
-                       tmp = malloc(strlen(item->prefs->compose_override_from_format)+1);
-                       pref_get_unescaped_pref(tmp, item->prefs->compose_override_from_format);
-
-#ifdef USE_ASPELL
-                       quote_fmt_init(dummyinfo, NULL, NULL, FALSE, compose->account, FALSE,
-                                       compose->gtkaspell);
-#else
-                       quote_fmt_init(dummyinfo, NULL, NULL, FALSE, compose->account, FALSE);
-#endif
-                       quote_fmt_scan_string(tmp);
-                       quote_fmt_parse();
-
-                       buf = quote_fmt_get_buffer();
-                       if (buf == NULL)
-                               alertpanel_error(_("New message From format error."));
-                       else
-                               gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
-                       quote_fmt_reset_vartable();
-
-                       g_free(tmp);
-               }
+       }
 
        ifactory = gtk_item_factory_from_widget(compose->menubar);
 
@@ -1128,6 +1094,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        }
 
        if (subject_format || body_format) {
+               MsgInfo* dummyinfo = NULL;
 
                if ( subject_format
                         && *subject_format != '\0' )
@@ -1136,8 +1103,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                        gchar *tmp = NULL;
                        gchar *buf = NULL;
 
-                       if (!dummyinfo)
-                               dummyinfo = compose_msginfo_new_from_compose(compose);
+                       dummyinfo = compose_msginfo_new_from_compose(compose);
 
                        /* decode \-escape sequences in the internal representation of the quote format */
                        tmp = malloc(strlen(subject_format)+1);
@@ -1173,7 +1139,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                        GtkTextIter start, end;
                        gchar *tmp = NULL;
 
-                       if (!dummyinfo)
+                       if ( dummyinfo == NULL )
                                dummyinfo = compose_msginfo_new_from_compose(compose);
 
                        text = GTK_TEXT_VIEW(compose->text);
@@ -1192,8 +1158,8 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
                        g_free(tmp);
                }
 
+               procmsg_msginfo_free( dummyinfo );
        }
-       procmsg_msginfo_free( dummyinfo );
 
        if (attach_files) {
                gint i;
@@ -1539,38 +1505,6 @@ static Compose *compose_generic_reply(MsgInfo *msginfo,
                return NULL;
        }
 
-       /* override from name according to folder properties */
-       if (msginfo->folder && msginfo->folder->prefs &&
-               msginfo->folder->prefs->reply_with_format &&
-               msginfo->folder->prefs->reply_override_from_format &&
-               *msginfo->folder->prefs->reply_override_from_format != '\0') {
-
-               gchar *tmp = NULL;
-               gchar *buf = NULL;
-
-               /* decode \-escape sequences in the internal representation of the quote format */
-               tmp = malloc(strlen(msginfo->folder->prefs->reply_override_from_format)+1);
-               pref_get_unescaped_pref(tmp, msginfo->folder->prefs->reply_override_from_format);
-
-#ifdef USE_ASPELL
-               quote_fmt_init(compose->replyinfo, NULL, NULL, FALSE, compose->account, FALSE,
-                               compose->gtkaspell);
-#else
-               quote_fmt_init(compose->replyinfo, NULL, NULL, FALSE, compose->account, FALSE);
-#endif
-               quote_fmt_scan_string(tmp);
-               quote_fmt_parse();
-
-               buf = quote_fmt_get_buffer();
-               if (buf == NULL)
-                       alertpanel_error(_("Message reply From format error."));
-               else
-                       gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
-               quote_fmt_reset_vartable();
-
-               g_free(tmp);
-       }
-
        textview = (GTK_TEXT_VIEW(compose->text));
        textbuf = gtk_text_view_get_buffer(textview);
        compose_create_tags(textview, compose);
@@ -1695,45 +1629,6 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                g_free(buf2);
        }
 
-       /* override from name according to folder properties */
-       if (msginfo->folder && msginfo->folder->prefs &&
-               msginfo->folder->prefs->forward_with_format &&
-               msginfo->folder->prefs->forward_override_from_format &&
-               *msginfo->folder->prefs->forward_override_from_format != '\0') {
-
-               gchar *tmp = NULL;
-               gchar *buf = NULL;
-               MsgInfo *full_msginfo = NULL;
-
-               if (!as_attach)
-                       full_msginfo = procmsg_msginfo_get_full_info(msginfo);
-               if (!full_msginfo)
-                       full_msginfo = procmsg_msginfo_copy(msginfo);
-
-               /* decode \-escape sequences in the internal representation of the quote format */
-               tmp = malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
-               pref_get_unescaped_pref(tmp, msginfo->folder->prefs->forward_override_from_format);
-
-#ifdef USE_ASPELL
-               quote_fmt_init(full_msginfo, NULL, NULL, FALSE, compose->account, FALSE,
-                               compose->gtkaspell);
-#else
-               quote_fmt_init(full_msginfo, NULL, NULL, FALSE, compose->account, FALSE);
-#endif
-               quote_fmt_scan_string(tmp);
-               quote_fmt_parse();
-
-               buf = quote_fmt_get_buffer();
-               if (buf == NULL)
-                       alertpanel_error(_("Message forward From format error."));
-               else
-                       gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
-               quote_fmt_reset_vartable();
-
-               g_free(tmp);
-               procmsg_msginfo_free(full_msginfo);
-       }
-
        textview = GTK_TEXT_VIEW(compose->text);
        textbuf = gtk_text_view_get_buffer(textview);
        compose_create_tags(textview, compose);
@@ -1872,42 +1767,6 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_
 
        compose->updating = TRUE;
 
-       /* override from name according to folder properties */
-       if (msginfo_list->data) {
-               MsgInfo *msginfo = msginfo_list->data;
-
-               if (msginfo->folder && msginfo->folder->prefs &&
-                       msginfo->folder->prefs->forward_with_format &&
-                       msginfo->folder->prefs->forward_override_from_format &&
-                       *msginfo->folder->prefs->forward_override_from_format != '\0') {
-
-                       gchar *tmp = NULL;
-                       gchar *buf = NULL;
-
-                       /* decode \-escape sequences in the internal representation of the quote format */
-                       tmp = malloc(strlen(msginfo->folder->prefs->forward_override_from_format)+1);
-                       pref_get_unescaped_pref(tmp, msginfo->folder->prefs->forward_override_from_format);
-
-#ifdef USE_ASPELL
-                       quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
-                                       compose->gtkaspell);
-#else
-                       quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE);
-#endif
-                       quote_fmt_scan_string(tmp);
-                       quote_fmt_parse();
-
-                       buf = quote_fmt_get_buffer();
-                       if (buf == NULL)
-                               alertpanel_error(_("Message forward From format error."));
-                       else
-                               gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
-                       quote_fmt_reset_vartable();
-
-                       g_free(tmp);
-               }
-       }
-
        textview = GTK_TEXT_VIEW(compose->text);
        textbuf = gtk_text_view_get_buffer(textview);
        compose_create_tags(textview, compose);
@@ -7669,24 +7528,6 @@ static void compose_template_apply_fields(Compose *compose, Template *tmpl)
                msginfo = dummyinfo;
        }
 
-       if (tmpl->from && *tmpl->from != '\0') {
-#ifdef USE_ASPELL
-               quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
-                               compose->gtkaspell);
-#else
-               quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE);
-#endif
-               quote_fmt_scan_string(tmpl->from);
-               quote_fmt_parse();
-
-               buf = quote_fmt_get_buffer();
-               if (buf == NULL) {
-                       alertpanel_error(_("Template From format error."));
-               } else {
-                       gtk_entry_set_text(GTK_ENTRY(compose->from_name), buf);
-               }
-       }
-
        if (tmpl->to && *tmpl->to != '\0') {
 #ifdef USE_ASPELL
                quote_fmt_init(msginfo, NULL, NULL, FALSE, compose->account, FALSE,
index 63844f3..a6c0726 100644 (file)
@@ -83,24 +83,18 @@ static PrefParam param[] = {
 
        {"compose_with_format", "FALSE", &tmp_prefs.compose_with_format, P_BOOL,
         NULL, NULL, NULL},
-       {"compose_override_from_format", NULL, &tmp_prefs.compose_override_from_format, P_STRING,
-        NULL, NULL, NULL},
        {"compose_subject_format", NULL, &tmp_prefs.compose_subject_format, P_STRING,
         NULL, NULL, NULL},
        {"compose_body_format", NULL, &tmp_prefs.compose_body_format, P_STRING,
         NULL, NULL, NULL},
        {"reply_with_format", "FALSE", &tmp_prefs.reply_with_format, P_BOOL,
         NULL, NULL, NULL},
-       {"reply_override_from_format", NULL, &tmp_prefs.reply_override_from_format, P_STRING,
-        NULL, NULL, NULL},
        {"reply_quotemark", NULL, &tmp_prefs.reply_quotemark, P_STRING,
         NULL, NULL, NULL},
        {"reply_body_format", NULL, &tmp_prefs.reply_body_format, P_STRING,
         NULL, NULL, NULL},
        {"forward_with_format", "FALSE", &tmp_prefs.forward_with_format, P_BOOL,
         NULL, NULL, NULL},
-       {"forward_override_from_format", NULL, &tmp_prefs.forward_override_from_format, P_STRING,
-        NULL, NULL, NULL},
        {"forward_quotemark", NULL, &tmp_prefs.forward_quotemark, P_STRING,
         NULL, NULL, NULL},
        {"forward_body_format", NULL, &tmp_prefs.forward_body_format, P_STRING,
index f07f259..73b3ecd 100644 (file)
@@ -60,16 +60,13 @@ struct _FolderItemPrefs {
        guint color;
 
        gboolean compose_with_format;
-       gchar *compose_override_from_format;
        gchar *compose_subject_format;
        gchar *compose_body_format;
        gboolean reply_with_format;
        gchar *reply_quotemark;
-       gchar *reply_override_from_format;
        gchar *reply_body_format;
        gboolean forward_with_format;
        gchar *forward_quotemark;
-       gchar *forward_override_from_format;
        gchar *forward_body_format;
 };
 
index fab1b1a..ae19907 100644 (file)
@@ -2051,7 +2051,6 @@ static void templates_create_widget_func(PrefsPage * _page,
                                window,
                                vbox2,
                                &page->checkbtn_compose_with_format,
-                               NULL,
                                &page->compose_subject_format,
                                &page->compose_body_format,
                                FALSE);
@@ -2066,7 +2065,6 @@ static void templates_create_widget_func(PrefsPage * _page,
                                window,
                                vbox2,
                                &page->checkbtn_reply_with_format,
-                               NULL,
                                &page->reply_quotemark,
                                &page->reply_body_format,
                                FALSE);
@@ -2081,7 +2079,6 @@ static void templates_create_widget_func(PrefsPage * _page,
                                window,
                                vbox2,
                                &page->checkbtn_forward_with_format,
-                               NULL,
                                &page->forward_quotemark,
                                &page->forward_body_format,
                                FALSE);
@@ -2923,15 +2920,12 @@ static void templates_save_func(PrefsPage *_page)
                return;
 
        quotefmt_check_new_msg_formats(tmp_ac_prefs.compose_with_format,
-                                                                       NULL,
                                                                        tmp_ac_prefs.compose_subject_format,
                                                                        tmp_ac_prefs.compose_body_format);
        quotefmt_check_reply_formats(tmp_ac_prefs.reply_with_format,
-                                                                       NULL,
                                                                        tmp_ac_prefs.reply_quotemark,
                                                                        tmp_ac_prefs.reply_body_format);
        quotefmt_check_forward_formats(tmp_ac_prefs.forward_with_format,
-                                                                       NULL,
                                                                        tmp_ac_prefs.forward_quotemark,
                                                                        tmp_ac_prefs.forward_body_format);
        if (prefs_templates_apply() >= 0)
index b833e14..2e29a91 100644 (file)
@@ -150,16 +150,13 @@ struct _FolderItemTemplatesPage
        GtkWidget *window;
        GtkWidget *table;
        GtkWidget *checkbtn_compose_with_format;
-       GtkWidget *compose_override_from_format;
        GtkWidget *compose_subject_format;
        GtkWidget *compose_body_format;
        GtkWidget *checkbtn_reply_with_format;
        GtkWidget *reply_quotemark;
-       GtkWidget *reply_override_from_format;
        GtkWidget *reply_body_format;
        GtkWidget *checkbtn_forward_with_format;
        GtkWidget *forward_quotemark;
-       GtkWidget *forward_override_from_format;
        GtkWidget *forward_body_format;
 
        /* apply to sub folders */
@@ -1180,7 +1177,6 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
                                window,
                                vbox,
                                &page->checkbtn_compose_with_format,
-                               &page->compose_override_from_format,
                                &page->compose_subject_format,
                                &page->compose_body_format,
                                FALSE);
@@ -1199,7 +1195,6 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
                                window,
                                vbox,
                                &page->checkbtn_reply_with_format,
-                               &page->reply_override_from_format,
                                &page->reply_quotemark,
                                &page->reply_body_format,
                                FALSE);
@@ -1218,7 +1213,6 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
                                window,
                                vbox,
                                &page->checkbtn_forward_with_format,
-                               &page->forward_override_from_format,
                                &page->forward_quotemark,
                                &page->forward_body_format,
                                FALSE);
@@ -1233,8 +1227,6 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format),
                        item->prefs->compose_with_format);
-       pref_set_entry_from_pref(GTK_ENTRY(page->compose_override_from_format),
-                       item->prefs->compose_override_from_format);
        pref_set_entry_from_pref(GTK_ENTRY(page->compose_subject_format),
                        item->prefs->compose_subject_format);
        pref_set_textview_from_pref(GTK_TEXT_VIEW(page->compose_body_format),
@@ -1244,8 +1236,6 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
                        item->prefs->reply_with_format);
        pref_set_entry_from_pref(GTK_ENTRY(page->reply_quotemark),
                        item->prefs->reply_quotemark);
-       pref_set_entry_from_pref(GTK_ENTRY(page->reply_override_from_format),
-                       item->prefs->reply_override_from_format);
        pref_set_textview_from_pref(GTK_TEXT_VIEW(page->reply_body_format),
                        item->prefs->reply_body_format);
 
@@ -1253,8 +1243,6 @@ static void prefs_folder_item_templates_create_widget_func(PrefsPage * page_,
                        item->prefs->forward_with_format);
        pref_set_entry_from_pref(GTK_ENTRY(page->forward_quotemark),
                        item->prefs->forward_quotemark);
-       pref_set_entry_from_pref(GTK_ENTRY(page->forward_override_from_format),
-                       item->prefs->forward_override_from_format);
        pref_set_textview_from_pref(GTK_TEXT_VIEW(page->forward_body_format),
                        item->prefs->forward_body_format);
 
@@ -1297,14 +1285,11 @@ static void templates_save_folder_prefs(FolderItem *folder, FolderItemTemplatesP
        if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->new_msg_format_rec_checkbtn))) {
                prefs->compose_with_format =
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format));
-               prefs->compose_override_from_format = pref_get_pref_from_entry(
-                               GTK_ENTRY(page->compose_override_from_format));
                prefs->compose_subject_format = pref_get_pref_from_entry(
                                GTK_ENTRY(page->compose_subject_format));
                prefs->compose_body_format = pref_get_pref_from_textview(
                                GTK_TEXT_VIEW(page->compose_body_format));
                quotefmt_check_new_msg_formats(prefs->compose_with_format,
-                                                                               prefs->compose_override_from_format,
                                                                                prefs->compose_subject_format,
                                                                                prefs->compose_body_format);
        }
@@ -1314,12 +1299,9 @@ static void templates_save_folder_prefs(FolderItem *folder, FolderItemTemplatesP
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_reply_with_format));
                prefs->reply_quotemark = gtk_editable_get_chars(
                                GTK_EDITABLE(page->reply_quotemark), 0, -1);
-               prefs->reply_override_from_format = pref_get_pref_from_entry(
-                               GTK_ENTRY(page->reply_override_from_format));
                prefs->reply_body_format = pref_get_pref_from_textview(
                                GTK_TEXT_VIEW(page->reply_body_format));
                quotefmt_check_reply_formats(prefs->reply_with_format,
-                                                                               prefs->reply_override_from_format,
                                                                                prefs->reply_quotemark,
                                                                                prefs->reply_body_format);
        }
@@ -1329,12 +1311,9 @@ static void templates_save_folder_prefs(FolderItem *folder, FolderItemTemplatesP
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_forward_with_format));
                prefs->forward_quotemark = gtk_editable_get_chars(
                                GTK_EDITABLE(page->forward_quotemark), 0, -1);
-               prefs->forward_override_from_format = pref_get_pref_from_entry(
-                               GTK_ENTRY(page->forward_override_from_format));
                prefs->forward_body_format = pref_get_pref_from_textview(
                                GTK_TEXT_VIEW(page->forward_body_format));
                quotefmt_check_forward_formats(prefs->forward_with_format,
-                                                                               prefs->forward_override_from_format,
                                                                                prefs->forward_quotemark,
                                                                                prefs->forward_body_format);
        }
index 0900c0b..998316c 100644 (file)
@@ -84,7 +84,6 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
                                window,
                                vbox2,
                                &prefs_quote->checkbtn_compose_with_format,
-                               NULL,
                                &prefs_quote->entry_subject,
                                &prefs_quote->text_format,
                                FALSE);
@@ -99,7 +98,6 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
                                window,
                                vbox2,
                                NULL,
-                               NULL,
                                &prefs_quote->entry_quotemark,
                                &prefs_quote->text_quotefmt,
                                FALSE);
@@ -114,7 +112,6 @@ static void prefs_quote_create_widget(PrefsPage *_page, GtkWindow *window,
                                window,
                                vbox2,
                                NULL,
-                               NULL,
                                &prefs_quote->entry_fw_quotemark,
                                &prefs_quote->text_fw_quotefmt,
                                FALSE);
@@ -167,27 +164,20 @@ static void prefs_quote_save(PrefsPage *_page)
        prefs_common.compose_body_format = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_format));
        quotefmt_check_new_msg_formats(prefs_common.compose_with_format,
-                                                                  NULL,
-                                                                  prefs_common.compose_subject_format,
-                                                                  prefs_common.compose_body_format);
+                                                                       prefs_common.compose_subject_format,
+                                                                       prefs_common.compose_body_format);
 
        prefs_common.quotemark = gtk_editable_get_chars(
                        GTK_EDITABLE(page->entry_quotemark), 0, -1);
        prefs_common.quotefmt = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_quotefmt));
-       quotefmt_check_reply_formats(TRUE,
-                                                                NULL,
-                                                                prefs_common.quotemark,
-                                                                prefs_common.quotefmt);
+       quotefmt_check_reply_formats(TRUE, prefs_common.quotemark, prefs_common.quotefmt);
 
        prefs_common.fw_quotemark = gtk_editable_get_chars(
                        GTK_EDITABLE(page->entry_fw_quotemark), 0, -1);
        prefs_common.fw_quotefmt = pref_get_pref_from_textview(
                        GTK_TEXT_VIEW(page->text_fw_quotefmt));
-       quotefmt_check_forward_formats(TRUE,
-                                                                  NULL,
-                                                                  prefs_common.fw_quotemark,
-                                                                  prefs_common.fw_quotefmt);
+       quotefmt_check_forward_formats(TRUE, prefs_common.fw_quotemark, prefs_common.fw_quotefmt);
 }
 
 static void prefs_quote_destroy_widget(PrefsPage *_page)
index 240a63f..4190312 100644 (file)
@@ -57,7 +57,6 @@ static struct Templates {
        GtkWidget *list_view;
        GtkWidget *entry_name;
        GtkWidget *entry_subject;
-       GtkWidget *entry_from;
        GtkWidget *entry_to;
        GtkWidget *entry_cc;    
        GtkWidget *entry_bcc;
@@ -133,7 +132,7 @@ static void prefs_template_window_create(void)
        GtkWidget *scrolled_window;
        GtkWidget   *vpaned;
        GtkWidget     *vbox1;
-       GtkWidget       *table; /* including : entry_[name|from|to|cc|bcc|subject] */
+       GtkWidget       *table; /* including : entry_[name|to|cc|bcc|subject] */
        GtkWidget       *scroll2;
        GtkWidget         *text_value;
        GtkWidget     *vbox2;
@@ -210,8 +209,6 @@ static void prefs_template_window_create(void)
        } tab[] = {
                {_("Name"),     &templates.entry_name,          FALSE,
                        _("This name is used as the Menu item")},
-               {_("From"),     &templates.entry_from,          TRUE,
-                       _("Override composing account's From header. This doesn't change the composing account.")},
                {_("To"),       &templates.entry_to,            TRUE,   NULL},
                {_("Cc"),       &templates.entry_cc,            TRUE,   NULL},
                {_("Bcc"),      &templates.entry_bcc,           TRUE,   NULL},
@@ -444,7 +441,6 @@ static void prefs_template_reset_dialog(void)
        GtkTextBuffer *buffer;
 
        gtk_entry_set_text(GTK_ENTRY(templates.entry_name), "");
-       gtk_entry_set_text(GTK_ENTRY(templates.entry_from), "");
        gtk_entry_set_text(GTK_ENTRY(templates.entry_to), "");
        gtk_entry_set_text(GTK_ENTRY(templates.entry_cc), "");
        gtk_entry_set_text(GTK_ENTRY(templates.entry_bcc), "");                 
@@ -592,9 +588,6 @@ static GSList *prefs_template_get_list(void)
                        ntmpl->subject = tmpl->subject && *(tmpl->subject) 
                                         ? g_strdup(tmpl->subject) 
                                         : NULL;
-                       ntmpl->from    = tmpl->from && *(tmpl->from)
-                                        ? g_strdup(tmpl->from)
-                                        : NULL;
                        ntmpl->to      = tmpl->to && *(tmpl->to)
                                         ? g_strdup(tmpl->to)
                                         : NULL;
@@ -646,7 +639,6 @@ static gboolean prefs_template_list_view_set_row(gint row)
        Template *tmpl;
        gchar *name;
        gchar *subject;
-       gchar *from;
        gchar *to;
        gchar *cc;
        gchar *bcc;     
@@ -680,8 +672,6 @@ static gboolean prefs_template_list_view_set_row(gint row)
                g_free(value);
                return FALSE;
        }
-       from = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_from),
-                                   0, -1);
        to = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_to),
                                    0, -1);
        cc = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_cc),
@@ -691,10 +681,6 @@ static gboolean prefs_template_list_view_set_row(gint row)
        subject = gtk_editable_get_chars(GTK_EDITABLE(templates.entry_subject),
                                         0, -1);
 
-       if (from && *from == '\0') {
-               g_free(from);
-               from = NULL;
-       }
        if (to && *to == '\0') {
                g_free(to);
                to = NULL;
@@ -712,12 +698,6 @@ static gboolean prefs_template_list_view_set_row(gint row)
                subject = NULL;
        }
 
-       if (!prefs_template_string_is_valid(to, NULL, FALSE)) {
-               alertpanel_error(_("Template From format error."));
-               g_free(from);
-               g_free(value);
-               return FALSE;
-       }
        if (!prefs_template_string_is_valid(to, NULL, FALSE)) {
                alertpanel_error(_("Template To format error."));
                g_free(to);
@@ -747,7 +727,6 @@ static gboolean prefs_template_list_view_set_row(gint row)
        tmpl->load_filename = NULL;
        tmpl->name = name;
        tmpl->subject = subject;
-       tmpl->from = from;
        tmpl->to = to;
        tmpl->cc = cc;
        tmpl->bcc = bcc;        
@@ -1153,7 +1132,6 @@ static void prefs_template_select_row(GtkTreeView *list_view, GtkTreePath *path)
 
        tmpl_def.name = _("Template");
        tmpl_def.subject = "";
-       tmpl_def.from = "";
        tmpl_def.to = "";
        tmpl_def.cc = "";
        tmpl_def.bcc = "";      
@@ -1164,8 +1142,6 @@ static void prefs_template_select_row(GtkTreeView *list_view, GtkTreePath *path)
                tmpl = &tmpl_def;
 
        gtk_entry_set_text(GTK_ENTRY(templates.entry_name), tmpl->name);
-       gtk_entry_set_text(GTK_ENTRY(templates.entry_from),
-                          tmpl->from ? tmpl->from : "");
        gtk_entry_set_text(GTK_ENTRY(templates.entry_to),
                           tmpl->to ? tmpl->to : "");
        gtk_entry_set_text(GTK_ENTRY(templates.entry_cc),
index 1e82a40..48b00a4 100644 (file)
@@ -117,7 +117,6 @@ void quote_fmt_quote_description(GtkWidget *widget, GtkWidget *pref_window)
 void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
                                                GtkWidget *parent_box,
                                                GtkWidget **checkbtn_compose_with_format,
-                                               GtkWidget **override_from_format,
                                                GtkWidget **edit_subject_format,
                                                GtkWidget **edit_body_format,
                                                gboolean add_info_button)
@@ -125,9 +124,6 @@ void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
        GtkWidget *checkbtn_use_format = NULL;
        GtkWidget *vbox_format;
        GtkWidget *hbox_format;
-       GtkWidget *hbox2_format;
-       GtkWidget *label_from;
-       GtkWidget *entry_from;
        GtkWidget *label_subject;
        GtkWidget *entry_subject;
        GtkWidget *scrolledwin_format;
@@ -151,25 +147,6 @@ void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
        gtk_container_add(GTK_CONTAINER (parent_box), vbox_format);
        gtk_container_set_border_width (GTK_CONTAINER (vbox_format), 8);
 
-       if (override_from_format) {
-               hbox2_format = gtk_hbox_new (FALSE, 8);
-               gtk_widget_show (hbox2_format);
-               gtk_box_pack_start (GTK_BOX (vbox_format), hbox2_format, FALSE, FALSE, 0);
-
-               label_from = gtk_label_new (_("From"));
-               gtk_widget_show (label_from);
-               gtk_box_pack_start (GTK_BOX (hbox2_format), label_from, FALSE, FALSE, 0);
-
-               entry_from = gtk_entry_new ();
-               gtk_widget_show (entry_from);
-               gtk_box_pack_start (GTK_BOX (hbox2_format), entry_from, TRUE, TRUE, 0);
-               gtk_widget_set_size_request (entry_from, 100, -1);
-
-               gtk_tooltips_set_tip(gtk_tooltips_new(), entry_from,
-                               _("Override From header. This doesn't change the account used to compose the new message."),
-                               NULL);
-       }
-
        hbox_format = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox_format);
        gtk_box_pack_start (GTK_BOX (vbox_format), hbox_format, FALSE, FALSE, 0);
@@ -211,8 +188,6 @@ void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
 
        if (checkbtn_compose_with_format) {
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, label_subject);
-               if (override_from_format)
-                       SET_TOGGLE_SENSITIVITY(checkbtn_use_format, entry_from);
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, entry_subject);
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, text_format);
        }
@@ -222,8 +197,6 @@ void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
 
        if (checkbtn_compose_with_format)
                *checkbtn_compose_with_format = checkbtn_use_format;
-       if (override_from_format)
-               *override_from_format = entry_from;
        *edit_subject_format = entry_subject;
        *edit_body_format = text_format;
 }
@@ -231,7 +204,6 @@ void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
 void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
                                                GtkWidget *parent_box,
                                                GtkWidget **checkbtn_reply_with_format,
-                                               GtkWidget **override_from_format,
                                                GtkWidget **edit_reply_quotemark,
                                                GtkWidget **edit_reply_format,
                                                gboolean add_info_button)
@@ -240,11 +212,8 @@ void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
        GtkWidget *vbox_quote;
        GtkWidget *hbox1;
        GtkWidget *hbox2;
-       GtkWidget *hbox3;
        GtkWidget *label_quotemark;
        GtkWidget *entry_quotemark;
-       GtkWidget *label_from;
-       GtkWidget *entry_from;
        GtkWidget *scrolledwin_quotefmt;
        GtkWidget *text_quotefmt;
 
@@ -266,25 +235,6 @@ void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
        gtk_container_add(GTK_CONTAINER (parent_box), vbox_quote);
        gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
 
-       if (override_from_format) {
-               hbox3 = gtk_hbox_new (FALSE, 8);
-               gtk_widget_show (hbox3);
-               gtk_box_pack_start (GTK_BOX (vbox_quote), hbox3, FALSE, FALSE, 0);
-
-               label_from = gtk_label_new (_("From"));
-               gtk_widget_show (label_from);
-               gtk_box_pack_start (GTK_BOX (hbox3), label_from, FALSE, FALSE, 0);
-
-               entry_from = gtk_entry_new ();
-               gtk_widget_show (entry_from);
-               gtk_box_pack_start (GTK_BOX (hbox3), entry_from, TRUE, TRUE, 0);
-               gtk_widget_set_size_request (entry_from, 100, -1);
-
-               gtk_tooltips_set_tip(gtk_tooltips_new(), entry_from,
-                               _("Override From header. This doesn't change the account used to reply."),
-                               NULL);
-       }
-
        hbox1 = gtk_hbox_new (FALSE, 32);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
@@ -331,8 +281,6 @@ void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
        if (checkbtn_reply_with_format) {
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, label_quotemark);
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, entry_quotemark);
-               if (override_from_format)
-                       SET_TOGGLE_SENSITIVITY(checkbtn_use_format, entry_from);
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, text_quotefmt);
        }
 
@@ -342,15 +290,12 @@ void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
        if (checkbtn_reply_with_format)
                *checkbtn_reply_with_format = checkbtn_use_format;
        *edit_reply_quotemark = entry_quotemark;
-       if (override_from_format)
-               *override_from_format = entry_from;
        *edit_reply_format = text_quotefmt;
 }
 
 void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
                                                GtkWidget *parent_box,
                                                GtkWidget **checkbtn_forward_with_format,
-                                               GtkWidget **override_from_format,
                                                GtkWidget **edit_fw_quotemark,
                                                GtkWidget **edit_fw_format,
                                                gboolean add_info_button)
@@ -359,11 +304,8 @@ void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
        GtkWidget *vbox_quote;
        GtkWidget *hbox1;
        GtkWidget *hbox2;
-       GtkWidget *hbox3;
        GtkWidget *label_quotemark;
        GtkWidget *entry_fw_quotemark;
-       GtkWidget *label_from;
-       GtkWidget *entry_from;
        GtkWidget *scrolledwin_quotefmt;
        GtkWidget *text_fw_quotefmt;
 
@@ -385,25 +327,6 @@ void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
        gtk_container_add(GTK_CONTAINER (parent_box), vbox_quote);
        gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
 
-       if (override_from_format) {
-               hbox3 = gtk_hbox_new (FALSE, 8);
-               gtk_widget_show (hbox3);
-               gtk_box_pack_start (GTK_BOX (vbox_quote), hbox3, FALSE, FALSE, 0);
-
-               label_from = gtk_label_new (_("From"));
-               gtk_widget_show (label_from);
-               gtk_box_pack_start (GTK_BOX (hbox3), label_from, FALSE, FALSE, 0);
-
-               entry_from = gtk_entry_new ();
-               gtk_widget_show (entry_from);
-               gtk_box_pack_start (GTK_BOX (hbox3), entry_from, TRUE, TRUE, 0);
-               gtk_widget_set_size_request (entry_from, 100, -1);
-
-               gtk_tooltips_set_tip(gtk_tooltips_new(), entry_from,
-                               _("Override From header. This doesn't change the account used to forward."),
-                               NULL);
-       }
-
        hbox1 = gtk_hbox_new (FALSE, 32);
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
@@ -452,8 +375,6 @@ void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
        if (checkbtn_forward_with_format) {
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, label_quotemark);
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, entry_fw_quotemark);
-               if (override_from_format)
-                       SET_TOGGLE_SENSITIVITY(checkbtn_use_format, entry_from);
                SET_TOGGLE_SENSITIVITY(checkbtn_use_format, text_fw_quotefmt);
        }
 
@@ -463,8 +384,6 @@ void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
        if (checkbtn_forward_with_format)
                *checkbtn_forward_with_format = checkbtn_use_format;
        *edit_fw_quotemark = entry_fw_quotemark;
-       if (override_from_format)
-               *override_from_format = entry_from;
        *edit_fw_format = text_fw_quotefmt;
 }
 
@@ -492,16 +411,12 @@ void quotefmt_add_info_button(GtkWindow *parent_window, GtkWidget *parent_box)
 
 
 void quotefmt_check_new_msg_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
                                                                        gchar *subject_fmt,
                                                                        gchar *body_fmt)
 {
        if (use_format) {
                gint line;
 
-               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, FALSE))
-                       alertpanel_error(_("New message From format error."));
-
                if (!prefs_template_string_is_valid(subject_fmt, NULL, FALSE))
                        alertpanel_error(_("New message subject format error."));
 
@@ -512,7 +427,6 @@ void quotefmt_check_new_msg_formats(gboolean use_format,
 }
 
 void quotefmt_check_reply_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
                                                                        gchar *quotation_mark,
                                                                        gchar *body_fmt)
 {
@@ -522,9 +436,6 @@ void quotefmt_check_reply_formats(gboolean use_format,
                if (!prefs_template_string_is_valid(quotation_mark, NULL, FALSE))
                        alertpanel_error(_("Message reply quotation mark format error."));
 
-               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, FALSE))
-                       alertpanel_error(_("Message reply From format error."));
-
                if (!prefs_template_string_is_valid(body_fmt, &line, TRUE)) {
                        alertpanel_error(_("Message reply format error at line %d."), line);
                }
@@ -532,7 +443,6 @@ void quotefmt_check_reply_formats(gboolean use_format,
 }
 
 void quotefmt_check_forward_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
                                                                        gchar *quotation_mark,
                                                                        gchar *body_fmt)
 {
@@ -542,9 +452,7 @@ void quotefmt_check_forward_formats(gboolean use_format,
                if (!prefs_template_string_is_valid(quotation_mark, NULL, FALSE))
                        alertpanel_error(_("Message forward quotation mark format error."));
 
-               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, FALSE))
-                       alertpanel_error(_("Message forward From format error."));
-
+fprintf(stderr, "\n%s\n", body_fmt);
                if (!prefs_template_string_is_valid(body_fmt, &line, TRUE)) {
                        alertpanel_error(_("Message forward format error at line %d."), line);
                }
index 880a0de..aa1067a 100644 (file)
@@ -33,36 +33,30 @@ gint quote_fmt_get_cursor_pos(void);
 void quotefmt_create_new_msg_fmt_widgets(GtkWindow *parent_window,
                                                GtkWidget *parent_box,
                                                GtkWidget **checkbtn_compose_with_format,
-                                               GtkWidget **override_from_format,
                                                GtkWidget **edit_subject_format,
                                                GtkWidget **edit_body_format,
                                                gboolean add_info_button);
 void quotefmt_create_reply_fmt_widgets(GtkWindow *parent_window,
                                                GtkWidget *parent_box,
                                                GtkWidget **checkbtn_reply_with_format,
-                                               GtkWidget **override_from_format,
                                                GtkWidget **edit_reply_quotemark,
                                                GtkWidget **edit_reply_format,
                                                gboolean add_info_button);
 void quotefmt_create_forward_fmt_widgets(GtkWindow *parent_window,
                                                GtkWidget *parent_box,
                                                GtkWidget **checkbtn_forward_with_format,
-                                               GtkWidget **override_from_format,
                                                GtkWidget **edit_fw_quotemark,
                                                GtkWidget **edit_fw_format,
                                                gboolean add_info_button);
 void quotefmt_add_info_button(GtkWindow *parent_window, GtkWidget *parent_box);
 
 void quotefmt_check_new_msg_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
                                                                        gchar *subject_fmt,
                                                                        gchar *body_fmt);
 void quotefmt_check_reply_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
                                                                        gchar *quotation_mark,
                                                                        gchar *body_fmt);
 void quotefmt_check_forward_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
                                                                        gchar *quotation_mark,
                                                                        gchar *body_fmt);