1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 09:20:16 +01:00

Internat.cpp has fewer dependencies...

... after we move a function to FileNames.cpp.

This frees ten files from cyclic dependencies
This commit is contained in:
Paul Licameli
2019-05-11 06:29:17 -04:00
parent e3ad893887
commit 25db4652b0
4 changed files with 65 additions and 66 deletions

View File

@@ -23,6 +23,7 @@ and on Mac OS X for the filesystem.
#include "Internat.h"
#include "Experimental.h"
#include "MemoryX.h"
#include <wx/log.h>
#include <wx/intl.h>
@@ -31,8 +32,6 @@ and on Mac OS X for the filesystem.
#include <locale.h>
#include <math.h> // for pow()
#include "FileNames.h"
#include "widgets/ErrorDialog.h"
#include "../include/audacity/ComponentInterface.h"
// in order for the static member variables to exist, they must appear here
@@ -226,46 +225,6 @@ wxString Internat::FormatSize(double size)
return sizeStr;
}
#if defined(__WXMSW__)
//
// On Windows, wxString::mb_str() can return a NULL pointer if the
// conversion to multi-byte fails. So, based on direction intent,
// returns a pointer to an empty string or prompts for a NEW name.
//
char *Internat::VerifyFilename(const wxString &s, bool input)
{
static wxCharBuffer buf;
wxString name = s;
if (input) {
if ((char *) (const char *)name.mb_str() == NULL) {
name = wxEmptyString;
}
}
else {
wxFileName ff(name);
wxString ext;
while ((char *) (const char *)name.mb_str() == NULL) {
AudacityMessageBox(_("The specified filename could not be converted due to Unicode character use."));
ext = ff.GetExt();
name = FileNames::SelectFile(FileNames::Operation::_None,
_("Specify New Filename:"),
wxEmptyString,
name,
ext,
wxT("*.") + ext,
wxFD_SAVE | wxRESIZE_BORDER,
wxGetTopLevelParent(NULL));
}
}
mFilename = name.mb_str();
return (char *) (const char *) mFilename;
}
#endif
bool Internat::SanitiseFilename(wxString &name, const wxString &sub)
{
bool result = false;