Commit 83cc27da authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

ask before emptying the trash or deleting files (#509877) Patch from

2008-02-14  Alexander Larsson  <alexl@redhat.com>

        * libnautilus-private/nautilus-file-operations.c:
	ask before emptying the trash or deleting files (#509877)
	Patch from Cosimo Cecchi and Luca Ferretti


svn path=/trunk/; revision=13750
parent f1320c9c
2008-02-14 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-file-operations.c:
ask before emptying the trash or deleting files (#509877)
Patch from Cosimo Cecchi and Luca Ferretti
2008-02-14 Alexander Larsson <alexl@redhat.com>
* src/file-manager/fm-properties-window.[ch]:
......
......@@ -1111,6 +1111,31 @@ confirm_delete_from_trash (CommonJob *job,
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_trash_auto_value) {
return TRUE;
}
prompt = f (_("Empty all of the items from the trash?"));
response = run_warning (job,
prompt,
f(_("If you choose to empty the trash, all items "
"in it will be permanently lost. Please note "
"that you can also delete them separately.")),
NULL,
GTK_STOCK_CANCEL, GTK_STOCK_DELETE,
NULL);
return (response == 1);
}
static gboolean
confirm_delete_directly (CommonJob *job,
GList *files)
......@@ -4970,11 +4995,13 @@ empty_trash_job (GIOSchedulerJob *io_job,
common->io_job = io_job;
nautilus_progress_info_start (job->common.progress);
for (l = job->trash_dirs;
l != NULL && !job_aborted (common);
l = l->next) {
delete_trash_file (common, l->data, FALSE, TRUE);
if (confirm_empty_trash (common)) {
for (l = job->trash_dirs;
l != NULL && !job_aborted (common);
l = l->next) {
delete_trash_file (common, l->data, FALSE, TRUE);
}
}
g_io_scheduler_job_send_to_mainloop_async (io_job,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment