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):
wxFrame(parent, -1,
wxString::Format(_("Audacity Karaoke%s"),
((parent->GetName().empty()) ?
((parent->GetProjectName().empty()) ?
wxT("") :
wxString::Format(
wxT(" - %s"),
parent->GetName()))),
parent->GetProjectName()))),
wxPoint(100, 300), gSize,
//v Bug in wxFRAME_FLOAT_ON_PARENT:
// 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)
: wxFrame(parent, -1,
wxString::Format(_("Audacity Mixer Board%s"),
((parent->GetName().empty()) ?
((parent->GetProjectName().empty()) ?
wxT("") :
wxString::Format(wxT(" - %s"),
parent->GetName()))),
parent->GetProjectName()))),
wxDefaultPosition, kDefaultSize,
//vvv Bug in wxFRAME_FLOAT_ON_PARENT:
// 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;
}
wxString AudacityProject::GetName()
wxString AudacityProject::GetProjectName() const
{
wxString name = wxFileNameFromPath(mFileName);
@ -1534,7 +1534,7 @@ wxString AudacityProject::GetName()
// Pass a number in to show project number, or -1 not to.
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
// is none.
@ -2142,7 +2142,7 @@ int AudacityProject::CountUnnamed()
int j = 0;
for ( size_t i = 0; i < gAudacityProjects.size(); i++) {
if ( gAudacityProjects[i] )
if ( gAudacityProjects[i]->GetName().empty() )
if ( gAudacityProjects[i]->GetProjectName().empty() )
j++;
}
return j;
@ -2437,7 +2437,7 @@ public:
p->Raise(); // May help identifying the window on Mac
// Construct this projects name and number.
sProjName = p->GetName();
sProjName = p->GetProjectName();
if (sProjName.empty()){
sProjName = _("<untitled>");
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.)
if (!mDirManager->SetProject(projPath, projName, false))
{
projName = GetName() + wxT("_data");
projName = GetProjectName() + wxT("_data");
if (!mDirManager->SetProject(projPath, projName, false)) {
AudacityMessageBox(wxString::Format(_("Couldn't find the project data folder: \"%s\""),
projName),

View File

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

View File

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

View File

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

View File

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