|
From: Tapio V. <aa...@us...> - 2011-01-19 11:25:11
|
Module: editor
Branch: master
Commit: 2636231fa65aff8f08a213e1b840ce93f8ad5793
Author: Tapio Vierros <tap...@gm...>
Date: Wed Jan 19 13:23:42 2011 +0200
Note height adjust from keyboard is now undoable.
Info is also now updated.
---
notegraphwidget.cc | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index e755f1e..32e6cb5 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -344,12 +344,18 @@ void NoteGraphWidget::keyPressEvent(QKeyEvent *event)
break;
case Qt::Key_Up: // Move note up
if (m_selectedNote) {
- m_selectedNote->move(m_selectedNote->x(), m_pitch->note2px(m_pitch->px2note(m_selectedNote->y()) + 1));
+ Operation op("MOVE");
+ op << getNoteLabelId(m_selectedNote);
+ op << m_selectedNote->x() << n2px(px2n(m_selectedNote->y()) + 1);
+ doOperation(op);
}
break;
case Qt::Key_Down: // Move note down
if (m_selectedNote) {
- m_selectedNote->move(m_selectedNote->x(), m_pitch->note2px(m_pitch->px2note(m_selectedNote->y()) - 1));
+ Operation op("MOVE");
+ op << getNoteLabelId(m_selectedNote);
+ op << m_selectedNote->x() << n2px(px2n(m_selectedNote->y()) - 1);
+ doOperation(op);
}
break;
case Qt::Key_Delete: // Delete selected note
@@ -407,8 +413,10 @@ void NoteGraphWidget::doOperation(const Operation& op, Operation::OperationFlags
}
updateNotes();
}
- if (!(flags & Operation::NO_EMIT))
+ if (!(flags & Operation::NO_EMIT)) {
emit operationDone(op);
+ emit updateNoteInfo(m_selectedNote);
+ }
}
|