mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-21 15:08:01 +02:00
Bug 1304 - Starting Save or Export directory is not set, so is unwritable or requires authentication for most users
I have done as suggested in the bug comments, and used: Windows: Users\username\Documents Unix/Mac: ~/Documents . We could though use GetLocalizedResourcesDir() and could use Music rather than Documents.
This commit is contained in:
parent
29a392f675
commit
e9b9fcbcb2
@ -4182,6 +4182,15 @@ bool AudacityProject::SaveAs(bool bWantSaveCompressed /*= false*/)
|
|||||||
TitleRestorer Restorer(this); // RAII
|
TitleRestorer Restorer(this); // RAII
|
||||||
|
|
||||||
wxFileName filename(mFileName);
|
wxFileName filename(mFileName);
|
||||||
|
// Bug 1304: Set a default file path if none was given. For Save/SaveAs
|
||||||
|
if( filename.GetFullPath().IsEmpty() ){
|
||||||
|
filename.AssignHomeDir();
|
||||||
|
#ifdef __WIN32__
|
||||||
|
filename.SetPath(filename.GetPath() + "\\Documents");
|
||||||
|
#else
|
||||||
|
filename.SetPath(filename.GetPath() + "/Documents");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
wxString sDialogTitle;
|
wxString sDialogTitle;
|
||||||
if (bWantSaveCompressed)
|
if (bWantSaveCompressed)
|
||||||
|
@ -518,7 +518,15 @@ bool Exporter::GetFilename()
|
|||||||
}
|
}
|
||||||
maskString.RemoveLast();
|
maskString.RemoveLast();
|
||||||
|
|
||||||
mFilename.SetPath(gPrefs->Read(wxT("/Export/Path"), ::wxGetCwd()));
|
//Bug 1304: Set a default path if none was given. For Export.
|
||||||
|
#ifdef __WIN32__
|
||||||
|
wxFileName tmpFile;
|
||||||
|
tmpFile.AssignHomeDir();
|
||||||
|
wxString tmpDirLoc = tmpFile.GetPath(wxPATH_GET_VOLUME);
|
||||||
|
mFilename.SetPath(gPrefs->Read(wxT("/Export/Path"), tmpDirLoc + "\\Documents"));
|
||||||
|
#else
|
||||||
|
mFilename.SetPath(gPrefs->Read(wxT("/Export/Path"), wxT("~/Documents")));
|
||||||
|
#endif
|
||||||
mFilename.SetName(mProject->GetName());
|
mFilename.SetName(mProject->GetName());
|
||||||
while (true) {
|
while (true) {
|
||||||
// Must reset each iteration
|
// Must reset each iteration
|
||||||
|
Loading…
x
Reference in New Issue
Block a user