Audacity  2.2.2
TimerRecordDialog.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  TimerRecordDialog.cpp
6 
7  Copyright 2006-2009 by Vaughan Johnson
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14 *******************************************************************//*******************************************************************/
20 
21 #include "Audacity.h"
22 #include "TimerRecordDialog.h"
23 #include "FileNames.h"
24 
25 #include <wx/defs.h>
26 #include <wx/dir.h>
27 #include <wx/datetime.h>
28 #include <wx/filedlg.h>
29 #include <wx/intl.h>
30 #include <wx/progdlg.h>
31 #include <wx/sizer.h>
32 #include <wx/string.h>
33 #include <wx/timer.h>
34 #include <wx/dynlib.h> //<! For windows.h
35 
36 #include "ShuttleGui.h"
37 #include "Project.h"
38 #include "Internat.h"
39 #include "Prefs.h"
41 #include "widgets/HelpSystem.h"
42 #include "widgets/ErrorDialog.h"
44 
45 #if wxUSE_ACCESSIBILITY
47 #endif
48 
49 #define TIMER_ID 7000
50 
51 enum { // control IDs
63 };
64 
65 enum {
68 };
69 
70 // Post Timer Recording Actions
71 // Ensure this matches the enum in Menus.cpp
72 enum {
80 };
81 
82 const int kTimerInterval = 50; // ms
83 
84 static double wxDateTime_to_AudacityTime(wxDateTime& dateTime)
85 {
86  return (dateTime.GetHour() * 3600.0) + (dateTime.GetMinute() * 60.0) + dateTime.GetSecond();
87 };
88 
89 
90 // The purpose of the DatePickerCtrlAx class is to make to wxDatePickerCtrl more accessible for
91 // the NVDA screen reader.
92 // By default the msaa state of wxDatePickerCtrl is always normal (0x0), and this causes nvda not
93 // to read the control when the user tabs to it. This class
94 // modifies the state to be focusable + focused (when it's the focus).
95 // Note that even with this class NVDA still doesn't read the NEW selected part of the control when left/right
96 // arrow keys are used.
97 
98 #if wxUSE_ACCESSIBILITY
99 
100 class DatePickerCtrlAx final : public WindowAccessible
101 {
102 public:
103  DatePickerCtrlAx(wxDatePickerCtrl * ctrl) : WindowAccessible(ctrl), mCtrl(ctrl) {};
104 
105  virtual ~ DatePickerCtrlAx() {};
106 
107  // Returns a state constant.
108  wxAccStatus GetState(int childId, long *state) override;
109 
110 private:
111  wxDatePickerCtrl *mCtrl;
112 };
113 
114 // Returns a state constant.
115 wxAccStatus DatePickerCtrlAx::GetState(int WXUNUSED(childId), long *state)
116 {
117  *state = wxACC_STATE_SYSTEM_FOCUSABLE;
118  *state |= (mCtrl == wxWindow::FindFocus() ? wxACC_STATE_SYSTEM_FOCUSED : 0);
119 
120  return wxACC_OK;
121 }
122 
123 #endif // wxUSE_ACCESSIBILITY
124 
125 
126 BEGIN_EVENT_TABLE(TimerRecordDialog, wxDialogWrapper)
127  EVT_DATE_CHANGED(ID_DATEPICKER_START, TimerRecordDialog::OnDatePicker_Start)
128  EVT_TEXT(ID_TIMETEXT_START, TimerRecordDialog::OnTimeText_Start)
129 
130  EVT_DATE_CHANGED(ID_DATEPICKER_END, TimerRecordDialog::OnDatePicker_End)
131  EVT_TEXT(ID_TIMETEXT_END, TimerRecordDialog::OnTimeText_End)
132 
133  EVT_TEXT(ID_TIMETEXT_DURATION, TimerRecordDialog::OnTimeText_Duration)
134 
135  EVT_BUTTON(wxID_OK, TimerRecordDialog::OnOK)
136  EVT_BUTTON(wxID_HELP, TimerRecordDialog::OnHelpButtonClick)
137 
138  EVT_TIMER(TIMER_ID, TimerRecordDialog::OnTimer)
139 
140  EVT_BUTTON(ID_AUTOSAVEPATH_BUTTON, TimerRecordDialog::OnAutoSavePathButton_Click)
141  EVT_BUTTON(ID_AUTOEXPORTPATH_BUTTON, TimerRecordDialog::OnAutoExportPathButton_Click)
142 
143  EVT_CHECKBOX(ID_AUTOSAVE_CHECKBOX, TimerRecordDialog::OnAutoSaveCheckBox_Change)
144  EVT_CHECKBOX(ID_AUTOEXPORT_CHECKBOX, TimerRecordDialog::OnAutoExportCheckBox_Change)
145 
147 
148 TimerRecordDialog::TimerRecordDialog(wxWindow* parent, bool bAlreadySaved)
149 : wxDialogWrapper(parent, -1, _("Audacity Timer Record"), wxDefaultPosition,
150  wxDefaultSize, wxCAPTION)
151 {
152  SetName(GetTitle());
153 
154  m_DateTime_Start = wxDateTime::UNow();
155  long seconds; // default duration is 1 hour = 3600 seconds
156  gPrefs->Read(wxT("/TimerRecord/LastDuration"), &seconds, 3600);
157  m_TimeSpan_Duration = wxTimeSpan::Seconds(seconds);
158  m_DateTime_End = m_DateTime_Start + m_TimeSpan_Duration;
159 
160  m_pDatePickerCtrl_Start = NULL;
161  m_pTimeTextCtrl_Start = NULL;
162 
163  m_pDatePickerCtrl_End = NULL;
164  m_pTimeTextCtrl_End = NULL;
165 
166  m_pTimeTextCtrl_Duration = NULL;
167 
168  // Do we allow the user to change the Automatic Save file?
169  m_bProjectAlreadySaved = bAlreadySaved;
170 
171  ShuttleGui S(this, eIsCreating);
172  this->PopulateOrExchange(S);
173 
174  // Set initial focus to "1" of "01h" in Duration NumericTextCtrl,
175  // instead of OK button (default).
176  m_pTimeTextCtrl_Duration->SetFocus();
177  m_pTimeTextCtrl_Duration->SetFieldFocus(3);
178 
179  m_timer.SetOwner(this, TIMER_ID);
180  m_timer.Start(kTimerInterval);
181 
182  // Do we need to tidy up when the timer recording has been completed?
183  m_bProjectCleanupRequired = !(this->HaveFilesToRecover());
184 
185 }
186 
188 {
189 }
190 
191 void TimerRecordDialog::OnTimer(wxTimerEvent& WXUNUSED(event))
192 {
193  wxDateTime dateTime_UNow = wxDateTime::UNow();
194  if (m_DateTime_Start < dateTime_UNow) {
195  m_DateTime_Start = dateTime_UNow;
198  this->UpdateEnd(); // Keep Duration constant and update End for changed Start.
199  }
200 }
201 
202 void TimerRecordDialog::OnDatePicker_Start(wxDateEvent& WXUNUSED(event))
203 {
205  double dTime = m_pTimeTextCtrl_Start->GetValue();
206  long hr = (long)(dTime / 3600.0);
207  long min = (long)((dTime - (hr * 3600.0)) / 60.0);
208  long sec = (long)(dTime - (hr * 3600.0) - (min * 60.0));
209  m_DateTime_Start.SetHour(hr);
210  m_DateTime_Start.SetMinute(min);
211  m_DateTime_Start.SetSecond(sec);
212 
213  // User might have had the dialog up for a while, or
214  // had a future day, set hour of day less than now's, then changed day to today.
215  wxTimerEvent dummyTimerEvent;
216  this->OnTimer(dummyTimerEvent);
217 
218  // Always update End for changed Start, keeping Duration constant.
219  // Note that OnTimer sometimes calls UpdateEnd, so sometimes this is redundant,
220  // but OnTimer doesn't need to always call UpdateEnd, but we must here.
221  this->UpdateEnd();
222 }
223 
224 void TimerRecordDialog::OnTimeText_Start(wxCommandEvent& WXUNUSED(event))
225 {
226  //v NumericTextCtrl doesn't implement upper ranges, i.e.,
227  // if I tell it "024 h 060 m 060 s", then
228  // user increments the hours past 23, it rolls over to 0
229  // (although if you increment below 0, it stays at 0).
230  // So instead, set the max to 99 and just catch hours > 24 and fix the ctrls.
231  double dTime = m_pTimeTextCtrl_Start->GetValue();
232  long days = (long)(dTime / (24.0 * 3600.0));
233  if (days > 0) {
234  dTime -= (double)days * 24.0 * 3600.0;
235  m_DateTime_Start += wxTimeSpan::Days(days);
238  }
239 
240  wxDateEvent dummyDateEvent;
241  this->OnDatePicker_Start(dummyDateEvent);
242 }
243 
244 void TimerRecordDialog::OnDatePicker_End(wxDateEvent& WXUNUSED(event))
245 {
247  double dTime = m_pTimeTextCtrl_End->GetValue();
248  long hr = (long)(dTime / 3600.0);
249  long min = (long)((dTime - (hr * 3600.0)) / 60.0);
250  long sec = (long)(dTime - (hr * 3600.0) - (min * 60.0));
251  m_DateTime_End.SetHour(hr);
252  m_DateTime_End.SetMinute(min);
253  m_DateTime_End.SetSecond(sec);
254 
255  // DatePickerCtrls use SetRange to make sure End is never less than Start, but
256  // need to implement it for the TimeTextCtrls.
261  }
262 
263  this->UpdateDuration(); // Keep Start constant and update Duration for changed End.
264 }
265 
266 void TimerRecordDialog::OnTimeText_End(wxCommandEvent& WXUNUSED(event))
267 {
268  //v NumericTextCtrl doesn't implement upper ranges, i.e.,
269  // if I tell it "024 h 060 m 060 s", then
270  // user increments the hours past 23, it rolls over to 0
271  // (although if you increment below 0, it stays at 0).
272  // So instead, set the max to 99 and just catch hours > 24 and fix the ctrls.
273  double dTime = m_pTimeTextCtrl_End->GetValue();
274  long days = (long)(dTime / (24.0 * 3600.0));
275  if (days > 0) {
276  dTime -= (double)days * 24.0 * 3600.0;
277  m_DateTime_End += wxTimeSpan::Days(days);
280  }
281 
282  wxDateEvent dummyDateEvent;
283  this->OnDatePicker_End(dummyDateEvent);
284 }
285 
286 void TimerRecordDialog::OnTimeText_Duration(wxCommandEvent& WXUNUSED(event))
287 {
288  double dTime = m_pTimeTextCtrl_Duration->GetValue();
289  long hr = (long)(dTime / 3600.0);
290  long min = (long)((dTime - (hr * 3600.0)) / 60.0);
291  long sec = (long)(dTime - (hr * 3600.0) - (min * 60.0));
292  m_TimeSpan_Duration = wxTimeSpan(hr, min, sec); //v milliseconds?
293 
294  this->UpdateEnd(); // Keep Start constant and update End for changed Duration.
295 }
296 
297 // New events for timer recording automation
298 void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(event))
299 {
301  _("Save Timer Recording As"),
302  m_fnAutoSaveFile.GetPath(),
303  m_fnAutoSaveFile.GetFullName(),
304  wxT("aup"),
305  _("Audacity projects") + wxT(" (*.aup)|*.aup"),
306  wxFD_SAVE | wxRESIZE_BORDER,
307  this);
308 
309  if (fName == wxT(""))
310  return;
311 
312  AudacityProject* pProject = GetActiveProject();
313 
314  // If project already exists then abort - we do not allow users to overwrite an existing project
315  // unless it is the current project.
316  if (wxFileExists(fName) && (pProject->GetFileName() != fName)) {
318  NULL,
319  _("The selected file name could not be used\nfor Timer Recording because it \
320 would overwrite another project.\nPlease try again and select an original name."),
321  _("Error Saving Timer Recording Project"),
322  wxOK|wxICON_ERROR);
323  m.ShowModal();
324  return;
325  }
326 
327  // Set this boolean to false so we now do a SaveAs at the end of the recording
328  // unless we're saving the current project.
329  m_bProjectAlreadySaved = pProject->GetFileName() == fName? true : false;
330 
331  m_fnAutoSaveFile = fName;
332  m_fnAutoSaveFile.SetExt(wxT("aup"));
333  this->UpdateTextBoxControls();
334 }
335 
336 void TimerRecordDialog::OnAutoExportPathButton_Click(wxCommandEvent& WXUNUSED(event))
337 {
338  AudacityProject* pProject = GetActiveProject();
339  Exporter eExporter;
340 
341  // Call the Exporter to set the options required
342  if (eExporter.SetAutoExportOptions(pProject)) {
343  // Populate the options so that we can destroy this instance of the Exporter
348 
349  // Update the text controls
350  this->UpdateTextBoxControls();
351  }
352 }
353 
354 void TimerRecordDialog::OnAutoSaveCheckBox_Change(wxCommandEvent& WXUNUSED(event)) {
356 }
357 
358 void TimerRecordDialog::OnAutoExportCheckBox_Change(wxCommandEvent& WXUNUSED(event)) {
360 }
361 
362 void TimerRecordDialog::OnHelpButtonClick(wxCommandEvent& WXUNUSED(event))
363 {
364  HelpSystem::ShowHelp(this, wxT("Timer_Record"), true);
365 }
366 
367 void TimerRecordDialog::OnOK(wxCommandEvent& WXUNUSED(event))
368 {
369  this->TransferDataFromWindow();
370  if (!m_TimeSpan_Duration.IsPositive())
371  {
372  AudacityMessageBox(_("Duration is zero. Nothing will be recorded."),
373  _("Error in Duration"), wxICON_EXCLAMATION | wxOK);
374  return;
375  }
376 
377  // Validate that we have a Save and/or Export path setup if the appropriate check box is ticked
378  wxString sTemp = m_fnAutoSaveFile.GetFullPath();
379  if (m_pTimerAutoSaveCheckBoxCtrl->IsChecked()) {
380  if (!m_fnAutoSaveFile.IsOk() || m_fnAutoSaveFile.IsDir()) {
381  AudacityMessageBox(_("Automatic Save path is invalid."),
382  _("Error in Automatic Save"), wxICON_EXCLAMATION | wxOK);
383  return;
384  }
385  }
386  if (m_pTimerAutoExportCheckBoxCtrl->IsChecked()) {
387  if (!m_fnAutoExportFile.IsOk() || m_fnAutoExportFile.IsDir()) {
388  AudacityMessageBox(_("Automatic Export path is invalid."),
389  _("Error in Automatic Export"), wxICON_EXCLAMATION | wxOK);
390  return;
391  }
392  }
393 
394  // MY: Estimate here if we have enough disk space to
395  // complete this Timer Recording.
396  // If we dont think there is enough space then ask the user
397  // if they want to continue.
398  // We don't stop the user from starting the recording
399  // as its possible that they plan to free up some
400  // space before the recording begins
401  AudacityProject* pProject = GetActiveProject();
402 
403  // How many minutes do we have left on the disc?
404  int iMinsLeft = pProject->GetEstimatedRecordingMinsLeftOnDisk();
405 
406  // How many minutes will this recording require?
407  int iMinsRecording = m_TimeSpan_Duration.GetMinutes();
408 
409  // Do we have enough space?
410  if (iMinsRecording >= iMinsLeft) {
411 
412  // Format the strings
413  wxString sRemainingTime = "";
414  sRemainingTime = pProject->GetHoursMinsString(iMinsLeft);
415  wxString sPlannedTime = "";
416  sPlannedTime = pProject->GetHoursMinsString(iMinsRecording);
417 
418  // Create the message string
419  wxString sMessage = "";
420  sMessage.Printf(_("You may not have enough free disk space to complete this Timer Recording, based on your current settings.\n\nDo you wish to continue?\n\nPlanned recording duration: %s\nRecording time remaining on disk: %s"),
421  sPlannedTime,
422  sRemainingTime);
423 
424  AudacityMessageDialog dlgMessage(NULL,
425  sMessage,
426  _("Timer Recording Disk Space Warning"),
427  wxYES_NO | wxNO_DEFAULT | wxICON_WARNING);
428  if (dlgMessage.ShowModal() != wxID_YES) {
429  // User decided not to continue - bail out!
430  return;
431  }
432  }
433 
434  m_timer.Stop(); // Don't need to keep updating m_DateTime_Start to prevent backdating.
435  this->EndModal(wxID_OK);
436  wxLongLong duration = m_TimeSpan_Duration.GetSeconds();
437  // this will assert if the duration won't fit in a long
438  gPrefs->Write(wxT("/TimerRecord/LastDuration"), duration.ToLong());
439  gPrefs->Flush();
440 }
441 
442 void TimerRecordDialog::EnableDisableAutoControls(bool bEnable, int iControlGoup) {
443 
444  if (iControlGoup == CONTROL_GROUP_EXPORT) {
445  m_pTimerExportPathTextCtrl->Enable( bEnable );
446  m_pTimerExportPathButtonCtrl->Enable( bEnable);
447  } else if (iControlGoup == CONTROL_GROUP_SAVE) {
448  m_pTimerSavePathTextCtrl->Enable( bEnable);
449  m_pTimerSavePathButtonCtrl->Enable(bEnable );
450  }
451 
452  // Enable or disable the Choice box - if there is no Save or Export then this will be disabled
453  if (m_pTimerAutoSaveCheckBoxCtrl->GetValue() || m_pTimerAutoExportCheckBoxCtrl->GetValue()) {
455  } else {
458  }
459 }
460 
462  // Will update the text box controls
463  m_pTimerSavePathTextCtrl->SetValue(m_fnAutoSaveFile.GetFullPath());
464  m_pTimerExportPathTextCtrl->SetValue(m_fnAutoExportFile.GetFullPath());
465 
466  // MY: Ensure we still display "Current Project" if this has already been saved
468  m_pTimerSavePathTextCtrl->SetValue(_("Current Project"));
469  }
470 }
471 
472 // Copied from AutoRecovery.cpp - for use with Timer Recording Improvements
474 {
475  wxDir dir(FileNames::AutoSaveDir());
476  if (!dir.IsOpened()) {
477  AudacityMessageBox(_("Could not enumerate files in auto save directory."),
478  _("Error"), wxICON_STOP);
479  return false;
480  }
481 
482  wxString filename;
483  bool c = dir.GetFirst(&filename, wxT("*.autosave"), wxDIR_FILES);
484 
485  return c;
486 }
487 
489 {
490  wxArrayString files;
491  wxDir::GetAllFiles(FileNames::AutoSaveDir(), &files,
492  wxT("*.autosave"), wxDIR_FILES);
493 
494  for (unsigned int i = 0; i < files.GetCount(); i++)
495  {
496  if (!wxRemoveFile(files[i]))
497  {
498  // I don't think this error message is actually useful.
499  // -dmazzoni
500  //AudacityMessageBox(_("Could not remove auto save file: " + files[i]),
501  // _("Error"), wxICON_STOP);
502  return false;
503  }
504  }
505 
506  return true;
507 }
508 
512 {
513  AudacityProject* pProject = GetActiveProject();
514 
515  auto updateResult = ProgressResult::Success;
516 
517  if (m_DateTime_Start > wxDateTime::UNow())
518  updateResult = this->WaitForStart();
519 
520  if (updateResult != ProgressResult::Success) {
521  // Don't proceed, but don't treat it as canceled recording. User just canceled waiting.
523  } else {
524  // Record for specified time.
525  pProject->OnRecord(*pProject);
526  bool bIsRecording = true;
527 
528  wxString sPostAction = m_pTimerAfterCompleteChoiceCtrl->GetString(m_pTimerAfterCompleteChoiceCtrl->GetSelection());
529 
530  // Two column layout.
532  auto &column1 = columns[0];
533  auto &column2 = columns[1];
534 
535  column1.push_back( _("Recording start:") );
536  column2.push_back( GetDisplayDate(m_DateTime_Start) );
537 
538  column1.push_back( _("Duration:") );
539  column2.push_back( m_TimeSpan_Duration.Format() );
540 
541  column1.push_back( _("Recording end:") );
542  column2.push_back( GetDisplayDate(m_DateTime_End) );
543 
544  column1.push_back( {} );
545  column2.push_back( {} );
546 
547  column1.push_back( _("Automatic Save enabled:") );
548  column2.push_back( (m_bAutoSaveEnabled ? _("Yes") : _("No")) );
549 
550  column1.push_back( _("Automatic Export enabled:") );
551  column2.push_back( (m_bAutoExportEnabled ? _("Yes") : _("No")) );
552 
553  column1.push_back( _("Action after Timer Recording:") );
554  column2.push_back( sPostAction );
555 
557  progress(m_TimeSpan_Duration.GetMilliseconds().GetValue(),
558  _("Audacity Timer Record Progress"),
559  columns,
561 
562  // Make sure that start and end time are updated, so we always get the full
563  // duration, even if there's some delay getting here.
564  wxTimerEvent dummyTimerEvent;
565  this->OnTimer(dummyTimerEvent);
566 
567  // Loop for progress display during recording.
568  while (bIsRecording && (updateResult == ProgressResult::Success)) {
569  updateResult = progress.UpdateProgress();
570  wxMilliSleep(kTimerInterval);
571  bIsRecording = (wxDateTime::UNow() <= m_DateTime_End); // Call UNow() again for extra accuracy...
572  }
573  }
574 
575  // Must do this AFTER the timer project dialog has been deleted to ensure the application
576  // responds to the AUDIOIO events...see not about bug #334 in the ProgressDialog constructor.
577  pProject->OnStop(*pProject);
578 
579  // Let the caller handle cancellation or failure from recording progress.
580  if (updateResult == ProgressResult::Cancelled || updateResult == ProgressResult::Failed)
582 
583  return ExecutePostRecordActions((updateResult == ProgressResult::Stopped));
584 }
585 
587  // MY: We no longer automatically (and silently) call ->Save() when the
588  // timer recording is completed. We can now Save and/or Export depending
589  // on the options selected by the user.
590  // Once completed, we can also close Audacity, restart the system or
591  // shutdown the system.
592  // If there was any error with the auto save or export then we will not do
593  // the actions requested and instead present an error mesasge to the user.
594  // Finally, if there is no post-record action selected then we output
595  // a dialog detailing what has been carried out instead.
596 
597  AudacityProject* pProject = GetActiveProject();
598 
599  bool bSaveOK = false;
600  bool bExportOK = false;
601  int iPostRecordAction = m_pTimerAfterCompleteChoiceCtrl->GetSelection();
602  int iOverriddenAction = iPostRecordAction;
603  bool bErrorOverride = false;
604 
605  // Do Automatic Save?
606  if (m_bAutoSaveEnabled) {
607 
608  // MY: If this project has already been saved then simply execute a Save here
610  bSaveOK = pProject->Save();
611  } else {
612  bSaveOK = pProject->SaveFromTimerRecording(m_fnAutoSaveFile);
613  }
614  }
615 
616  // Do Automatic Export?
617  if (m_bAutoExportEnabled) {
620  }
621 
622  // Check if we need to override the post recording action
623  bErrorOverride = ((m_bAutoSaveEnabled && !bSaveOK) || (m_bAutoExportEnabled && !bExportOK));
624  if (bErrorOverride || bWasStopped) {
625  iPostRecordAction = POST_TIMER_RECORD_NOTHING;
626  }
627 
628  if (iPostRecordAction == POST_TIMER_RECORD_NOTHING) {
629  // If there is no post-record action then we can show a message indicating what has been done
630 
631  wxString sMessage = (bWasStopped ? _("Timer Recording stopped.") :
632  _("Timer Recording completed."));
633 
634  if (m_bAutoSaveEnabled) {
635  if (bSaveOK) {
636  sMessage.Printf(_("%s\n\nRecording saved: %s"),
637  sMessage, m_fnAutoSaveFile.GetFullPath());
638  } else {
639  sMessage.Printf(_("%s\n\nError saving recording."), sMessage);
640  }
641  }
642  if (m_bAutoExportEnabled) {
643  if (bExportOK) {
644  sMessage.Printf(_("%s\n\nRecording exported: %s"),
645  sMessage, m_fnAutoExportFile.GetFullPath());
646  } else {
647  sMessage.Printf(_("%s\n\nError exporting recording."), sMessage);
648  }
649  }
650 
651  if (bErrorOverride) {
652 
653  if ((iOverriddenAction != iPostRecordAction) &&
654  (iOverriddenAction != POST_TIMER_RECORD_NOTHING)) {
655  // Inform the user that we have overridden the selected action
656  sMessage.Printf(_("%s\n\n'%s' has been canceled due to the error(s) noted above."),
657  sMessage,
658  m_pTimerAfterCompleteChoiceCtrl->GetString(iOverriddenAction));
659  }
660 
661  // Show Error Message Box
662  AudacityMessageBox(sMessage, _("Error"), wxICON_EXCLAMATION | wxOK);
663  } else {
664 
665  if (bWasStopped && (iOverriddenAction != POST_TIMER_RECORD_NOTHING)) {
666  sMessage.Printf(_("%s\n\n'%s' has been canceled as the recording was stopped."),
667  sMessage,
668  m_pTimerAfterCompleteChoiceCtrl->GetString(iOverriddenAction));
669  }
670 
671  AudacityMessageBox(sMessage, _("Timer Recording"), wxICON_INFORMATION | wxOK);
672  }
673  }
674 
675  // MY: Lets do some actions that only apply to Exit/Restart/Shutdown
676  if (iPostRecordAction >= POST_TIMER_RECORD_CLOSE) {
677  do {
678 
679  // Set the flags as appropriate based on what we have done
680  wxUint32 eActionFlags = TR_ACTION_NOTHING;
681  if (m_bAutoSaveEnabled && bSaveOK) {
682  eActionFlags |= TR_ACTION_SAVED;
683  }
684  if (m_bAutoExportEnabled && bExportOK) {
685  eActionFlags |= TR_ACTION_EXPORTED;
686  }
687 
688  // Lets show a warning dialog telling the user what is about to happen.
689  // If the user no longer wants to carry out this action then they can click
690  // Cancel and we will do POST_TIMER_RECORD_NOTHING instead.
691  auto iDelayOutcome = PreActionDelay(iPostRecordAction, (TimerRecordCompletedActions)eActionFlags);
692  if (iDelayOutcome != ProgressResult::Success) {
693  // Cancel the action!
694  iPostRecordAction = POST_TIMER_RECORD_NOTHING;
695  // Set this to true to avoid any chance of the temp files being deleted
696  bErrorOverride = true;
697  break;
698  }
699 
700 
701  // If we have simply recorded, exported and then plan to Exit/Restart/Shutdown
702  // then we will have a temporary project setup. Let's get rid of that!
704  // PRL: Move the following cleanup into a finally?
705  // No, I think you would want to skip this, in case recording
706  // succeeded but then save or export threw an exception.
708  }
709  } while (false);
710  }
711 
712  // Do we need to cleanup the orphaned temporary project?
713  if (m_bProjectCleanupRequired && !bErrorOverride) {
714  // PRL: Move the following cleanup into a finally?
715  // No, I think you would want to skip this, in case recording
716  // succeeded but then save or export threw an exception.
718  }
719 
720  // Return the action as required
721  return iPostRecordAction;
722 }
723 
724 wxString TimerRecordDialog::GetDisplayDate( wxDateTime & dt )
725 {
726 #if defined(__WXMSW__)
727  // On Windows, wxWidgets uses the system date control and it displays the
728  // date based on the Windows locale selected by the user. But, wxDateTime
729  // using the strftime function to return the formatted date. Since the
730  // default locale for the Windows CRT environment is "C", the dates come
731  // back in a different format.
732  //
733  // So, we make direct Windows calls to format the date like it the date
734  // control.
735  //
736  // (Most of this taken from src/msw/datectrl.cpp)
737 
738  const wxDateTime::Tm tm(dt.GetTm());
739  SYSTEMTIME st;
740  wxString s;
741  int len;
742 
743  st.wYear = (WXWORD)tm.year;
744  st.wMonth = (WXWORD)(tm.mon - wxDateTime::Jan + 1);
745  st.wDay = tm.mday;
746  st.wDayOfWeek = st.wMinute = st.wSecond = st.wMilliseconds = 0;
747 
748  len = ::GetDateFormat(LOCALE_USER_DEFAULT,
749  DATE_SHORTDATE,
750  &st,
751  NULL,
752  NULL,
753  0);
754  if (len > 0) {
755  len = ::GetDateFormat(LOCALE_USER_DEFAULT,
756  DATE_SHORTDATE,
757  &st,
758  NULL,
759  wxStringBuffer(s, len),
760  len);
761  if (len > 0) {
762  s += wxT(" ") + dt.FormatTime();
763  return s;
764  }
765  }
766 #endif
767 
768  // Use default formatting
769 wxPrintf(wxT("%s\n"), dt.Format());
770  return dt.FormatDate() + wxT(" ") + dt.FormatTime();
771 }
772 
773 TimerRecordPathCtrl * TimerRecordDialog::NewPathControl(wxWindow *wParent, const int iID,
774  const wxString &sCaption, const wxString &sValue)
775 {
776  TimerRecordPathCtrl * pTextCtrl;
777  wxASSERT(wParent); // to justify safenew
778  pTextCtrl = safenew TimerRecordPathCtrl(wParent, iID, sValue);
779  pTextCtrl->SetName(sCaption);
780  return pTextCtrl;
781 }
782 
784 {
785  bool bAutoSave = gPrefs->ReadBool("/TimerRecord/AutoSave", false);
786  bool bAutoExport = gPrefs->ReadBool("/TimerRecord/AutoExport", false);
787  int iPostTimerRecordAction = gPrefs->ReadLong("/TimerRecord/PostAction", 0);
788 
789  S.SetBorder(5);
790  S.StartMultiColumn(2, wxCENTER);
791  {
792  S.StartVerticalLay(true);
793  {
794  /* i18n-hint: This string is used to configure the controls for times when the recording is
795  * started and stopped. As such it is important that only the alphabetic parts of the string
796  * are translated, with the numbers left exactly as they are.
797  * The 'h' indicates the first number displayed is hours, the 'm' indicates the second number
798  * displayed is minutes, and the 's' indicates that the third number displayed is seconds.
799  */
800  auto strFormat = _("099 h 060 m 060 s");
801  using Options = NumericTextCtrl::Options;
802  S.StartStatic(_("Start Date and Time"), true);
803  {
805  safenew wxDatePickerCtrl(this, // wxWindow *parent,
806  ID_DATEPICKER_START, // wxWindowID id,
807  m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime,
808  // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
809  m_pDatePickerCtrl_Start->SetName(_("Start Date"));
810  m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
811 #if wxUSE_ACCESSIBILITY
812  m_pDatePickerCtrl_Start->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_Start));
813 #endif
815 
818  {}, 0, 44100,
819  Options{}
820  .MenuEnabled(false)
821  .Format(strFormat)
823  m_pTimeTextCtrl_Start->SetName(_("Start Time"));
825  }
826  S.EndStatic();
827 
828  S.StartStatic(_("End Date and Time"), true);
829  {
831  safenew wxDatePickerCtrl(this, // wxWindow *parent,
832  ID_DATEPICKER_END, // wxWindowID id,
833  m_DateTime_End); // const wxDateTime& dt = wxDefaultDateTime,
834  // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
835  // long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
836  // const wxValidator& validator = wxDefaultValidator,
837  // const wxString& name = "datectrl")
838  m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
839  m_pDatePickerCtrl_End->SetName(_("End Date"));
840 #if wxUSE_ACCESSIBILITY
841  m_pDatePickerCtrl_End->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_End));
842 #endif
844 
847  {}, 0, 44100,
848  Options{}
849  .MenuEnabled(false)
850  .Format(strFormat)
852  m_pTimeTextCtrl_End->SetName(_("End Time"));
854  }
855  S.EndStatic();
856 
857  S.StartStatic(_("Duration"), true);
858  {
859  /* i18n-hint: This string is used to configure the controls which shows the recording
860  * duration. As such it is important that only the alphabetic parts of the string
861  * are translated, with the numbers left exactly as they are.
862  * The string 'days' indicates that the first number in the control will be the number of days,
863  * then the 'h' indicates the second number displayed is hours, the 'm' indicates the third
864  * number displayed is minutes, and the 's' indicates that the fourth number displayed is
865  * seconds.
866  */
867  auto strFormat1 = _("099 days 024 h 060 m 060 s");
870  {}, 0, 44100,
871  Options{}
872  .MenuEnabled(false)
873  .Format(strFormat1)
874  .Value(true, m_TimeSpan_Duration.GetSeconds().ToDouble()));
875  m_pTimeTextCtrl_Duration->SetName(_("Duration"));
877  }
878  S.EndStatic();
879  }
880  S.EndVerticalLay();
881 
882  S.StartVerticalLay(true);
883  {
884  S.StartStatic(_("Automatic Save"), true);
885  {
886  // If checked, the project will be saved when the recording is completed
887  m_pTimerAutoSaveCheckBoxCtrl = S.Id(ID_AUTOSAVE_CHECKBOX).AddCheckBox(_("Enable &Automatic Save?"),
888  (bAutoSave ? "true" : "false"));
889  S.StartMultiColumn(3, wxEXPAND);
890  {
891  wxString sInitialValue = wxT("");
892  AudacityProject* pProject = GetActiveProject();
893  wxString sSaveValue = pProject->GetFileName();
894  if (sSaveValue != wxEmptyString) {
895  m_fnAutoSaveFile.Assign(sSaveValue);
896  sInitialValue = _("Current Project");
897  }
898  S.AddPrompt(_("Save Project As:"));
899  m_pTimerSavePathTextCtrl = NewPathControl(this, ID_AUTOSAVEPATH_TEXT, _("Save Project As:"), sInitialValue);
900  m_pTimerSavePathTextCtrl->SetEditable(false);
903  }
904  S.EndMultiColumn();
905  }
906  S.EndStatic();
907 
908  S.StartStatic(_("Automatic Export"), true);
909  {
910  m_pTimerAutoExportCheckBoxCtrl = S.Id(ID_AUTOEXPORT_CHECKBOX).AddCheckBox(_("Enable Automatic &Export?"), (bAutoExport ? "true" : "false"));
911  S.StartMultiColumn(3, wxEXPAND);
912  {
913  S.AddPrompt(_("Export Project As:"));
914  m_pTimerExportPathTextCtrl = NewPathControl(this, ID_AUTOEXPORTPATH_TEXT, _("Export Project As:"), wxT(""));
915  m_pTimerExportPathTextCtrl->SetEditable(false);
918  }
919  S.EndMultiColumn();
920  }
921  S.EndStatic();
922 
923  S.StartStatic(_("Options"), true);
924  {
925 
926  S.StartMultiColumn(1, wxEXPAND);
927  {
928  S.SetStretchyCol( 0 );
929  wxArrayString arrayOptions;
930  arrayOptions.Add(_("Do nothing"));
931  arrayOptions.Add(_("Exit Audacity"));
932  arrayOptions.Add(_("Restart system"));
933  arrayOptions.Add(_("Shutdown system"));
934 
935  m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(0));
936  m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(1));
937 #ifdef __WINDOWS__
938  m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(2));
939  m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(3));
940 #endif
941  m_sTimerAfterCompleteOption = arrayOptions.Item(iPostTimerRecordAction);
942 
943  m_pTimerAfterCompleteChoiceCtrl = S.AddChoice(_("After Recording completes:"),
946  }
947  S.EndMultiColumn();
948  }
949  S.EndStatic();
950 
951  }
952  S.EndVerticalLay();
953  }
954  S.EndMultiColumn();
955 
956  // MY: Added the help button here
958 
959  Layout();
960  Fit();
961  SetMinSize(GetSize());
962  Center();
963 
966 }
967 
969 {
970  double dTime;
971  long hr;
972  long min;
973  long sec;
974 
976  dTime = m_pTimeTextCtrl_Start->GetValue();
977  hr = (long)(dTime / 3600.0);
978  min = (long)((dTime - (hr * 3600.0)) / 60.0);
979  sec = (long)(dTime - (hr * 3600.0) - (min * 60.0));
980  m_DateTime_Start.SetHour(hr);
981  m_DateTime_Start.SetMinute(min);
982  m_DateTime_Start.SetSecond(sec);
983 
985  dTime = m_pTimeTextCtrl_End->GetValue();
986  hr = (long)(dTime / 3600.0);
987  min = (long)((dTime - (hr * 3600.0)) / 60.0);
988  sec = (long)(dTime - (hr * 3600.0) - (min * 60.0));
989  m_DateTime_End.SetHour(hr);
990  m_DateTime_End.SetMinute(min);
991  m_DateTime_End.SetSecond(sec);
992 
994 
995  // Pull the settings from the auto save/export controls and write to the pref file
998 
999  // MY: Obtain the index from the choice control so we can save to the prefs file
1000  int iPostRecordAction = m_pTimerAfterCompleteChoiceCtrl->GetSelection();
1001 
1002  // Save the options back to the prefs file
1003  gPrefs->Write("/TimerRecord/AutoSave", m_bAutoSaveEnabled);
1004  gPrefs->Write("/TimerRecord/AutoExport", m_bAutoExportEnabled);
1005  gPrefs->Write("/TimerRecord/PostAction", iPostRecordAction);
1006 
1007  return true;
1008 }
1009 
1010 // Update m_TimeSpan_Duration and ctrl based on m_DateTime_Start and m_DateTime_End.
1012 {
1014  m_pTimeTextCtrl_Duration->SetValue(m_TimeSpan_Duration.GetSeconds().ToDouble());
1015 }
1016 
1017 // Update m_DateTime_End and ctrls based on m_DateTime_Start and m_TimeSpan_Duration.
1019 {
1020  //v Use remaining disk -> record time calcs from AudacityProject::OnTimer to set range?
1023  m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
1024  m_pDatePickerCtrl_End->Refresh();
1026 }
1027 
1029 {
1030  // MY: The Waiting For Start dialog now shows what actions will occur after recording has completed
1031  wxString sPostAction = m_pTimerAfterCompleteChoiceCtrl->GetString(m_pTimerAfterCompleteChoiceCtrl->GetSelection());
1032 
1033  // Two column layout.
1035  auto &column1 = columns[0];
1036  auto &column2 = columns[1];
1037 
1038  column1.push_back(_("Waiting to start recording at:"));
1039  column2.push_back(GetDisplayDate(m_DateTime_Start));
1040 
1041  column1.push_back(_("Recording duration:"));
1042  column2.push_back(m_TimeSpan_Duration.Format());
1043 
1044  column1.push_back(_("Scheduled to stop at:"));
1045  column2.push_back(GetDisplayDate(m_DateTime_End));
1046 
1047  column1.push_back( {} );
1048  column2.push_back( {} );
1049 
1050  column1.push_back(_("Automatic Save enabled:"));
1051  column2.push_back((m_bAutoSaveEnabled ? _("Yes") : _("No")));
1052 
1053  column1.push_back(_("Automatic Export enabled:"));
1054  column2.push_back((m_bAutoExportEnabled ? _("Yes") : _("No")));
1055 
1056  column1.push_back(_("Action after Timer Recording:"));
1057  column2.push_back(sPostAction);
1058 
1059  wxDateTime startWait_DateTime = wxDateTime::UNow();
1060  wxTimeSpan waitDuration = m_DateTime_Start - startWait_DateTime;
1061  TimerProgressDialog progress(waitDuration.GetMilliseconds().GetValue(),
1062  _("Audacity Timer Record - Waiting for Start"),
1063  columns,
1065  _("Recording will commence in:"));
1066 
1067  auto updateResult = ProgressResult::Success;
1068  bool bIsRecording = false;
1069  while (updateResult == ProgressResult::Success && !bIsRecording)
1070  {
1071  updateResult = progress.UpdateProgress();
1072  wxMilliSleep(kTimerInterval);
1073  bIsRecording = (m_DateTime_Start <= wxDateTime::UNow());
1074  }
1075  return updateResult;
1076 }
1077 
1079 {
1080  wxString sAction = m_pTimerAfterCompleteChoiceCtrl->GetString(iActionIndex);
1081  wxString sCountdownLabel;
1082  sCountdownLabel.Printf("%s in:", sAction);
1083 
1084  // Two column layout.
1086  auto &column1 = columns[0];
1087  auto &column2 = columns[1];
1088 
1089  column1.push_back(_("Timer Recording completed."));
1090  column2.push_back( {} );
1091 
1092  column1.push_back( {} );
1093  column2.push_back( {} );
1094 
1095  column1.push_back(_("Recording Saved:"));
1096  column2.push_back(((eCompletedActions & TR_ACTION_SAVED) ? _("Yes") : _("No")));
1097 
1098  column1.push_back(_("Recording Exported:"));
1099  column2.push_back(((eCompletedActions & TR_ACTION_EXPORTED) ? _("Yes") : _("No")));
1100 
1101  column1.push_back(_("Action after Timer Recording:"));
1102  column2.push_back(sAction);
1103 
1104  wxDateTime dtNow = wxDateTime::UNow();
1105  wxTimeSpan tsWait = wxTimeSpan(0, 1, 0, 0);
1106  wxDateTime dtActionTime = dtNow.Add(tsWait);
1107 
1108  TimerProgressDialog dlgAction(tsWait.GetMilliseconds().GetValue(),
1109  _("Audacity Timer Record - Waiting"),
1110  columns,
1112  sCountdownLabel);
1113 
1114  auto iUpdateResult = ProgressResult::Success;
1115  bool bIsTime = false;
1116  while (iUpdateResult == ProgressResult::Success && !bIsTime)
1117  {
1118  iUpdateResult = dlgAction.UpdateProgress();
1119  wxMilliSleep(kTimerInterval);
1120  bIsTime = (dtActionTime <= wxDateTime::UNow());
1121  }
1122  return iUpdateResult;
1123 }
void OnDatePicker_End(wxDateEvent &event)
wxCheckBox * m_pTimerAutoSaveCheckBoxCtrl
void OnTimeText_Start(wxCommandEvent &event)
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
void OnAutoSavePathButton_Click(wxCommandEvent &event)
void PopulateOrExchange(ShuttleGui &S)
ProgressResult
wxFileName GetAutoExportFileName()
Definition: Export.cpp:986
bool SetAutoExportOptions(AudacityProject *project)
Definition: Export.cpp:990
TimerRecordPathCtrl * m_pTimerExportPathTextCtrl
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
wxTimeSpan m_TimeSpan_Duration
bool SaveFromTimerRecording(wxFileName fnFile)
Definition: Project.cpp:5997
Dialog for Timer Record, i.e., timed or long recording.
wxWindow * AddWindow(wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
Definition: ShuttleGui.cpp:288
void EndMultiColumn()
int RunWaitDialog()
Runs the wait for start dialog. Returns false if the user clicks stop.
wxButton * m_pTimerSavePathButtonCtrl
std::vector< MessageColumn > MessageTable
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
void OnTimeText_Duration(wxCommandEvent &event)
int GetEstimatedRecordingMinsLeftOnDisk(long lCaptureChannels=0)
Definition: Project.cpp:6074
wxDatePickerCtrl * m_pDatePickerCtrl_Start
int GetAutoExportFormat()
Definition: Export.cpp:974
Wrap wxMessageDialog so that caption IS translatable.
Definition: ErrorDialog.h:129
void EnableDisableAutoControls(bool bEnable, int iControlGoup)
#define safenew
Definition: Audacity.h:230
TimerRecordCompletedActions
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
void EndVerticalLay()
void OnOK(wxCommandEvent &event)
wxCheckBox * AddCheckBox(const wxString &Prompt, const wxString &Selected)
Definition: ShuttleGui.cpp:298
TimerRecordPathCtrl * NewPathControl(wxWindow *wParent, const int iID, const wxString &sCaption, const wxString &sValue)
void OnDatePicker_Start(wxDateEvent &event)
TimerRecordPathCtrl * m_pTimerSavePathTextCtrl
NumericTextCtrl * m_pTimeTextCtrl_End
int ExecutePostRecordActions(bool bWasStopped)
void OnStop(const CommandContext &context)
Definition: Menus.cpp:2850
wxDateTime m_DateTime_Start
const int kTimerInterval
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
wxChoice * m_pTimerAfterCompleteChoiceCtrl
wxChoice * AddChoice(const wxString &Prompt, const wxString &Selected, const wxArrayString *pChoices)
Definition: ShuttleGui.cpp:371
ShuttleGui & Id(int id)
void OnAutoExportCheckBox_Change(wxCommandEvent &event)
static void ShowHelp(wxWindow *parent, const wxString &localFileName, const wxString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:194
int min(int a, int b)
ProgressResult PreActionDelay(int iActionIndex, TimerRecordCompletedActions eCompletedActions)
int GetAutoExportFilterIndex()
Definition: Export.cpp:982
NumericTextCtrl * m_pTimeTextCtrl_Duration
wxArrayString m_sTimerAfterCompleteOptionsArray
bool ExportFromTimerRecording(wxFileName fnFile, int iFormat, int iSubFormat, int iFilterIndex)
Definition: Project.cpp:5977
wxButton * m_pTimerExportPathButtonCtrl
void SetValue(double newValue)
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
NumericTextCtrl * m_pTimeTextCtrl_Start
static wxString AutoSaveDir()
Definition: FileNames.cpp:109
static double wxDateTime_to_AudacityTime(wxDateTime &dateTime)
static wxString SelectFile(Operation op, const wxString &message, const wxString &default_path, const wxString &default_filename, const wxString &default_extension, const wxString &wildcard, int flags, wxWindow *parent)
Definition: FileNames.cpp:411
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void OnTimeText_End(wxCommandEvent &event)
AUDACITY_DLL_API AudacityProject * GetActiveProject()
Definition: Project.cpp:308
wxString GetHoursMinsString(int iMinutes)
Definition: Project.cpp:6045
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:763
wxFileName m_fnAutoExportFile
ProgressResult WaitForStart()
void OnAutoExportPathButton_Click(wxCommandEvent &event)
void OnHelpButtonClick(wxCommandEvent &event)
bool TransferDataFromWindow() override
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxButton *extra=NULL)
END_EVENT_TABLE()
static bool HaveFilesToRecover()
wxFileName m_fnAutoSaveFile
wxString GetDisplayDate(wxDateTime &dt)
void OnTimer(wxTimerEvent &event)
#define TIMER_ID
void OnRecord(const CommandContext &context)
Definition: Menus.cpp:2864
void SetBorder(int Border)
Definition: ShuttleGui.h:286
const wxString & GetFileName()
Definition: Project.h:302
wxString m_sTimerAfterCompleteOption
wxCheckBox * m_pTimerAutoExportCheckBoxCtrl
void OnAutoSaveCheckBox_Change(wxCommandEvent &event)
wxButton * AddButton(const wxString &Text, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:341
wxDatePickerCtrl * m_pDatePickerCtrl_End
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:203
static void CleanTempDir()
Definition: DirManager.cpp:436
int GetAutoExportSubFormat()
Definition: Export.cpp:978
void StartVerticalLay(int iProp=1)