Currently Audacity stores the previously used save path for Export. So if I Export a file to d:songs/rock/artist/album then Import one from c:music/pop/artist/album, do a bit of editing then choose File>Export..., the file dialog opens on the OLD directory ( d:songs/rock/artist/album ) and (at least on Windows) the file save dialog is really clunky and getting from way down in d:songs/rock/artist/album to the location I want ( c:music/pop/artist/album ) is a lot of clicking.
I realize that for some workflows having the Export dialog always open in the same directory is good but for my workflow (after Import) I want it to open for Export in the Import directory. As it turns out this is easy to accomplish.
First, add a new public wxString mImportPath to the AudacityProject class (it does not really matter where as long as it is in a public section), so in Project.h around line 389 it seems that on Linux it might really matter where in the header the new variable goes); so, in Project.h at the very end of the file:
Code: Select all
// Are we currently closing as the result of a menu command?
bool mMenuClose;
public:
wxString mImportPath;//efm5
DECLARE_EVENT_TABLE()
};
#endif
Next we need to store the path of the Import directory, so in Project.cpp around line 3372:
Code: Select all
bool AudacityProject::Import(wxString fileName, WaveTrackArray* pTrackArray /*= NULL*/)
{
//efm5 start
AudacityProject * project = GetActiveProject();
wxFileName tempFilename(fileName);
project->mImportPath = tempFilename.GetPath();
//efm5 end
Track **newTracks;
Code: Select all
maskString.RemoveLast();
//efm5 start
if (mProject->mImportPath.IsEmpty())
mFilename.SetPath(gPrefs->Read(wxT("/Export/Path"), ::wxGetCwd()));
else
mFilename.SetPath(mProject->mImportPath);
//efm5 end
mFilename.SetName(mProject->GetName());
while (true) {
FileDialog fd(mProject,
In the above code I have included a line or two before and after my changes for continuity. I have noted or wrapped changes with //efm5 comments.