summaryrefslogtreecommitdiffstats
path: root/qt-ui/undocommands.h
diff options
context:
space:
mode:
authorGravatar Grace Karanja <gracie.karanja89@gmail.com>2015-02-28 07:42:37 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-28 12:44:14 +0100
commit182fe790c9e88898ec3d8bd4be68614a560415bb (patch)
treee05d4e9ca250adfbeaec8aac9a44d34f03f8c2bf /qt-ui/undocommands.h
parent0995a800d915c606ca78ea210ccc1fba290d1eea (diff)
downloadsubsurface-182fe790c9e88898ec3d8bd4be68614a560415bb.tar.gz
Add ability to undo renumbering of dives
Expand the undo feature by storing a list of renumbered dives' ids and numbers so that the original numbers can be restored if needed. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/undocommands.h')
-rw-r--r--qt-ui/undocommands.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/qt-ui/undocommands.h b/qt-ui/undocommands.h
index addef8138..36c789fee 100644
--- a/qt-ui/undocommands.h
+++ b/qt-ui/undocommands.h
@@ -2,6 +2,7 @@
#define UNDOCOMMANDS_H
#include <QUndoCommand>
+#include <QMap>
#include "dive.h"
class UndoDeleteDive : public QUndoCommand {
@@ -25,4 +26,15 @@ private:
int timeChanged;
};
+class UndoRenumberDives : public QUndoCommand {
+public:
+ UndoRenumberDives(QMap<int,int> originalNumbers, int startNumber);
+ virtual void undo();
+ virtual void redo();
+
+private:
+ QMap<int,int> oldNumbers;
+ int start;
+};
+
#endif // UNDOCOMMANDS_H