Created attachment 4946 Source patch As summarized by the title, this patch adds a new confirmation dialog when moving a file to the trash. The motivation for creating this patch was so Thunar would ask me whether I wanted to move a file to the trash. When a user unintentionally presses delete, a user can make a file unknowingly disappear in to the Trash Bin. To avoid this issue, the user now has to confirm whether they actually want to move their respected files to the Trash. I am new to GTK programming, so please review my code if I am committing any errors in GTK programming or violating any XFCE or GUI guidelines. This patch introduces new strings and thus localization and translation is required to be updated if applied.
Created attachment 4947 Screenshot of a file dialog. As of now, the title bar now displays "Confirm File Delete"
It's already been asked/discussed in the past here : http://mail.xfce.org/pipermail/xfce/2012-June/030737.html As said on irc, such a feature would be annoying to 'power users' (but users still using thunar). There's a confirmation dialog for shift-delete since it permanently deletes files without the trash step, in that case the confirmation dialog makes sense - but in the regular delete case, files are not lost - they're in the trash. Users learn from their mistakes, and i'm pretty sure users using delete intentionally want to delete files and would be annoyed by yet another confirmation popup. "You pressed delete. Are you sure you want to delete ?" reminds me of the dumbest behaviours of windows. A 'nicer' way to do it would be to show the confirmation dialog the first time, with a checkbox 'never ask confirmation later' binded to an xfconf property. That way, 'power users' can disable the feature and are not annoyed anymore, and regular joe users gets the confirmation dialog. The patch itself reads good, minor nit on the strings, i dont get the difference between the two (G_LIKELY (n_path_list == 1)) cases.
Some comments: 1. I'm against confirming (by default) deletion of a single file, but this feature could be useful when deleting a large number of files. That's only because restoring a large number of files can be a nuisance. So, my proposal is to have a "confirm-deletion-threshold" in xfconf set by default to "2", which works as follows: - 0 - don't ask for confirmation, - n!=0 - ask for confirmation of deletion of >= n files. 2. Minor HIG issue - it is generally better to be explicit with button labels. Instead of "Yes/No" (which requires the user to re-read the question) use something like "Delete/Cancel". See the "Create new directory" dialog. 3. The dialog does not really show any useful information (you can already get a similar info from the status bar when you use the context menu). So, if you want a dialog, show some information that matters, like the number of files to delete and the list (or a partial list) of their names.
The trash is there to avoid dialogs. So wontfix.
If it's okay, I'd like to give this one another go. I have submitted a new patch that I hope is a useful compromise. It does not change the default behaviour of Thunar, but instead adds a new option in the preferences allowing the user to choose between 3 states: - confirm on trash and delete; - confirm on delete only (default); - never confirm. Confirmation dialogs on trash are an issue that many people feel strongly about both for and against. Therefore, surely the correct solution is to give users the option to choose their own configuration. To support my case, here are three instances from forums / blogs where users of Thunar have specifically expressed desire for this feature: https://forum.xfce.org/viewtopic.php?id=4362 http://forums.fedoraforum.org/showthread.php?t=281385 http://blog.mbirgin.com/?c=page&ID=640&t=makethunarpromptonmovingfilestotrashubuntu Would anyone be willing to review my patch?
Created attachment 6934 New patch - adds configurable option in preferences