When designing a user interface, it is always better to beg forgiveness than to ask permission. Whenever you throw up an alert like the above from StickyBrain, you are far more likely to be delaying something the user means to do, than be protecting them from a mistake. Worse, your protective alert-box quickly becomes useless as the user either disables it (using the supplied option), or just learns to click through automatically without thinking.
Instead, your application should quietly do what it's told, but provide a way for the user to recover from mistakes. Make your actions undo-able. Make your deletions un-deletable. Even actions that are not reversible can be quietly delayed in case the user changes their mind (think of the way email clients delay deletion).
You'd think everyone knew this by now, but the existence of an irreversable delete and an intrusive warning alert in a program that is currently being promoted on Apple's .Mac service shows that obviously it's not as widely known as I thought.