mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Bug 2540 - No low disk space warning on startup
This commit is contained in:
parent
783183a4dd
commit
7fe18235d9
@ -13,6 +13,8 @@
|
||||
#include "Project.h"
|
||||
|
||||
#include "KeyboardCapture.h"
|
||||
#include "FileNames.h"
|
||||
#include "widgets\ErrorDialog.h"
|
||||
|
||||
#include <wx/display.h>
|
||||
#include <wx/frame.h>
|
||||
@ -122,6 +124,22 @@ AudacityProject::AudacityProject()
|
||||
AttachedObjects::BuildAll();
|
||||
// But not for the attached windows. They get built only on demand, such as
|
||||
// from menu items.
|
||||
|
||||
// Make sure there is plenty of space for Sqlite files
|
||||
wxLongLong freeSpace = 0;
|
||||
|
||||
auto path = FileNames::FindDefaultPath(FileNames::Operation::Temp);
|
||||
if (wxGetDiskSpace(path, NULL, &freeSpace)) {
|
||||
if (freeSpace < wxLongLong(wxLL(100 * 1048576))) {
|
||||
ShowErrorDialog(nullptr,
|
||||
XO("Warning"),
|
||||
XO("There is very little free disk space left.\n"
|
||||
"Please select a bigger temporary directory in Preferences."),
|
||||
"Error:_Disk_full_or_not_writable"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AudacityProject::~AudacityProject()
|
||||
|
Loading…
x
Reference in New Issue
Block a user