Skip to content

Commit

Permalink
Delay undo/redo while saving in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
manongjohn committed Jan 27, 2024
1 parent a36213c commit 084a5ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions toonz/sources/toonz/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,10 @@ Room *MainWindow::getCurrentRoom() const {
//-----------------------------------------------------------------------------

void MainWindow::onUndo() {
// Must wait for current save to finish, just in case
while (TApp::instance()->isSaveInProgress())
;

ToolHandle *toolH = TApp::instance()->getCurrentTool();

// do not use undo if tool is currently in use
Expand All @@ -946,6 +950,10 @@ void MainWindow::onUndo() {
//-----------------------------------------------------------------------------

void MainWindow::onRedo() {
// Must wait for current save to finish, just in case
while (TApp::instance()->isSaveInProgress())
;

bool ret = TUndoManager::manager()->redo();
if (!ret) DVGui::error(QObject::tr("No more Redo operations available."));
}
Expand Down

0 comments on commit 084a5ed

Please sign in to comment.