From 6d996a78742deb349cc1cb66ddea6abfb1b813d5 Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Wed, 11 Feb 2015 09:28:43 +0300 Subject: [PATCH] Add a structure to hold undo commands Add the undocommands.cpp / undocommands.h files, which will hold a collection of classes that will hold undo commands. Signed-off-by: Dirk Hohndel --- qt-ui/undocommands.cpp | 16 ++++++++++++++++ qt-ui/undocommands.h | 17 +++++++++++++++++ subsurface.pro | 6 ++++-- 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 qt-ui/undocommands.cpp create mode 100644 qt-ui/undocommands.h diff --git a/qt-ui/undocommands.cpp b/qt-ui/undocommands.cpp new file mode 100644 index 000000000..f76f021b3 --- /dev/null +++ b/qt-ui/undocommands.cpp @@ -0,0 +1,16 @@ +#include "undocommands.h" + +UndoDeleteDive::UndoDeleteDive(QList diveList) +{ + +} + +void UndoDeleteDive::undo() +{ + +} + +void UndoDeleteDive::redo() +{ + +} diff --git a/qt-ui/undocommands.h b/qt-ui/undocommands.h new file mode 100644 index 000000000..9a7803f9e --- /dev/null +++ b/qt-ui/undocommands.h @@ -0,0 +1,17 @@ +#ifndef UNDOCOMMANDS_H +#define UNDOCOMMANDS_H + +#include +#include "dive.h" + +class UndoDeleteDive : public QUndoCommand { +public: + UndoDeleteDive(QList diveList); + virtual void undo(); + virtual void redo(); + +private: + QList dives; +}; + +#endif // UNDOCOMMANDS_H diff --git a/subsurface.pro b/subsurface.pro index 5fb6ab5d2..d65c94f50 100644 --- a/subsurface.pro +++ b/subsurface.pro @@ -104,7 +104,8 @@ HEADERS = \ qt-ui/statistics/statisticsbar.h \ qt-ui/statistics/yearstatistics.h \ qt-ui/diveshareexportdialog.h \ - qt-ui/filtermodels.h + qt-ui/filtermodels.h \ + qt-ui/undocommands.h android: HEADERS -= \ qt-ui/usermanual.h \ @@ -198,7 +199,8 @@ SOURCES = \ qt-ui/statistics/statisticsbar.cpp \ qt-ui/statistics/monthstatistics.cpp \ qt-ui/diveshareexportdialog.cpp \ - qt-ui/filtermodels.cpp + qt-ui/filtermodels.cpp \ + qt-ui/undocommands.cpp android: SOURCES += android.cpp else: win32: SOURCES += windows.c