From d3d0496d3a91725c12ac18ce5b17801ed944bdbf Mon Sep 17 00:00:00 2001
From: SeeLook <945374+SeeLook@users.noreply.github.com>
Date: Sat, 28 May 2016 13:05:26 +0200
Subject: [PATCH] clicking melody note displays guitar position (only
 exercises)

---
 changes                            | 6 ++++++
 src/plugins/exam/texamexecutor.cpp | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/changes b/changes
index 8ed943a10..c520395fa 100644
--- a/changes
+++ b/changes
@@ -1,3 +1,9 @@
+1.2.6
+     - clicking melody note displays guitar position (only exercises)
+     - updated Russian translation
+    BUGS FIXES
+     - keep right-side note pane always visible, even at the staff end
+
 1.2A.5 rc1
    ANDROID
      - added update checker
diff --git a/src/plugins/exam/texamexecutor.cpp b/src/plugins/exam/texamexecutor.cpp
index 6cc5e46aa..ddaffdb76 100755
--- a/src/plugins/exam/texamexecutor.cpp
+++ b/src/plugins/exam/texamexecutor.cpp
@@ -1477,7 +1477,7 @@ void TexamExecutor::noteOfMelodyStarted(const TnoteStruct& n) {
     m_exam->curQ()->lastAttempt()->melodyWasPlayed();
   m_melody->noteStarted();
 	if (m_melody->currentIndex() == 0) // first played note was detected
-		m_exam->curQ()->lastAttempt()->setPrepareTime(m_penalty->elapsedTime() - n.duration);
+    m_exam->curQ()->lastAttempt()->setPrepareTime(m_penalty->elapsedTime() - quint32(n.duration));
   if (m_melody->currentIndex() + 1 < m_exam->curQ()->melody()->length()) // highlight next note
     SCORE->selectNote(m_melody->currentIndex() + 1);
 }
@@ -1502,6 +1502,8 @@ void TexamExecutor::noteOfMelodySelected(int nr) {
   SCORE->selectNote(nr);
   SOUND->go();
   m_canvas->clearConfirmTip();
+  if (isExercise() && GUITAR->isVisible() && m_exam->curQ()->melody()) // in exercises, display guitar position of clicked note for a hint
+      GUITAR->setFinger(m_exam->curQ()->melody()->note(nr)->g());
 }
 
 
-- 
GitLab