1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 17:10:55 +02:00

Used IdDirWritable() for checking write permissions for Bug #2740

This commit is contained in:
MalevolentStrix 2021-06-19 19:21:26 +05:30 committed by Paul Licameli
parent 4ed2e0d265
commit bf14b2bef8

View File

@ -371,6 +371,21 @@ void DirectoriesPrefs::OnBrowse(wxCommandEvent &evt)
}
}
if (evt.GetId() == SaveButtonID || evt.GetId() == ExportButtonID)
{
bool Status = wxFileName ::IsDirWritable(dlog.GetPath());
wxString path{dlog.GetPath()};
if (!Status)
{
AudacityMessageBox(
XO("Directory %s does not have write permissions")
.Format(path),
XO("Error"),
wxOK | wxICON_ERROR);
return;
}
}
tc->SetValue(dlog.GetPath());
}