Workout Editor Redo/Undo

.. we only have two commands; create and move point
   but baking this in early so we can adopt it for
   all other commands as they arrive.

.. due to the interactive nature of a graphical editor
   the command class behaves differently to the one
   used on the ride data editor; commands are added to
   the stack when they complete (so move point isn't a
   history of the mouse cursor moving its just the begin
   and end point).
This commit is contained in:
Mark Liversedge
2015-12-31 12:01:21 +00:00
parent 874779ec09
commit 83dea1b3b1
6 changed files with 219 additions and 23 deletions

View File

@@ -64,12 +64,12 @@ WorkoutWindow::WorkoutWindow(Context *context) :
// icon in that instance would be horrible
QIcon undoIcon(":images/toolbar/undo.png");
undoAct = new QAction(undoIcon, tr("Undo"), this);
connect(undoAct, SIGNAL(triggered()), this, SLOT(undo()));
connect(undoAct, SIGNAL(triggered()), workout, SLOT(undo()));
toolbar->addAction(undoAct);
QIcon redoIcon(":images/toolbar/redo.png");
redoAct = new QAction(redoIcon, tr("Redo"), this);
connect(redoAct, SIGNAL(triggered()), this, SLOT(redo()));
connect(redoAct, SIGNAL(triggered()), workout, SLOT(redo()));
toolbar->addAction(redoAct);
toolbar->addSeparator();
@@ -135,16 +135,6 @@ WorkoutWindow::saveFile()
{
}
void
WorkoutWindow::undo()
{
}
void
WorkoutWindow::redo()
{
}
void
WorkoutWindow::drawMode()
{