From 3828d10bcea98b2d0e9d76efdd44561494c02d91 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 6 Mar 2016 14:04:01 +0200 Subject: [PATCH] Fixed issue #454. Crash: using CRTL+Z while using line tool. (grafted from 574b96a0b75cf276766eef61d2bb16ea79a604de) --HG-- branch : develop --- ChangeLog.txt | 1 + src/app/valentina/mainwindow.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 69b4264b9..7e6ee7ee5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -11,6 +11,7 @@ - [#385] Add 'Open Recent' option in Tape.exe, 'File' dropdown menu. # Version 0.4.3 +- [#454] Crash: using CRTL+Z while using line tool - Fixed broken saving pattern description. - Fixed UI bug. Release a dialog size for deploying a formula field. - Fixed broken formula when for system locale thousand separator is a space. diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 122b2b302..310c9bfaa 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -1674,6 +1674,12 @@ void MainWindow::CancelTool() ui->actionArrowTool->setChecked(false); helpLabel->setText(""); ui->actionStopTool->setEnabled(true); + + // Crash: using CRTL+Z while using line tool. + // related bug report: + // https://bitbucket.org/dismine/valentina/issues/454/crash-using-crtl-z-while-using-line-tool + undoAction->setEnabled(false); + redoAction->setEnabled(false); return; case Tool::BasePoint: Q_UNREACHABLE(); //-V501 @@ -1774,6 +1780,12 @@ void MainWindow::CancelTool() } currentScene->setFocus(Qt::OtherFocusReason); currentScene->clearSelection(); + + // Crash: using CRTL+Z while using line tool. + // related bug report: + // https://bitbucket.org/dismine/valentina/issues/454/crash-using-crtl-z-while-using-line-tool + undoAction->setEnabled(qApp->getUndoStack()->canUndo()); + redoAction->setEnabled(qApp->getUndoStack()->canRedo()); } //---------------------------------------------------------------------------------------------------------------------