mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
0995a800d9
commit
182fe790c9
3 changed files with 54 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue