[spambayes-bugs] [ spambayes-Patches-831941 ] Empty Spam Folder menu item

SourceForge.net noreply at sourceforge.net
Mon Jul 19 04:03:04 CEST 2004


Patches item #831941, was opened at 2003-10-29 10:18
Message generated for change (Settings changed) made by anadelonbrin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498105&aid=831941&group_id=61702

Category: Outlook
Group: None
>Status: Closed
Resolution: None
Priority: 3
Submitted By: Kenny Pitt (kpitt)
Assigned to: Mark Hammond (mhammond)
Summary: Empty Spam Folder menu item

Initial Comment:
RFE 788755 asks for a menu item to empty the spam 
folder, and I have seen this requested several times on 
the lists.  I've come up with an initial patch to implement 
this as a menu item on the SpamBayes dropdown.  It 
works very much like the Empty "Deleted Items" Folder 
context menu item, which means it prompts with a 
Yes/No message box before deleting, and just does 
nothing if the spam folder is already empty. 

This seems to work well on my Outlook 2003 setup, but 
probably needs more wide-spread testing before being 
considered entirely stable.

----------------------------------------------------------------------

Comment By: Kenny Pitt (kpitt)
Date: 2004-07-17 03:27

Message:
Logged In: YES 
user_id=859086

I added the Empty Spam Folder option on cvs head, and 
updated RFE 788755 to indicate that the feature will be 
available in version 1.1.  For an extra margin of safety, I 
added menu separators above and below the Empty Spam 
Folder item to make it a little more difficult to select it 
accidentally.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-07-16 13:39

Message:
Logged In: YES 
user_id=552329

It seems that all the concerns have been addressed, and
since the code is somewhat safe in the 1.0 branch, I figure
this might as well be committed, yes?

Unless someone disagrees, I say Kenny should just committ
this to the HEAD now.

----------------------------------------------------------------------

Comment By: Kenny Pitt (kpitt)
Date: 2003-12-23 03:18

Message:
Logged In: YES 
user_id=859086

Oops, the _GetParent() function is module-level in 'manager', 
not class-level in 'BayesManager', so do 'import manager' to 
get access to it.

Also added an information message box when the spam folder 
is already empty.

----------------------------------------------------------------------

Comment By: Kenny Pitt (kpitt)
Date: 2003-12-20 02:39

Message:
Logged In: YES 
user_id=859086

If you turn off the "Warn before deleting items permanently" 
option then Outlook will always empty Deleted Items without 
any confirmation prompt.  Regardless of the warn setting, 
Outlook will silently ignore your request to empty Deleted 
Items if it is already empty.

I like the idea of adding an OK-only message box to inform the 
user that the folder is already empty.  It makes it obvious to 
the user what is going on, and requires no more clicks than 
the confirmation prompt would have required if there had 
been messages to remove.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2003-12-19 13:13

Message:
Logged In: YES 
user_id=31435

What "Empty Deleted Items" does actually depends on how 
the user sets an option (something like "warn before deleting 
items permanently", true by default).  So if you want to 
match Outlook's behavior seamlessly, we can add another 15 
modules to try to figure out how that option is set <wink>).

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-12-19 12:55

Message:
Logged In: YES 
user_id=552329

> Is this how Outlook's "Empty Deleted Items"
> works? Either asks for confirmation, or silently
> does nothing?  (Mine is too full to check :)

Surprisingly, yes.  So if matching Outlook's behaviour is the 
way to go, then no prompt if empty.  OTOH, if we're going to 
track folders by name at some point in the future, rather than 
via ID, then we're perhaps moving away from what Outlook 
does.

----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2003-12-19 12:41

Message:
Logged In: YES 
user_id=14198

'print' statements predate LogDebug - the latter is
generally preferred with a debug level that reflects how
likely it is anyone *really* needs to see it - 0==always, etc

This is looking good, but I still have a query re the
confirmation (I don't think I explained myself well last
time - I agree we *never* want to silently remove items). 
Currently, if there are zero items in the folder, then
selecting the menu item will silently do *nothing*.  I am
concerned that some users will assume it to be broken, as
selecting that menu has no effect in some cases.  Other
cases, it prompts you.  Some users may not make the
distinction between "this time is is empty, last time it wasn't"

Is this how Outlook's "Empty Deleted Items" works?  Either
asks for confirmation, or silently does nothing?  (Mine is
too full to check :)

I would think it better to either say:
* "Are you sure you wish to remove the 0 items" - dumb, but
obvious what is going on and one less branch/dialog.
* A message box saying "already empty - nothing deleted"

What do you think?


----------------------------------------------------------------------

Comment By: Kenny Pitt (kpitt)
Date: 2003-12-18 05:34

Message:
Logged In: YES 
user_id=859086

I knew there had to be a way to generate a combined patch 
file, but didn't know the syntax.  Thanks.  I made the 
AskQuestion/_GetParent changes, and uploaded a partially 
updated patch pending the following questions/comments.  
This is now diff'ed against latest CVS updates from 
anonymous.

I didn't want to do anything "silently" that could irretrievably 
remove messages, but I also didn't want to display a removal 
confirmation question when there was nothing to remove.  I 
added the check for items to avoid the unnecessary 
confirmation, which matches Outlook's Deleted Items 
behavior.  I'd rather not call EmptyFolder silently, but I'll be 
glad to add a message box indicating that there are no items 
to remove if you think it's needed.  I would have preferred to 
just disable the menu item if the folder is empty, but it 
seemed like it would be a lot of trouble to track it properly 
and keep the menu state updated.

I added the print statements for logging so that I could check 
for any problems, and also so that we could diagnose future 
user problems such as, "I used Empty Spam Folder, but the 
spam messages didn't get deleted."  I noticed that there is a 
mixture in addin.py of print and LogDebug.  What are the 
current guidelines for which to use?

----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2003-12-17 20:18

Message:
Logged In: YES 
user_id=14198

This looks like a good start.  manager.py has _GetParent and
AskQuestion - can you update the patch to use these.  Also,
if no items are in the folder, we should display a message
to the user rather than a simple 'print'.  In fact, I see no
real good reason to have the check for items - even with no
items, still silently call EmptyFolder, and if there are no
items, then big deal - the folder is still empty after the
event, so we can consider that it worked Ok.

If possible, attach a patch as a single file - just "cvs -z5
diff -u file1.py file2.py > whatever.patch", then just
upload the .patch (or .diff)

Thanks

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498105&aid=831941&group_id=61702


More information about the Spambayes-bugs mailing list