1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-27 08:17:38 +02:00

Some uses of ShowMessageBox, removing AudacityMessageBoxCaptionStr...

... but not yet removing all inclusions of AudacityMessageBox.h
This commit is contained in:
Paul Licameli
2021-07-10 14:54:51 -04:00
parent 14ad405b04
commit 98b1669e93
4 changed files with 13 additions and 14 deletions

View File

@@ -14,7 +14,6 @@
#include <wx/atomic.h>
#include "widgets/AudacityMessageBox.h"
#include "BasicUI.h"
AudacityException::~AudacityException()
@@ -80,10 +79,11 @@ void MessageBoxException::DelayedHandlerAction()
if (exceptionType != ExceptionType::Internal
&& ErrorHelpUrl().IsEmpty()) {
// We show BadEnvironment and BadUserAction in a similar way
::AudacityMessageBox(
ShowMessageBox(
ErrorMessage(),
(caption.empty() ? AudacityMessageBoxCaptionStr() : caption),
wxICON_ERROR);
MessageBoxOptions{}
.Caption(caption.empty() ? DefaultCaption() : caption)
.IconStyle(Icon::Error) );
}
else {
using namespace BasicUI;

View File

@@ -73,6 +73,7 @@ can't be.
#include <wx/settings.h>
#include "AllThemeResources.h" // can remove this later, only needed for 'XPMS_RETIRED'.
#include "BasicUI.h"
#include "FileNames.h"
#include "Prefs.h"
#include "ImageManipulation.h"
@@ -1144,16 +1145,19 @@ void ThemeBase::SaveComponents()
}
}
using namespace BasicUI;
if (n > 0)
{
auto result =
AudacityMessageBox(
ShowMessageBox(
XO(
"Some required files in:\n %s\nwere already present. Overwrite?")
.Format( FileNames::ThemeComponentsDir() ),
AudacityMessageBoxCaptionStr(),
wxYES_NO | wxNO_DEFAULT);
if(result == wxNO)
MessageBoxOptions{}
.ButtonStyle(Button::YesNo)
.DefaultIsNo());
if (result == MessageBoxResult::No)
return;
}

View File

@@ -10,8 +10,3 @@
#include "AudacityMessageBox.h"
#include "Internat.h"
TranslatableString AudacityMessageBoxCaptionStr()
{
return XO("Message");
}

View File

@@ -18,7 +18,7 @@ extern AUDACITY_DLL_API TranslatableString AudacityMessageBoxCaptionStr();
// Do not use wxMessageBox!! Its default window title does not translate!
inline int AudacityMessageBox(const TranslatableString& message,
const TranslatableString& caption = AudacityMessageBoxCaptionStr(),
const TranslatableString& caption = XO("Message"),
long style = wxOK | wxCENTRE,
wxWindow *parent = NULL,
int x = wxDefaultCoord, int y = wxDefaultCoord)