Audacity 3.2.0
Functions
AutoRecoveryDialog.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool ShowAutoRecoveryDialogIfNeeded (AudacityProject *&pproj, bool *didRecoverAnything)
 

Function Documentation

◆ ShowAutoRecoveryDialogIfNeeded()

bool ShowAutoRecoveryDialogIfNeeded ( AudacityProject *&  pproj,
bool *  didRecoverAnything 
)

Definition at line 450 of file AutoRecoveryDialog.cpp.

451{
452 if (didRecoverAnything)
453 {
454 *didRecoverAnything = false;
455 }
456
457 bool success = true;
458
459 // Under wxGTK3, the auto recovery dialog will not get
460 // the focus since the project window hasn't been allowed
461 // to completely initialize.
462 //
463 // Yielding seems to allow the initialization to complete.
464 //
465 // Additionally, it also corrects a sizing issue in the dialog
466 // related to wxWidgets bug:
467 //
468 // http://trac.wxwidgets.org/ticket/16440
469 //
470 // This must be done before "dlg" is declared.
471 wxEventLoopBase::GetActive()->YieldFor(wxEVT_CATEGORY_UI | wxEVT_CATEGORY_USER_INPUT);
472
473 AutoRecoveryDialog dialog(pproj);
474
475 if (dialog.HasRecoverables())
476 {
477 int ret = dialog.ShowModal();
478
479 switch (ret)
480 {
481 case ID_SKIP:
482 success = true;
483 break;
484
486 DiscardAllProjects(dialog.GetRecoverables());
487 success = true;
488 break;
489
491 success = RecoverAllProjects(dialog.GetRecoverables(), pproj);
492 if (success)
493 {
494 if (didRecoverAnything)
495 {
496 *didRecoverAnything = true;
497 }
498 }
499 break;
500
501 default:
502 // This includes ID_QUIT_AUDACITY
503 return false;
504 }
505 }
506
507 return success;
508}
static void DiscardAllProjects(const FilePaths &files)
static bool RecoverAllProjects(const FilePaths &files, AudacityProject *&pproj)
@ ID_RECOVER_SELECTED
@ ID_DISCARD_SELECTED

References DiscardAllProjects(), AutoRecoveryDialog::GetRecoverables(), AutoRecoveryDialog::HasRecoverables(), ID_DISCARD_SELECTED, ID_RECOVER_SELECTED, ID_SKIP, and RecoverAllProjects().

Referenced by AudacityApp::InitPart2().

Here is the call graph for this function:
Here is the caller graph for this function: