Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv13913

Modified Files:
        TimerRecordDialog.cpp 
Log Message:
Fix logic for Stop vs Cancel. 
Remove Stop button from waiting-to-record dialog -- needs only Cancel. 
Fix indentation. (One of our few coding conventions, 3 spaces.)

Index: TimerRecordDialog.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TimerRecordDialog.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- TimerRecordDialog.cpp       2 Feb 2009 17:11:04 -0000       1.9
+++ TimerRecordDialog.cpp       4 Feb 2009 22:56:46 -0000       1.10
@@ -208,7 +208,13 @@
    if (m_DateTime_Start > wxDateTime::UNow()) 
       updateResult = this->WaitForStart(); 
 
-   if (updateResult == eProgressSuccess)  
+   if (updateResult != eProgressSuccess) 
+   {
+      // Don't proceed, but don't treat it as canceled recording. User just 
canceled waiting. 
+      this->EndModal(wxID_CANCEL);
+      return;
+   }
+   else 
    {
       // Record for specified time.
        AudacityProject* pProject = GetActiveProject();
@@ -224,9 +230,9 @@
 
       wxString strMsg = 
          _("Recording start") + (wxString)wxT(":\t\t")
-                + GetDisplayDate(m_DateTime_Start) + wxT("\n") + _("Recording 
end")
-       + wxT(":\t\t") + GetDisplayDate(m_DateTime_End) + wxT("\n")
-                + _("Duration") + wxT(":\t\t") + m_TimeSpan_Duration.Format(); 
+         + GetDisplayDate(m_DateTime_Start) + wxT("\n") + _("Recording end")
+         + wxT(":\t\t") + GetDisplayDate(m_DateTime_End) + wxT("\n")
+         + _("Duration") + wxT(":\t\t") + m_TimeSpan_Duration.Format(); 
 
       ProgressDialog progress(
                _("Audacity Timer Record Progress"), // const wxString& title,
@@ -257,11 +263,11 @@
       }
       pProject->OnStop();
    }
-   // Maybe we shouldn't return wxID_CANCEL on failure...?
-   if (updateResult == eProgressSuccess || updateResult == eProgressFailed)
-      this->EndModal(wxID_CANCEL);
+   // Let the caller handle cancellation or failure from recording progress. 
+   if (updateResult == eProgressCancelled || updateResult == eProgressFailed)
+      this->EndModal(updateResult);
    else
-     this->EndModal(wxID_OK);
+      this->EndModal(wxID_OK);
 }
 
 wxString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
@@ -435,7 +441,7 @@
        * but hopefully translated by wxwidgets will be inserted into this */
    strMsg.Printf(_("Waiting to start recording at %s.\n"), 
GetDisplayDate(m_DateTime_Start).c_str()); 
    ProgressDialog progress(_("Audacity Timer Record - Waiting for Start"),
-                           strMsg);
+                           strMsg, pdlgHideStopButton);
    wxDateTime startWait_DateTime = wxDateTime::UNow();
    wxTimeSpan waitDuration = m_DateTime_Start - startWait_DateTime;
 


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to