1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-06 22:45:29 +01:00

Move error dialog functions into the BasicUI facade...

... now ErrorDialog.h is included only in ErrorDialog.cpp and
wxWidgetsBasicUI.cpp
This commit is contained in:
Paul Licameli
2021-02-09 12:50:27 -05:00
parent 3a3ff8ecbe
commit 189c6c1dbc
26 changed files with 251 additions and 216 deletions

View File

@@ -52,6 +52,7 @@
#include "../widgets/FileDialog/FileDialog.h"
#include "../src/AllThemeResources.h"
#include "BasicUI.h"
#include "../Mix.h"
#include "../Prefs.h"
#include "../prefs/ImportExportPrefs.h"
@@ -70,7 +71,6 @@
#include "../FileNames.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/ProgressDialog.h"
#include "../widgets/ErrorDialog.h"
#include "../wxFileNameWrapper.h"
//----------------------------------------------------------------------------
@@ -1519,16 +1519,17 @@ void ShowExportErrorDialog(wxString ErrorCode,
TranslatableString message,
const TranslatableString& caption)
{
ShowExceptionDialog(nullptr,
caption,
message.Format( ErrorCode ),
"Error:_Unable_to_export" // URL.
);
using namespace BasicUI;
ShowErrorDialog( {},
caption,
message.Format( ErrorCode ),
"Error:_Unable_to_export", // URL.
ErrorDialogOptions{ ErrorDialogType::ModalErrorReport } );
}
void ShowDiskFullExportErrorDialog(const wxFileNameWrapper &fileName)
{
ShowErrorDialog(nullptr,
BasicUI::ShowErrorDialog( {},
XO("Warning"),
FileException::WriteFailureMessage(fileName),
"Error:_Disk_full_or_not_writable"

View File

@@ -31,8 +31,8 @@
#include "../Tags.h"
#include "../Track.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/ErrorDialog.h"
#include "../widgets/ProgressDialog.h"
#include "../widgets/wxWidgetsBasicUI.h"
#include "../wxFileNameWrapper.h"
#include "Export.h"
@@ -442,13 +442,15 @@ void ExportPCM::ReportTooBigError(wxWindow * pParent)
XO("You have attempted to Export a WAV or AIFF file which would be greater than 4GB.\n"
"Audacity cannot do this, the Export was abandoned.");
ShowErrorDialog(pParent, XO("Error Exporting"), message,
wxT("Size_limits_for_WAV_and_AIFF_files"));
BasicUI::ShowErrorDialog( wxWidgetsWindowPlacement{ pParent },
XO("Error Exporting"), message,
wxT("Size_limits_for_WAV_and_AIFF_files"));
// This alternative error dialog was to cover the possibility we could not
// compute the size in advance.
#if 0
ShowErrorDialog(pParent, XO("Error Exporting"),
BasicUI::ShowErrorDialog( wxWidgetsWindowPlacement{ pParent },
XO("Error Exporting"),
XO("Your exported WAV file has been truncated as Audacity cannot export WAV\n"
"files bigger than 4GB."),
wxT("Size_limits_for_WAV_files"));