2540 and more disk-full warning adjustments.

- Add text to tell people about the help button.
- Use alternative to 'wxFilename::GetVolume' that works on macOS.
This commit is contained in:
James Crook 2020-09-25 15:04:52 +01:00
parent 4810897b74
commit f0fb7e5be5
2 changed files with 11 additions and 5 deletions

View File

@ -15,6 +15,7 @@
#include "KeyboardCapture.h"
#include "FileNames.h"
#include "./widgets/ErrorDialog.h"
#include "./FileException.h"
#include <wx/display.h>
#include <wx/filename.h>
@ -132,12 +133,13 @@ AudacityProject::AudacityProject()
auto path = FileNames::TempDir();
if (wxGetDiskSpace(path, NULL, &freeSpace)) {
if (freeSpace < wxLongLong(wxLL(100 * 1048576))) {
auto volume = wxFileName(path).GetVolume();
auto volume = FileException::AbbreviatePath( path );
/* i18n-hint: %s will be replaced by the drive letter (on Windows) */
ShowErrorDialog(nullptr,
XO("Warning"),
XO("There is very little free disk space left on %s:\n"
"Please select a bigger temporary directory in Preferences.").Format( volume ),
XO("There is very little free disk space left on %s\n"
"Please select a bigger temporary directory location in\n"
"Directories Preferences.").Format( volume ),
"Error:_Disk_full_or_not_writable"
);
}

View File

@ -294,7 +294,9 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
ShowErrorDialog(
&window,
XO("Error Writing to File"),
XO("Audacity failed to write file %s.\nPerhaps disk is full or not writable.")
XO("Audacity failed to write file %s.\n"
"Perhaps disk is full or not writable.\n"
"For tips on freeing up space, click the help button.")
.Format(safetyFileName),
"Error:_Disk_full_or_not_writable"
);
@ -308,7 +310,9 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
ShowErrorDialog(
&window,
XO("Error Saving Project"),
XO("Could not save project. Perhaps %s \nis not writable or the disk is full.")
XO("Could not save project. Perhaps %s \n"
"is not writable or the disk is full.\n"
"For tips on freeing up space, click the help button.")
.Format(fileName),
"Error:_Disk_full_or_not_writable"
);