allow inheriting folder prefs/properties from the move/copy dialogue when creating...
authorPaul <paul@claws-mail.org>
Thu, 7 May 2020 10:10:41 +0000 (11:10 +0100)
committerPaul <paul@claws-mail.org>
Thu, 7 May 2020 10:10:41 +0000 (11:10 +0100)
src/foldersel.c

index eedfd03..7d054d0 100644 (file)
@@ -41,6 +41,7 @@
 #include "inputdialog.h"
 #include "folder.h"
 #include "prefs_common.h"
+#include "folder_item_prefs.h"
 
 enum {
        FOLDERSEL_FOLDERNAME,
@@ -569,9 +570,12 @@ static void foldersel_new_folder(GtkButton *button, gpointer data)
                return;
        store = GTK_TREE_STORE(model);
 
-       new_folder = input_dialog(_("New folder"),
-                                 _("Input the name of new folder:"),
-                                 _("NewFolder"));
+       new_folder = input_dialog_with_checkbtn(_("New folder"),
+               _("Input the name of new folder:"),
+               _("NewFolder"),
+               _("Inherit properties and processing rules from parent folder"),
+               &(prefs_common.inherit_folder_props));
+
        if (!new_folder) return;
        AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
 
@@ -605,6 +609,10 @@ static void foldersel_new_folder(GtkButton *button, gpointer data)
                return;
        }
 
+       if (prefs_common.inherit_folder_props) {
+               folder_item_prefs_copy_prefs(selected_item, new_item);
+       }
+
        /* add new child */
        foldersel_append_item(store, new_item, &new_child, &selected);