summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Grace Karanja <gracie.karanja89@gmail.com>2015-02-11 09:10:34 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-11 07:59:46 -0800
commit013da6b0af3e3dd5d074f2dbbc342d9b948717b4 (patch)
tree4bc4cf314e0088f1c76736e45d3d7dcb817a0baf /qt-ui/mainwindow.cpp
parent6374d9cc0334c7dc7af908b4cb9233a091a48740 (diff)
downloadsubsurface-013da6b0af3e3dd5d074f2dbbc342d9b948717b4.tar.gz
Reverse undo buffer
Reverse all the code using the UndoBuffer class so that we can use the QUndoStack and QUndoCommand classes. These are Qt's own inbuild undo framework classes, offering a better undo/redo process. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp19
1 files changed, 0 insertions, 19 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 163ff7d61..9908e2402 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -36,7 +36,6 @@
#include "usermanual.h"
#endif
#include <QNetworkProxy>
-#include "undobuffer.h"
MainWindow *MainWindow::m_Instance = NULL;
@@ -108,7 +107,6 @@ MainWindow::MainWindow() : QMainWindow(),
connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled()));
connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan()));
- connect(ui.menu_Edit, SIGNAL(aboutToShow()), this, SLOT(checkForUndoAndRedo()));
#ifdef NO_PRINTING
ui.printPlan->hide();
ui.menuFile->removeAction(ui.actionPrint);
@@ -182,7 +180,6 @@ MainWindow::MainWindow() : QMainWindow(),
toolBar->setContentsMargins(zeroMargins);
updateManager = new UpdateManager(this);
- undoBuffer = new UndoBuffer(this);
}
MainWindow::~MainWindow()
@@ -1502,22 +1499,6 @@ void MainWindow::on_actionFilterTags_triggered()
ui.multiFilter->setVisible(true);
}
-void MainWindow::on_action_Undo_triggered()
-{
- undoBuffer->undo();
-}
-
-void MainWindow::on_action_Redo_triggered()
-{
- undoBuffer->redo();
-}
-
-void MainWindow::checkForUndoAndRedo()
-{
- ui.action_Undo->setEnabled(undoBuffer->canUndo());
- ui.action_Redo->setEnabled(undoBuffer->canRedo());
-}
-
void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topLeft, QWidget *topRight, QWidget *bottomLeft, QWidget *bottomRight)
{
applicationState[state] = WidgetForQuadrant(topLeft, topRight, bottomLeft, bottomRight);