aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/em-folder-utils.c10
-rw-r--r--mail/mail.error.xml13
2 files changed, 22 insertions, 1 deletions
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 5544d03e70..2ab31e3827 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -460,9 +460,17 @@ em_folder_utils_delete_folder (CamelFolder *folder)
camel_object_ref (folder);
- dialog = e_alert_dialog_new_for_args (parent,
+ if (mail_folder_cache_get_folder_info_flags (mail_folder_cache_get_default (), folder, &flags) && (flags & CAMEL_FOLDER_CHILDREN)) {
+ dialog = e_alert_dialog_new_for_args (parent,
(folder->parent_store && CAMEL_IS_VEE_STORE(folder->parent_store))?"mail:ask-delete-vfolder":"mail:ask-delete-folder",
folder->full_name, NULL);
+ }
+ else {
+ dialog = e_alert_dialog_new_for_args (parent,
+ (folder->parent_store && CAMEL_IS_VEE_STORE(folder->parent_store))?"mail:ask-delete-vfolder-nochild":"mail:ask-delete-folder-nochild",
+ folder->full_name, NULL);
+ }
+
g_object_set_data_full ((GObject *) dialog, "folder", folder, camel_object_unref);
g_signal_connect (dialog, "response", G_CALLBACK (emfu_delete_response), NULL);
gtk_widget_show (dialog);
diff --git a/mail/mail.error.xml b/mail/mail.error.xml
index 6f7b62b615..ef1b5dac94 100644
--- a/mail/mail.error.xml
+++ b/mail/mail.error.xml
@@ -203,6 +203,19 @@ Many email systems add an Apparently-To header to messages that only have BCC re
<button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
</error>
+ <error id="ask-delete-folder-nochild" type="question" default="GTK_RESPONSE_CANCEL">
+ <_primary>Really delete folder "{0}"?</_primary>
+ <_secondary xml:space="preserve">If you delete the folder, all of its contents will be deleted permanently.</_secondary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+ </error>
+
+ <error id="ask-delete-vfolder-nochild" type="question" default="GTK_RESPONSE_CANCEL">
+ <_primary>Really delete folder "{0}"?</_primary>
+ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/>
+ <button stock="gtk-delete" response="GTK_RESPONSE_OK"/>
+ </error>
+
<error id="ask-delete-vfolder-msg" type="question" default="GTK_RESPONSE_CANCEL">
<_primary>Delete messages in Search Folder "{0}"?</_primary>
<_secondary xml:space="preserve">Warning: Deleting messages from a Search Folder will delete the actual message from one of your local or remote folders.