Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv22542

Modified Files:
        AudacityApp.cpp AutoRecovery.cpp AutoRecovery.h 
Log Message:
Do autorecovery before parsing command-line arguments.

Index: AutoRecovery.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AutoRecovery.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- AutoRecovery.h      25 Jul 2006 18:50:20 -0000      1.2
+++ AutoRecovery.h      5 Sep 2006 21:25:25 -0000       1.3
@@ -16,7 +16,8 @@
 // Returns: True, if the start of Audacity should continue as normal
 //          False if Audacity should be quit immediately
 //
-bool ShowAutoRecoveryDialogIfNeeded(AudacityProject** pproj);
+bool ShowAutoRecoveryDialogIfNeeded(AudacityProject** pproj,
+                                    bool *didRecoverAnything);
 
 //
 // XML Handler for a <recordingrecovery> tag
@@ -38,3 +39,13 @@
 };
 
 #endif
+
+// Indentation settings for Vim and Emacs.
+// Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3

Index: AutoRecovery.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AutoRecovery.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- AutoRecovery.cpp    6 Aug 2006 10:33:29 -0000       1.5
+++ AutoRecovery.cpp    5 Sep 2006 21:25:25 -0000       1.6
@@ -198,8 +198,12 @@
    return true;
 }
 
-bool ShowAutoRecoveryDialogIfNeeded(AudacityProject** pproj)
+bool ShowAutoRecoveryDialogIfNeeded(AudacityProject** pproj,
+                                    bool *didRecoverAnything)
 {
+   if (didRecoverAnything)
+      *didRecoverAnything = false;
+
    if (HaveFilesToRecover())
    {
       AutoRecoveryDialog dlg(*pproj);
@@ -211,6 +215,8 @@
          return RemoveAllAutoSaveFiles();
    
       case ID_RECOVER_ALL:
+         if (didRecoverAnything)
+            *didRecoverAnything = true;
          return RecoverAllProjects(pproj);
 
       default:
@@ -302,3 +308,13 @@
    
    return NULL;
 }
+
+// Indentation settings for Vim and Emacs.
+// Please do not modify past this point.
+//
+// Local Variables:
+// c-basic-offset: 3
+// indent-tabs-mode: nil
+// End:
+//
+// vim: et sts=3 sw=3

Index: AudacityApp.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/AudacityApp.cpp,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -d -r1.154 -r1.155
--- AudacityApp.cpp     31 Jul 2006 16:37:48 -0000      1.154
+++ AudacityApp.cpp     5 Sep 2006 21:25:25 -0000       1.155
@@ -561,10 +561,26 @@
 
    delete temporarywindow;
 
+   //
+   // Auto-recovery
+   //
+
+   bool didRecoverAnything = false;
+   if (!ShowAutoRecoveryDialogIfNeeded(&project, &didRecoverAnything))
+   {
+      // Important: Prevent deleting any temporary files!
+      DirManager::SetDontDeleteTempFiles();
+      QuitAudacity(true);
+   }
+
+   //
+   // Command-line parsing, but only if we didn't recover
+   //
+
 #if !defined(__CYGWIN__)
 
    // Parse command-line arguments
-   if (argc > 1) {
+   if (argc > 1 && !didRecoverAnything) {
       for (int option = 1; option < argc; option++) {
          if (!argv[option])
             continue;
@@ -633,7 +649,7 @@
 #else
        
    // Cygwin command line parser (by Dave Fancella)
-   if (argc > 1) {
+   if (argc > 1 && !didRecoverAnything) {
       int optionstart = 1;
       bool startAtOffset = false;
                
@@ -719,13 +735,6 @@
 
    gInited = true;
    
-   if (!ShowAutoRecoveryDialogIfNeeded(&project))
-   {
-      // Important: Prevent deleting any temporary files!
-      DirManager::SetDontDeleteTempFiles();
-      QuitAudacity(true);
-   }
-   
    return TRUE;
 }
 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to