Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5730/src/gui

Modified Files:
        wxAttachDialog.cpp wxComposeView.cpp 
Log Message:
don't add the attachment if the user cancelled the dialog where its properties are 
edited immediately after selecting the file to be attached

Index: wxAttachDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxAttachDialog.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -u -2 -r1.8 -r1.9
--- wxAttachDialog.cpp  11 Oct 2003 23:13:46 -0000      1.8
+++ wxAttachDialog.cpp  2 Jul 2004 21:37:10 -0000       1.9
@@ -246,12 +246,21 @@
 ShowAttachmentDialog(wxWindow *parent,
                      AttachmentProperties *properties,
-                     bool *allowDisable)
+                     bool& dontShowAgain)
+{
+   CHECK( properties, false, _T("NULL properties in ShowAttachmentDialog") );
+
+   wxAttachmentDialog dlg(parent, properties, &dontShowAgain);
+
+   return dlg.ShowModal() == wxID_OK;
+}
+
+bool
+EditAttachmentProperties(wxWindow *parent, AttachmentProperties *properties)
 {
    CHECK( properties, false, _T("NULL properties in EditAttachmentProperties") );
 
-   wxAttachmentDialog dlg(parent, properties, allowDisable);
+   wxAttachmentDialog dlg(parent, properties, NULL /* no "don't show" box */);
 
    return dlg.ShowModal() == wxID_OK && dlg.HasChanges();
 }
 
-

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.363
retrieving revision 1.364
diff -b -u -2 -r1.363 -r1.364
--- wxComposeView.cpp   17 Jun 2004 22:36:55 -0000      1.363
+++ wxComposeView.cpp   2 Jul 2004 21:37:11 -0000       1.364
@@ -728,5 +728,5 @@
    props.mimetype = part->GetMimeType();
 
-   if ( ShowAttachmentDialog(win, &props) )
+   if ( EditAttachmentProperties(win, &props) )
    {
       part->SetFile(props.filename);
@@ -3595,5 +3595,13 @@
       bool dontShowAgain = false;
 
-      ShowAttachmentDialog(m_editor->GetWindow(), &props, &dontShowAgain);
+      if ( !ShowAttachmentDialog(m_editor->GetWindow(),
+                                 &props,
+                                 dontShowAgain) )
+      {
+         // adding the attachment was cancelled
+         wxLogStatus(this, _("Attachment not added."));
+
+         return;
+      }
 
       mc->SetName(props.name);



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to