1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-10 16:43:33 +02:00

AUP3: Remove (ifdef()) Discard/Compact from History window

This commit is contained in:
Leland Lucius
2020-08-03 16:40:51 -05:00
parent 1e6c2ace29
commit 06877a7742

View File

@@ -110,6 +110,7 @@ HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager):
.AddTextBox(XXO("&Total space used"), wxT("0"), 10); .AddTextBox(XXO("&Total space used"), wxT("0"), 10);
S.AddVariableText( {} )->Hide(); S.AddVariableText( {} )->Hide();
#if defined(ALLOW_DISCARD)
mAvail = S.Id(ID_AVAIL) mAvail = S.Id(ID_AVAIL)
.ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar) .ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar)
.AddTextBox(XXO("&Undo levels available"), wxT("0"), 10); .AddTextBox(XXO("&Undo levels available"), wxT("0"), 10);
@@ -128,18 +129,24 @@ HistoryDialog::HistoryDialog(AudacityProject *parent, UndoManager *manager):
S.AddWindow(mLevels); S.AddWindow(mLevels);
/* i18n-hint: (verb)*/ /* i18n-hint: (verb)*/
mDiscard = S.Id(ID_DISCARD).AddButton(XXO("&Discard")); mDiscard = S.Id(ID_DISCARD).AddButton(XXO("&Discard"));
#endif
mClipboard = S mClipboard = S
.ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar) .ConnectRoot(wxEVT_KEY_DOWN, &HistoryDialog::OnChar)
.AddTextBox(XXO("Clip&board space used"), wxT("0"), 10); .AddTextBox(XXO("Clip&board space used"), wxT("0"), 10);
#if defined(ALLOW_DISCARD)
S.Id(ID_DISCARD_CLIPBOARD).AddButton(XXO("D&iscard")); S.Id(ID_DISCARD_CLIPBOARD).AddButton(XXO("D&iscard"));
#endif
} }
S.EndMultiColumn(); S.EndMultiColumn();
} }
S.EndStatic(); S.EndStatic();
#if defined(ALLOW_DISCARD)
mCompact = safenew wxButton(this, ID_COMPACT, _("&Compact")); mCompact = safenew wxButton(this, ID_COMPACT, _("&Compact"));
S.AddStandardButtons(eOkButton | eHelpButton, mCompact); S.AddStandardButtons(eOkButton | eHelpButton, mCompact);
#else
S.AddStandardButtons(eOkButton | eHelpButton);
#endif
} }
S.EndVerticalLay(); S.EndVerticalLay();
// ----------------------- End of main section -------------- // ----------------------- End of main section --------------
@@ -179,8 +186,10 @@ void HistoryDialog::OnAudioIO(wxCommandEvent& evt)
else else
mAudioIOBusy = false; mAudioIOBusy = false;
#if defined(ALLOW_DISCARD)
mDiscard->Enable(!mAudioIOBusy); mDiscard->Enable(!mAudioIOBusy);
mCompact->Enable(!mAudioIOBusy); mCompact->Enable(!mAudioIOBusy);
#endif
} }
void HistoryDialog::UpdateDisplay(wxEvent& e) void HistoryDialog::UpdateDisplay(wxEvent& e)
@@ -219,7 +228,9 @@ void HistoryDialog::DoUpdate()
auto clipboardUsage = mManager->GetClipboardSpaceUsage(); auto clipboardUsage = mManager->GetClipboardSpaceUsage();
mClipboard->SetValue(Internat::FormatSize(clipboardUsage).Translation()); mClipboard->SetValue(Internat::FormatSize(clipboardUsage).Translation());
#if defined(ALLOW_DISCARD)
FindWindowById(ID_DISCARD_CLIPBOARD)->Enable(clipboardUsage > 0); FindWindowById(ID_DISCARD_CLIPBOARD)->Enable(clipboardUsage > 0);
#endif
mList->EnsureVisible(mSelected); mList->EnsureVisible(mSelected);
@@ -232,6 +243,7 @@ void HistoryDialog::DoUpdate()
void HistoryDialog::UpdateLevels() void HistoryDialog::UpdateLevels()
{ {
#if defined(ALLOW_DISCARD)
wxWindow *focus; wxWindow *focus;
int value = mLevels->GetValue(); int value = mLevels->GetValue();
@@ -255,6 +267,7 @@ void HistoryDialog::UpdateLevels()
mLevels->Enable(mSelected > 0); mLevels->Enable(mSelected > 0);
mDiscard->Enable(!mAudioIOBusy && mSelected > 0); mDiscard->Enable(!mAudioIOBusy && mSelected > 0);
#endif
} }
void HistoryDialog::OnDiscard(wxCommandEvent & WXUNUSED(event)) void HistoryDialog::OnDiscard(wxCommandEvent & WXUNUSED(event))