From e51da26a1a657bba8f13f46c02c077440c53b9fa Mon Sep 17 00:00:00 2001 From: Dave French Date: Mon, 26 Jan 2015 22:23:19 +0000 Subject: [PATCH] Automation editior undo --- src/gui/editors/AutomationEditor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index bde69e950..7c4b77dbf 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -447,7 +447,6 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) { return; } - if( mouseEvent->y() > TOP_MARGIN ) { float level = getLevel( mouseEvent->y() ); @@ -493,6 +492,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) if( mouseEvent->button() == Qt::LeftButton && m_editMode == DRAW ) { + m_pattern->addJournalCheckPoint(); // Connect the dots if( mouseEvent->modifiers() & Qt::ShiftModifier ) { @@ -537,6 +537,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) m_editMode == DRAW ) || m_editMode == ERASE ) { + m_pattern->addJournalCheckPoint(); // erase single value if( it != time_map.end() ) { @@ -566,6 +567,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) else if( mouseEvent->button() == Qt::LeftButton && m_editMode == MOVE ) { + m_pattern->addJournalCheckPoint(); // move selection (including selected values) // save position where move-process began @@ -1660,6 +1662,7 @@ void AutomationEditor::setProgressionType(AutomationPattern::ProgressionTypes ty { if (validPattern()) { + m_pattern->addJournalCheckPoint(); QMutexLocker m(&m_patternMutex); m_pattern->setProgressionType(type); Engine::getSong()->setModified(); @@ -1799,6 +1802,7 @@ void AutomationEditor::cutSelectedValues() return; } + m_pattern->addJournalCheckPoint(); m_valuesToCopy.clear(); timeMap selected_values; @@ -1828,6 +1832,7 @@ void AutomationEditor::pasteValues() QMutexLocker m( &m_patternMutex ); if( validPattern() && !m_valuesToCopy.isEmpty() ) { + m_pattern->addJournalCheckPoint(); for( timeMap::iterator it = m_valuesToCopy.begin(); it != m_valuesToCopy.end(); ++it ) { @@ -1854,6 +1859,7 @@ void AutomationEditor::deleteSelectedValues() return; } + m_pattern->addJournalCheckPoint(); timeMap selected_values; getSelectedValues( selected_values );