Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv31504/src/gui

Modified Files:
        wxFolderView.cpp wxMsgCmdProc.cpp 
Log Message:
ask for confirmation before using Ctrl-Del (at least the first time); closes bug 675

Index: wxFolderView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderView.cpp,v
retrieving revision 1.602
retrieving revision 1.603
diff -b -u -2 -r1.602 -r1.603
--- wxFolderView.cpp    29 Aug 2002 00:24:27 -0000      1.602
+++ wxFolderView.cpp    1 Sep 2002 23:30:14 -0000       1.603
@@ -4137,6 +4137,10 @@
          if ( event.ControlDown() )
          {
-            m_msgCmdProc->ProcessCommand(WXMENU_MSG_DELETE_EXPUNGE, selections);
+            if ( !m_msgCmdProc->ProcessCommand(WXMENU_MSG_DELETE_EXPUNGE,
+                                               selections) )
+            {
+               // don't move focus, messages were not expunged
             newFocus = -1;
+            }
          }
          else // normal delete

Index: wxMsgCmdProc.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMsgCmdProc.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -b -u -2 -r1.29 -r1.30
--- wxMsgCmdProc.cpp    15 Aug 2002 00:52:18 -0000      1.29
+++ wxMsgCmdProc.cpp    1 Sep 2002 23:30:14 -0000       1.30
@@ -82,4 +82,5 @@
 
 extern const MPersMsgBox *M_MSGBOX_CONFIRM_RESEND;
+extern const MPersMsgBox *M_MSGBOX_CONFIRM_ZAP;
 
 // ----------------------------------------------------------------------------
@@ -168,5 +169,5 @@
 
    void DeleteOrTrashMessages(const UIdArray& selections);
-   void DeleteAndExpungeMessages(const UIdArray& selections);
+   bool DeleteAndExpungeMessages(const UIdArray& selections);
    void UndeleteMessages(const UIdArray& selections);
    void ToggleMessages(const UIdArray& messages);
@@ -641,4 +642,6 @@
    CHECK( !messages.IsEmpty(), false, "no messages to operate on" );
 
+   bool rc = true;
+
    // first process commands which can be reduced to other commands
    MessageTemplateKind templKind;
@@ -811,5 +814,5 @@
 
       case WXMENU_MSG_DELETE_EXPUNGE:
-         DeleteAndExpungeMessages(messages);
+         rc = DeleteAndExpungeMessages(messages);
          break;
 
@@ -870,5 +873,5 @@
    }
 
-   return true;
+   return rc;
 }
 
@@ -1169,7 +1172,27 @@
 }
 
-void
+bool
 MsgCmdProcImpl::DeleteAndExpungeMessages(const UIdArray& selections)
 {
+   if ( !MDialog_YesNoDialog
+         (
+            String::Format
+            (
+               _("Do you really want to permanently delete "
+                 "the %lu selected messages?\n"
+                 "\n"
+                 "Note that it will be impossible to restore them!"),
+               (unsigned long)selections.Count()
+            ),
+            GetFrame(),
+            MDIALOG_YESNOTITLE,
+            M_DLG_NO_DEFAULT | M_DLG_NOT_ON_NO | M_DLG_DISABLE,
+            M_MSGBOX_CONFIRM_ZAP
+         ) )
+   {
+      // cancelled by user
+      return false;
+   }
+
    AsyncStatusHandler *status =
       new AsyncStatusHandler(this, _("Permanently deleting messages..."));
@@ -1177,4 +1200,6 @@
    status->Monitor(m_asmf->DeleteMessages(&selections, true /* expunge */, this),
                    _("Failed to permanently delete messages"));
+
+   return true;
 }
 



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to