Improve the message for exhaustion of file storage on Windows
This commit is contained in:
parent
2d17ddc100
commit
68706c24c9
|
@ -50,15 +50,24 @@ _("Audacity successfully wrote a file in %s but failed to rename it as %s.");
|
|||
default:
|
||||
break;
|
||||
}
|
||||
wxString target = fileName.GetVolume();
|
||||
if (target.empty()) {
|
||||
// Shorten the path, arbitrarily to 3 components
|
||||
auto path = fileName;
|
||||
path.SetFullName(wxString{});
|
||||
while(path.GetDirCount() > 3)
|
||||
path.RemoveLastDir();
|
||||
target = path.GetFullPath();
|
||||
}
|
||||
wxString target;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
|
||||
// Drive letter plus colon
|
||||
target = fileName.GetVolume() + wxT(":");
|
||||
|
||||
#else
|
||||
|
||||
// Shorten the path, arbitrarily to 3 components
|
||||
auto path = fileName;
|
||||
path.SetFullName(wxString{});
|
||||
while(path.GetDirCount() > 3)
|
||||
path.RemoveLastDir();
|
||||
target = path.GetFullPath();
|
||||
|
||||
#endif
|
||||
|
||||
return wxString::Format(
|
||||
format, target, renameTarget.GetFullName() );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue