subsurface/qt-ui/undocommands.h
Grace Karanja 182fe790c9 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>
2015-02-28 12:44:14 +01:00

40 lines
734 B
C++

#ifndef UNDOCOMMANDS_H
#define UNDOCOMMANDS_H
#include <QUndoCommand>
#include <QMap>
#include "dive.h"
class UndoDeleteDive : public QUndoCommand {
public:
UndoDeleteDive(QList<struct dive*> diveList);
virtual void undo();
virtual void redo();
private:
QList<struct dive*> dives;
};
class UndoShiftTime : public QUndoCommand {
public:
UndoShiftTime(QList<int> diveList, int amount);
virtual void undo();
virtual void redo();
private:
QList<int> dives;
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