add default_reply_to folder option (closes patch 581044)
authorThorsten Maerz <torte@netztorte.de>
Sun, 29 Sep 2002 16:08:20 +0000 (16:08 +0000)
committerThorsten Maerz <torte@netztorte.de>
Sun, 29 Sep 2002 16:08:20 +0000 (16:08 +0000)
ChangeLog.claws
configure.in
src/compose.c
src/prefs_folder_item.c
src/prefs_folder_item.h

index e3aa9bb..002ada6 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-29 [thorsten]  0.8.3claws36
+
+       * src/compose.c
+         src/prefs_folder_item.[ch]
+               add default_reply_to folder option (closes patch 581044)
+
 2002-09-29 [christoph] 0.8.3claws35
 
        * acconfig.h    ** REMOVED **
index d788f59..7ae62a2 100644 (file)
@@ -10,7 +10,7 @@ MINOR_VERSION=8
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws35
+EXTRA_VERSION=claws36
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 10a4052..649e538 100644 (file)
@@ -1638,8 +1638,15 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo,
                compose_entry_append(compose, compose->ml_post,
                                     COMPOSE_TO);
        } else if ((compose->account->protocol != A_NNTP) || followup_and_reply_to) {
-               compose_entry_append(compose,
-                                   ((compose->replyto && !ignore_replyto)
+               if (!(to_all || ignore_replyto)
+                   && msginfo->folder
+                   && msginfo->folder->prefs->enable_default_reply_to) {
+                       compose_entry_append(compose,
+                           msginfo->folder->prefs->default_reply_to,
+                           COMPOSE_TO);
+               } else
+                       compose_entry_append(compose,
+                                   ((compose->replyto && !ignore_replyto)
                                     ? compose->replyto
                                     : msginfo->from ? msginfo->from : ""),
                                     COMPOSE_TO);
index 6e751b2..0191de9 100644 (file)
@@ -51,6 +51,8 @@ struct PrefsFolderItemDialog
        GtkWidget *checkbtn_save_copy_to_folder;
        GtkWidget *checkbtn_default_to;
        GtkWidget *entry_default_to;
+       GtkWidget *checkbtn_default_reply_to;
+       GtkWidget *entry_default_reply_to;
        GtkWidget *checkbtn_simplify_subject;
        GtkWidget *entry_simplify_subject;
        GtkWidget *checkbtn_folder_chmod;
@@ -91,6 +93,10 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"default_to", "", &tmp_prefs.default_to, P_STRING,
         NULL, NULL, NULL},
+       {"enable_default_reply_to", "", &tmp_prefs.enable_default_reply_to, P_BOOL,
+        NULL, NULL, NULL},
+       {"default_reply_to", "", &tmp_prefs.default_reply_to, P_STRING,
+        NULL, NULL, NULL},
        {"enable_simplify_subject", "", &tmp_prefs.enable_simplify_subject, P_BOOL,
         NULL, NULL, NULL},
        {"simplify_subject_regexp", "", &tmp_prefs.simplify_subject_regexp, P_STRING,
@@ -206,6 +212,8 @@ PrefsFolderItem * prefs_folder_item_new(void)
        tmp_prefs.request_return_receipt = FALSE;
        tmp_prefs.enable_default_to = FALSE;
        tmp_prefs.default_to = NULL;
+       tmp_prefs.enable_default_reply_to = FALSE;
+       tmp_prefs.default_reply_to = NULL;
        tmp_prefs.enable_simplify_subject = FALSE;
        tmp_prefs.simplify_subject_regexp = NULL;
        tmp_prefs.enable_folder_chmod = FALSE;
@@ -227,6 +235,8 @@ void prefs_folder_item_free(PrefsFolderItem * prefs)
 {
        if (prefs->default_to) 
                g_free(prefs->default_to);
+       if (prefs->default_reply_to) 
+               g_free(prefs->default_reply_to);
        if (prefs->scoring != NULL)
                prefs_scoring_free(prefs->scoring);
        g_free(prefs);
@@ -266,6 +276,8 @@ void prefs_folder_item_create(void *folderview, FolderItem *item)
        GtkWidget *checkbtn_save_copy_to_folder;
        GtkWidget *checkbtn_default_to;
        GtkWidget *entry_default_to;
+       GtkWidget *checkbtn_default_reply_to;
+       GtkWidget *entry_default_reply_to;
        GtkWidget *checkbtn_simplify_subject;
        GtkWidget *entry_simplify_subject;
        GtkWidget *checkbtn_folder_chmod;
@@ -355,6 +367,23 @@ void prefs_folder_item_create(void *folderview, FolderItem *item)
 
        rowcount++;
 
+       /* Default Reply-To */
+       checkbtn_default_reply_to = gtk_check_button_new_with_label(_("Default Reply-To: "));
+       gtk_widget_show(checkbtn_default_reply_to);
+       gtk_table_attach(GTK_TABLE(table), checkbtn_default_reply_to, 0, 1, 
+                        rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_default_reply_to), 
+                                    item->prefs->enable_default_reply_to);
+
+       entry_default_reply_to = gtk_entry_new();
+       gtk_widget_show(entry_default_reply_to);
+       gtk_table_attach_defaults(GTK_TABLE(table), entry_default_reply_to, 1, 2, rowcount, rowcount + 1);
+       SET_TOGGLE_SENSITIVITY(checkbtn_default_reply_to, entry_default_reply_to);
+       gtk_entry_set_text(GTK_ENTRY(entry_default_reply_to), SAFE_STRING(item->prefs->default_reply_to));
+       address_completion_register_entry(GTK_ENTRY(entry_default_reply_to));
+
+       rowcount++;
+
        /* Simplify Subject */
        checkbtn_simplify_subject = gtk_check_button_new_with_label(_("Simplify Subject RegExp: "));
        gtk_widget_show(checkbtn_simplify_subject);
@@ -482,6 +511,8 @@ void prefs_folder_item_create(void *folderview, FolderItem *item)
        dialog->checkbtn_save_copy_to_folder = checkbtn_save_copy_to_folder;
        dialog->checkbtn_default_to = checkbtn_default_to;
        dialog->entry_default_to = entry_default_to;
+       dialog->checkbtn_default_reply_to = checkbtn_default_reply_to;
+       dialog->entry_default_reply_to = entry_default_reply_to;
        dialog->checkbtn_simplify_subject = checkbtn_simplify_subject;
        dialog->entry_simplify_subject = entry_simplify_subject;
        dialog->checkbtn_folder_chmod = checkbtn_folder_chmod;
@@ -501,6 +532,7 @@ void prefs_folder_item_create(void *folderview, FolderItem *item)
 void prefs_folder_item_destroy(struct PrefsFolderItemDialog *dialog) 
 {
        address_completion_unregister_entry(GTK_ENTRY(dialog->entry_default_to));
+       address_completion_unregister_entry(GTK_ENTRY(dialog->entry_default_reply_to));
        address_completion_end(dialog->window);
        gtk_widget_destroy(dialog->window);
        g_free(dialog);
@@ -547,6 +579,12 @@ void prefs_folder_item_ok_cb(GtkWidget *widget,
        prefs->default_to = 
            gtk_editable_get_chars(GTK_EDITABLE(dialog->entry_default_to), 0, -1);
 
+       prefs->enable_default_reply_to = 
+           gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->checkbtn_default_reply_to));
+       g_free(prefs->default_reply_to);
+       prefs->default_reply_to = 
+           gtk_editable_get_chars(GTK_EDITABLE(dialog->entry_default_reply_to), 0, -1);
+
        prefs->enable_simplify_subject =
            gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->checkbtn_simplify_subject));
        prefs->simplify_subject_regexp = 
index e6d8101..a2aa0aa 100644 (file)
@@ -48,6 +48,8 @@ struct _PrefsFolderItem {
        gboolean request_return_receipt;
        gboolean enable_default_to;
        gchar *default_to;
+       gboolean enable_default_reply_to;
+       gchar *default_reply_to;
        gboolean enable_simplify_subject;
        gchar *simplify_subject_regexp;
        gboolean enable_folder_chmod;