Update of /cvsroot/audacity/audacity-src/src
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32396

Modified Files:
        Project.cpp 
Log Message:
Addressing P1: P1 Overwriting existing project makes the original unusable, and 
SaveAs doesn't prompt the overwrite.

This was done by preventing users from overwriting projects on SaveAs().  A 
dialog shows up with a message after the user presses OK.


Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.476
retrieving revision 1.477
diff -u -d -r1.476 -r1.477
--- Project.cpp 4 Dec 2009 03:24:59 -0000       1.476
+++ Project.cpp 8 Dec 2009 21:00:39 -0000       1.477
@@ -3389,6 +3389,15 @@
       fName = fName.Mid(0, len - 4);
 
    wxString oldFileName = mFileName;
+
+   //check to see if the new project file already exists.  
+   //We should only overwrite it if this project already has the same name, 
where the user
+   //simply chose to use the save as command although the save command would 
have the effect.
+   if(mFileName!=fName+ext && wxFileExists(fName+ext)) {
+      wxMessageDialog m(NULL, _("The project was not saved because the file 
name provided would overwrite another project.\nPlease try again and select an 
original name."), _("Error Saving Project"), wxOK|wxICON_ERROR);
+      m.ShowModal();
+      return false;
+   }
    
    mFileName = fName + ext;
    SetProjectTitle();


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Audacity-cvs mailing list
Audacity-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to