mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
182fe790c9
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>
40 lines
734 B
C++
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
|