1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

rename function as AudacityProject::GetProjectName...

... So it does not hide inherited wxWindow::GetName().

And make it const.
This commit is contained in:
Paul Licameli 2019-04-21 17:33:18 -04:00
parent 8f55d55869
commit c46fbd919c
8 changed files with 14 additions and 14 deletions

View File

@ -46,11 +46,11 @@ const wxSize gSize = wxSize(LYRICS_DEFAULT_WIDTH, LYRICS_DEFAULT_HEIGHT);
LyricsWindow::LyricsWindow(AudacityProject *parent): LyricsWindow::LyricsWindow(AudacityProject *parent):
wxFrame(parent, -1, wxFrame(parent, -1,
wxString::Format(_("Audacity Karaoke%s"), wxString::Format(_("Audacity Karaoke%s"),
((parent->GetName().empty()) ? ((parent->GetProjectName().empty()) ?
wxT("") : wxT("") :
wxString::Format( wxString::Format(
wxT(" - %s"), wxT(" - %s"),
parent->GetName()))), parent->GetProjectName()))),
wxPoint(100, 300), gSize, wxPoint(100, 300), gSize,
//v Bug in wxFRAME_FLOAT_ON_PARENT: //v Bug in wxFRAME_FLOAT_ON_PARENT:
// If both the project frame and LyricsWindow are minimized and you restore LyricsWindow, // If both the project frame and LyricsWindow are minimized and you restore LyricsWindow,

View File

@ -1408,10 +1408,10 @@ const wxSize kDefaultSize =
MixerBoardFrame::MixerBoardFrame(AudacityProject* parent) MixerBoardFrame::MixerBoardFrame(AudacityProject* parent)
: wxFrame(parent, -1, : wxFrame(parent, -1,
wxString::Format(_("Audacity Mixer Board%s"), wxString::Format(_("Audacity Mixer Board%s"),
((parent->GetName().empty()) ? ((parent->GetProjectName().empty()) ?
wxT("") : wxT("") :
wxString::Format(wxT(" - %s"), wxString::Format(wxT(" - %s"),
parent->GetName()))), parent->GetProjectName()))),
wxDefaultPosition, kDefaultSize, wxDefaultPosition, kDefaultSize,
//vvv Bug in wxFRAME_FLOAT_ON_PARENT: //vvv Bug in wxFRAME_FLOAT_ON_PARENT:
// If both the project frame and MixerBoardFrame are minimized and you restore MixerBoardFrame, // If both the project frame and MixerBoardFrame are minimized and you restore MixerBoardFrame,

View File

@ -1519,7 +1519,7 @@ void AudacityProject::SetTags( const std::shared_ptr<Tags> &tags )
mTags = tags; mTags = tags;
} }
wxString AudacityProject::GetName() wxString AudacityProject::GetProjectName() const
{ {
wxString name = wxFileNameFromPath(mFileName); wxString name = wxFileNameFromPath(mFileName);
@ -1534,7 +1534,7 @@ wxString AudacityProject::GetName()
// Pass a number in to show project number, or -1 not to. // Pass a number in to show project number, or -1 not to.
void AudacityProject::SetProjectTitle( int number) void AudacityProject::SetProjectTitle( int number)
{ {
wxString name = GetName(); wxString name = GetProjectName();
// If we are showing project numbers, then we also explicitly show "<untitled>" if there // If we are showing project numbers, then we also explicitly show "<untitled>" if there
// is none. // is none.
@ -2142,7 +2142,7 @@ int AudacityProject::CountUnnamed()
int j = 0; int j = 0;
for ( size_t i = 0; i < gAudacityProjects.size(); i++) { for ( size_t i = 0; i < gAudacityProjects.size(); i++) {
if ( gAudacityProjects[i] ) if ( gAudacityProjects[i] )
if ( gAudacityProjects[i]->GetName().empty() ) if ( gAudacityProjects[i]->GetProjectName().empty() )
j++; j++;
} }
return j; return j;
@ -2437,7 +2437,7 @@ public:
p->Raise(); // May help identifying the window on Mac p->Raise(); // May help identifying the window on Mac
// Construct this projects name and number. // Construct this projects name and number.
sProjName = p->GetName(); sProjName = p->GetProjectName();
if (sProjName.empty()){ if (sProjName.empty()){
sProjName = _("<untitled>"); sProjName = _("<untitled>");
UnnamedCount=AudacityProject::CountUnnamed(); UnnamedCount=AudacityProject::CountUnnamed();
@ -3480,7 +3480,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
// international characters (such as capital 'A' with an umlaut.) // international characters (such as capital 'A' with an umlaut.)
if (!mDirManager->SetProject(projPath, projName, false)) if (!mDirManager->SetProject(projPath, projName, false))
{ {
projName = GetName() + wxT("_data"); projName = GetProjectName() + wxT("_data");
if (!mDirManager->SetProject(projPath, projName, false)) { if (!mDirManager->SetProject(projPath, projName, false)) {
AudacityMessageBox(wxString::Format(_("Couldn't find the project data folder: \"%s\""), AudacityMessageBox(wxString::Format(_("Couldn't find the project data folder: \"%s\""),
projName), projName),

View File

@ -218,7 +218,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
bool IsPlayRegionLocked() { return mLockPlayRegion; } bool IsPlayRegionLocked() { return mLockPlayRegion; }
void SetPlayRegionLocked(bool value) { mLockPlayRegion = value; } void SetPlayRegionLocked(bool value) { mLockPlayRegion = value; }
wxString GetName(); wxString GetProjectName() const;
const std::shared_ptr<DirManager> &GetDirManager(); const std::shared_ptr<DirManager> &GetDirManager();
TrackFactory *GetTrackFactory(); TrackFactory *GetTrackFactory();
AdornedRulerPanel *GetRulerPanel(); AdornedRulerPanel *GetRulerPanel();

View File

@ -707,7 +707,7 @@ bool NyquistEffect::Process()
mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'DAY-NAME)\n"), now.GetWeekDayName(day)); mProps += wxString::Format(wxT("(putprop '*SYSTEM-TIME* \"%s\" 'DAY-NAME)\n"), now.GetWeekDayName(day));
mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'PROJECTS)\n"), (int) gAudacityProjects.size()); mProps += wxString::Format(wxT("(putprop '*PROJECT* %d 'PROJECTS)\n"), (int) gAudacityProjects.size());
mProps += wxString::Format(wxT("(putprop '*PROJECT* \"%s\" 'NAME)\n"), project->GetName()); mProps += wxString::Format(wxT("(putprop '*PROJECT* \"%s\" 'NAME)\n"), project->GetProjectName());
int numTracks = 0; int numTracks = 0;
int numWave = 0; int numWave = 0;

View File

@ -562,7 +562,7 @@ bool Exporter::GetFilename()
//Bug 1304: Set a default path if none was given. For Export. //Bug 1304: Set a default path if none was given. For Export.
mFilename = FileNames::DefaultToDocumentsFolder(wxT("/Export/Path")); mFilename = FileNames::DefaultToDocumentsFolder(wxT("/Export/Path"));
mFilename.SetName(mProject->GetName()); mFilename.SetName(mProject->GetProjectName());
if (mFilename.GetName().empty()) if (mFilename.GetName().empty())
mFilename.SetName(_("untitled")); mFilename.SetName(_("untitled"));
while (true) { while (true) {

View File

@ -215,7 +215,7 @@ int ExportMultiple::ShowModal()
void ExportMultiple::PopulateOrExchange(ShuttleGui& S) void ExportMultiple::PopulateOrExchange(ShuttleGui& S)
{ {
wxString name = mProject->GetName(); wxString name = mProject->GetProjectName();
wxString defaultFormat = gPrefs->Read(wxT("/Export/Format"), wxT("WAV")); wxString defaultFormat = gPrefs->Read(wxT("/Export/Format"), wxT("WAV"));
wxArrayStringEx formats; wxArrayStringEx formats;

View File

@ -536,7 +536,7 @@ void OnPageSetup(const CommandContext &context)
void OnPrint(const CommandContext &context) void OnPrint(const CommandContext &context)
{ {
auto &project = context.project; auto &project = context.project;
auto name = project.GetName(); auto name = project.GetProjectName();
auto tracks = project.GetTracks(); auto tracks = project.GetTracks();
HandlePrint(&project, name, tracks, *project.GetTrackPanel()); HandlePrint(&project, name, tracks, *project.GetTrackPanel());
} }