1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

AUP3: UP-33 History window shows misleading "space used"

Possible fix...will need feedback.
This commit is contained in:
Leland Lucius
2020-07-15 09:26:23 -05:00
parent 2accd9e93f
commit 5eb9f75150
4 changed files with 17 additions and 4 deletions

View File

@@ -40,11 +40,13 @@ undo memory so as to free up space.
#include "../images/Empty9x16.xpm"
#include "UndoManager.h"
#include "Project.h"
#include "ProjectFileIO.h"
#include "ProjectHistory.h"
#include "ShuttleGui.h"
enum {
ID_AVAIL = 1000,
ID_FILESIZE,
ID_TOTAL,
ID_LEVELS,
ID_DISCARD,
@@ -98,6 +100,11 @@ HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager):
S.StartMultiColumn(3, wxCENTRE);
{
mFileSize = S.Id(ID_FILESIZE)
.ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar)
.AddTextBox(XXO("&Project file size"), wxT("0"), 10);
S.AddVariableText( {} )->Hide();
mTotal = S.Id(ID_TOTAL)
.ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar)
.AddTextBox(XXO("&Total space used"), wxT("0"), 10);
@@ -201,6 +208,10 @@ void HistoryDialog::DoUpdate()
mList->DeleteAllItems();
wxFileName filename(ProjectFileIO::Get(*mProject).GetFileName());
wxULongLong_t filesize = filename.GetSize().GetValue();
mFileSize->SetValue(Internat::FormatSize(filesize).Translation());
wxLongLong_t total = 0;
mSelected = mManager->GetCurrentState() - 1;
for (i = 0; i < (int)mManager->GetNumStates(); i++) {