Last Comment Bug 179891 - Empty trash should have confirmation dialog
: Empty trash should have confirmation dialog
Product: MailNews Core
Classification: Components
Component: Backend (show other bugs)
: Trunk
: All All
-- enhancement with 3 votes (vote)
: mozilla1.9.1a2
Assigned To: Mats Palmgren (:mats)
: 125865 260175 426492 447658 (view as bug list)
Depends on:
Blocks: 448624
  Show dependency treegraph
Reported: 2002-11-13 02:39 PST by Boris 'pi' Piwinger
Modified: 2013-02-26 23:43 PST (History)
13 users (show)
mkmelin+mozilla: wanted‑thunderbird3+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Patch rev. 1 (6.68 KB, patch)
2007-01-27 16:16 PST, Mats Palmgren (:mats)
mozilla: review+
mozilla: superreview+
Details | Diff | Splinter Review
comm-central patch (4.77 KB, patch)
2008-07-30 21:02 PDT, Mats Palmgren (:mats)
no flags Details | Diff | Splinter Review

Description User image Boris 'pi' Piwinger 2002-11-13 02:39:17 PST
I often hit "empty trash" by mistake (instead of "compact folder"). There is no
way to bring back the messages. So it would be very useful if there were an
(optional) warning, so that you could say no to it.

Comment 1 User image Rainer Bielefeld 2002-11-13 03:38:51 PST
I agree. 
This warning is only required for the function called from "File/Empty Trash",
not in the context-menue.
Comment 2 User image Andy Lyttle 2002-11-13 21:49:00 PST
In the Finder in Mac OS and Mac OS X, hold Option while choosing Empty Trash
from the menu to bypass the warning.  I don't remember in OS9, but in OSX there
is no warning when using the contextual menu.  It would be nice for Mozilla to
behave the same way.

Is there a suitable modifier key on other platforms to bypass the warning when
selecting from the menu, or should that be implemented as Mac-only?
Comment 3 User image Steve McMillen 2003-01-28 23:47:00 PST
I also wish this feature was added.  I actually archive my trash in case I need
to search for a message later and I've lost 2 batches of email as a result the
fact that "Empty Trash" is right in between both "Search Messages" and "Compact
this Folder" in the right click menu.

I think a confirmation should be provided in both the Right Click Menu and the
File menu.

As far as a modifier to bypass, how about the control key.  I think I've seen
that used in other cases for the same behaviour but I can't recall where.
Comment 4 User image Boris 'pi' Piwinger 2003-01-31 06:12:16 PST
*** Bug 125865 has been marked as a duplicate of this bug. ***
Comment 5 User image Eric Scouten 2003-08-21 08:29:53 PDT
I disagree with comment 1 above. There should be a confirm dialog when Empty 
Trash is invoked from the context menu as well. Perhaps a way to satisfy both 
camps is a "Do not show me this dialog again" checkbox.
Comment 6 User image Colin 2004-11-16 08:56:01 PST
This has become no less of a problem, and I have now lost
several batches of mail in my Trash folder accidentally now
when attempting to compress my folders.  There really needs
to be a confirmation dialog on the Empty Trash option under
the File menu.  At the very least, perhaps the Empty Trash
option could be relocated or just removed - it doesn't really
belong there anyway.
Comment 7 User image Albert Feller 2005-03-29 13:07:45 PST
*** Bug 260175 has been marked as a duplicate of this bug. ***
Comment 8 User image Mats Palmgren (:mats) 2007-01-27 16:16:47 PST
Created attachment 253044 [details] [diff] [review]
Patch rev. 1

Use the confirmToProceed() function from bug 189911.
Comment 9 User image David :Bienvenu 2007-02-01 14:26:28 PST
Comment on attachment 253044 [details] [diff] [review]
Patch rev. 1

Thx, Mats, looks good.

One nit - Do we really need two identical don't ask me again strings?

 emptyJunkDontAsk=Don't ask me again.
+emptyTrashDontAsk=Don't ask me again.

are they ever going to be different?

There's some overlap with this code:

We might want to just remove that imap code, and the associated pref, once this goes in.
Comment 10 User image Rod Whiteley 2008-04-02 03:11:52 PDT
*** Bug 426492 has been marked as a duplicate of this bug. ***
Comment 11 User image Shmuel Wolfson 2008-04-02 04:22:40 PDT
I also would like a warning message before permanently deleted emails.
Comment 12 User image Jo Hermans 2008-07-24 07:04:14 PDT
*** Bug 447658 has been marked as a duplicate of this bug. ***
Comment 13 User image Magnus Melin 2008-07-28 23:20:08 PDT
Mats: plan to check this in (with the one nit addressed)? 
Comment 14 User image Mats Palmgren (:mats) 2008-07-30 21:02:38 PDT
Created attachment 331827 [details] [diff] [review]
comm-central patch
Comment 15 User image Mats Palmgren (:mats) 2008-07-30 21:04:27 PDT
(In reply to comment #9)
> One nit - Do we really need two identical don't ask me again strings?

They are needed because confirmToProceed() derives both the
pref name and UI strings from its arg and I think we still
want different prefs for Junk and Trash.  So I checked it
in as is (sorry for the delay).

> We might want to just remove that imap code ...

Filed bug 448624
Comment 16 User image Mats Palmgren (:mats) 2008-07-30 21:05:34 PDT

Comment 17 User image Tyler Downer [:Tyler] 2008-08-05 11:35:26 PDT
Thank you. I like it.
Comment 18 User image Tyler Downer [:Tyler] 2009-02-16 09:57:19 PST
Verified. Sorry for the delay.
Comment 19 User image :aceman 2013-02-25 11:07:50 PST
Does anybody remember why we have to use 2 separate pref sets for this? mail.*.dontAskAgain and mailnews.*.dontAskAgain ?

Can this be cleaned up today? Maybe for backwards compatibility accept both versions but only define defaults for the mailnews.* version?
Comment 20 User image :aceman 2013-02-25 11:23:18 PST
Oh, incomplete sentence: Thunderbird sees both prefs so could use mailnews.* too. Even if we drop support for the mail.* variant immediately, users only will be reprompted and can set the new prefs.

Note You need to log in before you can comment on or make changes to this bug.