diff -crB nautilus-2.28.0-orig/libnautilus-private/apps_nautilus_preferences.schemas.in nautilus-2.28.0-patched/libnautilus-private/apps_nautilus_preferences.schemas.in *** nautilus-2.28.0-orig/libnautilus-private/apps_nautilus_preferences.schemas.in 2009-08-17 08:24:11.000000000 -0500 --- nautilus-2.28.0-patched/libnautilus-private/apps_nautilus_preferences.schemas.in 2009-10-30 11:23:46.000000000 -0500 *************** *** 217,224 **** ! /schemas/apps/nautilus/preferences/confirm_trash ! /apps/nautilus/preferences/confirm_trash nautilus bool true --- 217,224 ---- ! /schemas/apps/nautilus/preferences/confirm_delete ! /apps/nautilus/preferences/confirm_delete nautilus bool true *************** *** 226,232 **** Whether to ask for confirmation when deleting files, or emptying Trash If set to true, then Nautilus will ask for confirmation when ! you attempt to delete files, or empty the Trash. --- 226,248 ---- Whether to ask for confirmation when deleting files, or emptying Trash If set to true, then Nautilus will ask for confirmation when ! you attempt to delete files, or empty the Trash. No confirmation will be asked ! for moving files to Trash bin. ! ! ! ! ! ! /schemas/apps/nautilus/preferences/confirm_movetotrash ! /apps/nautilus/preferences/confirm_movetotrash ! nautilus ! bool ! false ! ! Whether to ask for confirmation when moving files to the Trash bin ! ! If set to true, then Nautilus will ask for confirmation when ! you attempt to move items to the Trash bin. diff -crB nautilus-2.28.0-orig/libnautilus-private/nautilus-file-operations.c nautilus-2.28.0-patched/libnautilus-private/nautilus-file-operations.c *** nautilus-2.28.0-orig/libnautilus-private/nautilus-file-operations.c 2009-08-17 08:24:11.000000000 -0500 --- nautilus-2.28.0-patched/libnautilus-private/nautilus-file-operations.c 2009-10-30 11:42:14.868381496 -0500 *************** *** 67,73 **** #include "nautilus-trash-monitor.h" #include "nautilus-file-utilities.h" ! static gboolean confirm_trash_auto_value; /* TODO: TESTING!!! */ --- 67,74 ---- #include "nautilus-trash-monitor.h" #include "nautilus-file-utilities.h" ! static gboolean confirm_delete_auto_value; ! static gboolean confirm_movetotrash_auto_value; /* TODO: TESTING!!! */ *************** *** 1009,1016 **** static gboolean setup_autos = FALSE; if (!setup_autos) { setup_autos = TRUE; ! eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH, ! &confirm_trash_auto_value); } } --- 1010,1020 ---- static gboolean setup_autos = FALSE; if (!setup_autos) { setup_autos = TRUE; ! eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_DELETE, ! &confirm_delete_auto_value); ! eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH, ! &confirm_movetotrash_auto_value); ! } } *************** *** 1285,1291 **** int response; /* Just Say Yes if the preference says not to confirm. */ ! if (!confirm_trash_auto_value) { return TRUE; } --- 1289,1295 ---- int response; /* Just Say Yes if the preference says not to confirm. */ ! if (!confirm_delete_auto_value) { return TRUE; } *************** *** 1316,1328 **** } static gboolean confirm_empty_trash (CommonJob *job) { char *prompt; int response; /* Just Say Yes if the preference says not to confirm. */ ! if (!confirm_trash_auto_value) { return TRUE; } --- 1320,1371 ---- } static gboolean + confirm_trash (CommonJob *job, + GList *files) + { + char *prompt; + int file_count; + int response; + + /* Just Say Yes if the preference says not to confirm. */ + if (!confirm_movetotrash_auto_value) { + return TRUE; + } + + file_count = g_list_length (files); + g_assert (file_count > 0); + + if (file_count == 1) { + prompt = f (_("Are you sure you want to trash \"%B\"?"), + files->data); + } else { + prompt = f (ngettext("Are you sure you want to trash " + "the %'d selected item?", + "Are you sure you want to trash " + "the %'d selected items?", + file_count), + file_count); + } + + response = run_warning (job, + prompt, + NULL, + NULL, + FALSE, + GTK_STOCK_CANCEL, GTK_STOCK_DELETE, + NULL); + + return (response == 1); + } + + static gboolean confirm_empty_trash (CommonJob *job) { char *prompt; int response; /* Just Say Yes if the preference says not to confirm. */ ! if (!confirm_delete_auto_value) { return TRUE; } *************** *** 1350,1356 **** int response; /* Just Say Yes if the preference says not to confirm. */ ! if (!confirm_trash_auto_value) { return TRUE; } --- 1393,1399 ---- int response; /* Just Say Yes if the preference says not to confirm. */ ! if (!confirm_delete_auto_value) { return TRUE; } *************** *** 1861,1866 **** --- 1904,1910 ---- GFile *file; gboolean confirmed; CommonJob *common; + gboolean must_confirm_trash; gboolean must_confirm_delete_in_trash; gboolean must_confirm_delete; int files_skipped; *************** *** 1873,1878 **** --- 1917,1923 ---- to_trash_files = NULL; to_delete_files = NULL; + must_confirm_trash = FALSE; must_confirm_delete_in_trash = FALSE; must_confirm_delete = FALSE; files_skipped = 0; *************** *** 1888,1893 **** --- 1933,1939 ---- to_delete_files = g_list_prepend (to_delete_files, file); } else { if (job->try_trash) { + must_confirm_trash = TRUE; to_trash_files = g_list_prepend (to_trash_files, file); } else { must_confirm_delete = TRUE; *************** *** 1913,1920 **** if (to_trash_files != NULL) { to_trash_files = g_list_reverse (to_trash_files); ! ! trash_files (common, to_trash_files, &files_skipped); } g_list_free (to_trash_files); --- 1959,1973 ---- if (to_trash_files != NULL) { to_trash_files = g_list_reverse (to_trash_files); ! confirmed = TRUE; ! if(must_confirm_trash) { ! confirmed = confirm_trash (common, to_trash_files); ! } ! if (confirmed) { ! trash_files (common, to_trash_files, &files_skipped); ! } else { ! job->user_cancel = TRUE; ! } } g_list_free (to_trash_files); diff -crB nautilus-2.28.0-orig/libnautilus-private/nautilus-global-preferences.c nautilus-2.28.0-patched/libnautilus-private/nautilus-global-preferences.c *** nautilus-2.28.0-orig/libnautilus-private/nautilus-global-preferences.c 2009-08-17 08:24:11.000000000 -0500 --- nautilus-2.28.0-patched/libnautilus-private/nautilus-global-preferences.c 2009-10-30 12:10:20.184282059 -0500 *************** *** 248,254 **** PREFERENCE_BOOLEAN, GINT_TO_POINTER (FALSE) }, ! { NAUTILUS_PREFERENCES_CONFIRM_TRASH, PREFERENCE_BOOLEAN, GINT_TO_POINTER (TRUE) }, --- 248,258 ---- PREFERENCE_BOOLEAN, GINT_TO_POINTER (FALSE) }, ! { NAUTILUS_PREFERENCES_CONFIRM_DELETE, ! PREFERENCE_BOOLEAN, ! GINT_TO_POINTER (TRUE) ! }, ! { NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH, PREFERENCE_BOOLEAN, GINT_TO_POINTER (TRUE) }, diff -crB nautilus-2.28.0-orig/libnautilus-private/nautilus-global-preferences.h nautilus-2.28.0-patched/libnautilus-private/nautilus-global-preferences.h *** nautilus-2.28.0-orig/libnautilus-private/nautilus-global-preferences.h 2009-08-17 08:24:11.000000000 -0500 --- nautilus-2.28.0-patched/libnautilus-private/nautilus-global-preferences.h 2009-10-30 12:21:38.322283418 -0500 *************** *** 60,66 **** #define NAUTILUS_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER "preferences/media_autorun_x_content_open_folder" /* Trash options */ ! #define NAUTILUS_PREFERENCES_CONFIRM_TRASH "preferences/confirm_trash" #define NAUTILUS_PREFERENCES_ENABLE_DELETE "preferences/enable_delete" /* Desktop options */ --- 60,67 ---- #define NAUTILUS_PREFERENCES_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER "preferences/media_autorun_x_content_open_folder" /* Trash options */ ! #define NAUTILUS_PREFERENCES_CONFIRM_DELETE "preferences/confirm_delete" ! #define NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH "preferences/confirm_movetotrash" #define NAUTILUS_PREFERENCES_ENABLE_DELETE "preferences/enable_delete" /* Desktop options */ diff -crB nautilus-2.28.0-orig/src/file-manager/fm-directory-view.c nautilus-2.28.0-patched/src/file-manager/fm-directory-view.c *** nautilus-2.28.0-orig/src/file-manager/fm-directory-view.c 2009-09-18 05:22:36.000000000 -0500 --- nautilus-2.28.0-patched/src/file-manager/fm-directory-view.c 2009-10-30 11:26:44.000000000 -0500 *************** *** 155,161 **** static GdkAtom copied_files_atom; static gboolean show_delete_command_auto_value; ! static gboolean confirm_trash_auto_value; static char *scripts_directory_uri; static int scripts_directory_uri_length; --- 155,162 ---- static GdkAtom copied_files_atom; static gboolean show_delete_command_auto_value; ! static gboolean confirm_delete_auto_value; ! static gboolean confirm_movetotrash_auto_value; static char *scripts_directory_uri; static int scripts_directory_uri_length; *************** *** 1871,1878 **** if (!setup_autos) { setup_autos = TRUE; ! eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_TRASH, ! &confirm_trash_auto_value); eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_ENABLE_DELETE, &show_delete_command_auto_value); } --- 1872,1881 ---- if (!setup_autos) { setup_autos = TRUE; ! eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_DELETE, ! &confirm_delete_auto_value); ! eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH, ! &confirm_movetotrash_auto_value); eel_preferences_add_auto_boolean (NAUTILUS_PREFERENCES_ENABLE_DELETE, &show_delete_command_auto_value); } *************** *** 1928,1934 **** gtk_widget_show (GTK_WIDGET (view)); ! eel_preferences_add_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH, schedule_update_menus_callback, view); eel_preferences_add_callback (NAUTILUS_PREFERENCES_ENABLE_DELETE, schedule_update_menus_callback, view); --- 1931,1939 ---- gtk_widget_show (GTK_WIDGET (view)); ! eel_preferences_add_callback (NAUTILUS_PREFERENCES_CONFIRM_DELETE, ! schedule_update_menus_callback, view); ! eel_preferences_add_callback (NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH, schedule_update_menus_callback, view); eel_preferences_add_callback (NAUTILUS_PREFERENCES_ENABLE_DELETE, schedule_update_menus_callback, view); *************** *** 2044,2050 **** view = FM_DIRECTORY_VIEW (object); ! eel_preferences_remove_callback (NAUTILUS_PREFERENCES_CONFIRM_TRASH, schedule_update_menus_callback, view); eel_preferences_remove_callback (NAUTILUS_PREFERENCES_ENABLE_DELETE, schedule_update_menus_callback, view); --- 2049,2057 ---- view = FM_DIRECTORY_VIEW (object); ! eel_preferences_remove_callback (NAUTILUS_PREFERENCES_CONFIRM_DELETE, ! schedule_update_menus_callback, view); ! eel_preferences_remove_callback (NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH, schedule_update_menus_callback, view); eel_preferences_remove_callback (NAUTILUS_PREFERENCES_ENABLE_DELETE, schedule_update_menus_callback, view); diff -crB nautilus-2.28.0-orig/src/nautilus-file-management-properties.c nautilus-2.28.0-patched/src/nautilus-file-management-properties.c *** nautilus-2.28.0-orig/src/nautilus-file-management-properties.c 2009-04-20 05:57:20.000000000 -0500 --- nautilus-2.28.0-patched/src/nautilus-file-management-properties.c 2009-10-30 11:51:04.308328062 -0500 *************** *** 63,69 **** #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALL_COLUMNS_SAME_WIDTH "all_columns_same_width_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_BROWSER_WIDGET "always_use_browser_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_LOCATION_ENTRY_WIDGET "always_use_location_entry_checkbutton" ! #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET "trash_confirm_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET "trash_delete_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_OPEN_NEW_WINDOW_WIDGET "new_window_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET "hidden_files_checkbutton" --- 63,70 ---- #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALL_COLUMNS_SAME_WIDTH "all_columns_same_width_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_BROWSER_WIDGET "always_use_browser_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ALWAYS_USE_LOCATION_ENTRY_WIDGET "always_use_location_entry_checkbutton" ! #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_DELETE_CONFIRM_WIDGET "delete_confirm_checkbutton" ! #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_MOVETOTRASH_CONFIRM_WIDGET "trash_confirm_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET "trash_delete_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_OPEN_NEW_WINDOW_WIDGET "new_window_checkbutton" #define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_SHOW_HIDDEN_WIDGET "hidden_files_checkbutton" *************** *** 716,723 **** NAUTILUS_PREFERENCES_MEDIA_AUTORUN_NEVER); eel_preferences_builder_connect_bool (builder, ! NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_CONFIRM_WIDGET, ! NAUTILUS_PREFERENCES_CONFIRM_TRASH); eel_preferences_builder_connect_bool (builder, NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET, NAUTILUS_PREFERENCES_ENABLE_DELETE); --- 717,727 ---- NAUTILUS_PREFERENCES_MEDIA_AUTORUN_NEVER); eel_preferences_builder_connect_bool (builder, ! NAUTILUS_FILE_MANAGEMENT_PROPERTIES_DELETE_CONFIRM_WIDGET, ! NAUTILUS_PREFERENCES_CONFIRM_DELETE); ! eel_preferences_builder_connect_bool (builder, ! NAUTILUS_FILE_MANAGEMENT_PROPERTIES_MOVETOTRASH_CONFIRM_WIDGET, ! NAUTILUS_PREFERENCES_CONFIRM_MOVETOTRASH); eel_preferences_builder_connect_bool (builder, NAUTILUS_FILE_MANAGEMENT_PROPERTIES_TRASH_DELETE_WIDGET, NAUTILUS_PREFERENCES_ENABLE_DELETE); diff -crB nautilus-2.28.0-orig/src/nautilus-file-management-properties.ui nautilus-2.28.0-patched/src/nautilus-file-management-properties.ui *** nautilus-2.28.0-orig/src/nautilus-file-management-properties.ui 2009-09-18 05:22:36.000000000 -0500 --- nautilus-2.28.0-patched/src/nautilus-file-management-properties.ui 2009-10-30 12:45:49.584664323 -0500 *************** *** 1349,1355 **** False 6 ! True True Ask before _emptying the Trash or deleting files --- 1349,1355 ---- False 6 ! True True Ask before _emptying the Trash or deleting files *************** *** 1367,1372 **** --- 1367,1390 ---- + + True + True + Ask before moving items to the _Trash bin + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + True True