Audacity 3.2.0
Functions
ExportProgressUI Namespace Reference

Functions

ExportResult Show (ExportTask exportTask)
 
template<typename Callable >
void ExceptionWrappedCall (Callable callable)
 

Function Documentation

◆ ExceptionWrappedCall()

template<typename Callable >
void ExportProgressUI::ExceptionWrappedCall ( Callable  callable)

Definition at line 29 of file ExportProgressUI.h.

30 {
31 try
32 {
33 callable();
34 }
35 catch(ExportDiskFullError& e)
36 {
38 }
39 catch(ExportErrorException& e)
40 {
42 XO("Warning"),
43 e.GetHelpPageId(),
44 true);
45 }
46 catch(ExportException& e)
47 {
49 }
50 catch(...)
51 {
52 BasicUI::ShowMessageBox(XO("Export error"));
53 }
54 }
void ShowDiskFullExportErrorDialog(const wxFileNameWrapper &fileName)
Definition: Export.cpp:135
void ShowExportErrorDialog(const TranslatableString &message, const TranslatableString &caption, bool allowReporting)
Definition: Export.cpp:144
XO("Cut/Copy/Paste")
const wxFileNameWrapper & GetFileName() const noexcept
const TranslatableString & GetMessage() const noexcept
const wxString & GetHelpPageId() const noexcept
const wxString & What() const noexcept
Holds a msgid for the translation catalog; may also bind format arguments.
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:277

References ExportDiskFullError::GetFileName(), ShowDiskFullExportErrorDialog(), ShowExportErrorDialog(), BasicUI::ShowMessageBox(), and XO().

Referenced by ExportCommand::Apply(), anonymous_namespace{FileMenus.cpp}::DoExport(), TimerRecordDialog::ExecutePostRecordActions(), cloud::audiocom::ShareAudioDialog::ExportProject(), ExportAudioDialog::OnExport(), and Show().

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

◆ Show()

ExportResult ExportProgressUI::Show ( ExportTask  exportTask)

Definition at line 81 of file ExportProgressUI.cpp.

82{
83 assert(exportTask.valid());
84
85 auto f = exportTask.get_future();
86 DialogExportProgressDelegate delegate;
87 std::thread(std::move(exportTask), std::ref(delegate)).detach();
88 auto result = ExportResult::Error;
89 while(f.wait_for(std::chrono::milliseconds(50)) != std::future_status::ready)
90 delegate.UpdateUI();
91
92 ExceptionWrappedCall([&] { result = f.get(); });
93
94 if(result == ExportResult::Error)
95 {
97 {}, XO("Export error"),
98 XO("Export completed with error."), {},
100 }
101
102 return result;
103}
void ShowErrorDialog(const WindowPlacement &placement, const TranslatableString &dlogTitle, const TranslatableString &message, const ManualPageID &helpPage, const ErrorDialogOptions &options={})
Show an error dialog with a link to the manual for further help.
Definition: BasicUI.h:262
void ExceptionWrappedCall(Callable callable)
Options for variations of error dialogs; the default is for modal dialogs.
Definition: BasicUI.h:52

References Error, ExceptionWrappedCall(), BasicUI::ModalError, BasicUI::ShowErrorDialog(), and XO().

Referenced by ExportCommand::Apply(), ApplyMacroDialog::ApplyMacroToProject(), ScreenshotBigDialog::DoCapture(), anonymous_namespace{FileMenus.cpp}::DoExport(), TimerRecordDialog::ExecutePostRecordActions(), ToolBar::Expose(), ApplyMacroDialog::OnApplyToFiles(), NyqBench::OnClose(), ContrastDialog::OnClose(), ExportAudioDialog::OnExport(), AudacityApp::OnMenuAbout(), SplashDialog::OnOK(), ProgressDialog::Reinit(), AudacityTextEntryDialog::Show(), ExportAudioDialog::Show(), FrequencyPlotDialog::Show(), HistoryDialog::Show(), LabelDialog::Show(), NyqBench::ShowNyqBench(), and ProgressDialog::~ProgressDialog().

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