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

Define AudacityProject::RollbackState() for reuse elsewhere

This commit is contained in:
Paul Licameli 2015-07-08 12:38:45 -04:00
parent d8ce9f0d7d
commit f35d519c21
3 changed files with 7 additions and 2 deletions

View File

@ -683,8 +683,7 @@ bool BatchCommands::ApplyChain(const wxString & filename)
{
if(proj) {
// Chain failed or was cancelled; revert to the previous state
UndoManager *um = proj->GetUndoManager();
proj->SetStateTo(um->GetCurrentState());
proj->RollbackState();
}
return false;
}

View File

@ -3933,6 +3933,11 @@ void AudacityProject::PushState(wxString desc,
AutoSave();
}
void AudacityProject::RollbackState()
{
SetStateTo(GetUndoManager()->GetCurrentState());
}
void AudacityProject::ModifyState(bool bWantsAutoSave)
{
mUndoManager.ModifyState(mTracks, mViewInfo.selectedRegion);

View File

@ -473,6 +473,7 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
void PushState(wxString desc, wxString shortDesc,
int flags = PUSH_AUTOSAVE);
void RollbackState();
private: