From d3b228df25e848be4f6d8b06c23eaa3a5e0d8874 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 23 May 2015 18:37:55 +0300 Subject: [PATCH] Enable redo/undo actions if stack is not empty. --HG-- branch : develop --- src/app/mainwindow.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index ceb408544..788004b4b 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1233,8 +1233,14 @@ void MainWindow::ActionDraw(bool checked) ui->actionArrowTool->setEnabled(true); ui->actionShowCurveDetails->setEnabled(true); actionDockWidgetToolOptions->setEnabled(true); - undoAction->setEnabled(true); - redoAction->setEnabled(true); + if (qApp->getUndoStack()->canUndo()) + { + undoAction->setEnabled(true); + } + if (qApp->getUndoStack()->canRedo()) + { + redoAction->setEnabled(true); + } if (qApp->patternType() == MeasurementsType::Standard) { @@ -1290,8 +1296,14 @@ void MainWindow::ActionDetails(bool checked) ui->actionArrowTool->setEnabled(true); ui->actionShowCurveDetails->setEnabled(false); actionDockWidgetToolOptions->setEnabled(true); - undoAction->setEnabled(true); - redoAction->setEnabled(true); + if (qApp->getUndoStack()->canUndo()) + { + undoAction->setEnabled(true); + } + if (qApp->getUndoStack()->canRedo()) + { + redoAction->setEnabled(true); + } if (qApp->patternType() == MeasurementsType::Standard) {