Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to MuseScore 4 #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions comments.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,25 @@ MuseScore {
//pluginType : "Dialog"
//requiresScore: true // needs MuseScore > 2.0.3

Component.onCompleted : {
if (mscoreMajorVersion >= 4) {
title = qsTr("Comments") ;
// thumbnailName = ".png";
// categoryCode = "some_category";
}
}

onRun : {

curScore.startCmd()

if (!curScore) {
Qt.quit();
quit();
} else {
window.visible = true
}

curScore.endCmd()
}

Window {
Expand All @@ -32,7 +44,7 @@ MuseScore {
property var score : curScore
//SL Added title so it is obvious which score the text will be added to
title : {"MuseScore : " + curScore.name}
color : "silver"
color : "gray"

Settings {
id : settings
Expand Down Expand Up @@ -64,7 +76,7 @@ MuseScore {
anchors.topMargin : textLabel.height + 5
anchors.bottomMargin : 5

color : "lightgray"
color : "gray"
radius : 2

TextArea {
Expand All @@ -79,7 +91,7 @@ MuseScore {
textFormat : TextEdit.PlainText
//SL Changed from onPressed as in some circumstances the last key pressed was lost.
Keys.onReleased : {
if (event.key == Qt.Key_Escape) {
if (event.key === Qt.Key_Escape) {
window.close();
} else {
curScore.setMetaTag("comments", abcText.text)
Expand Down Expand Up @@ -115,7 +127,7 @@ MuseScore {
curScore.setMetaTag("comments", abcText.text)
settings.metrics = JSON.stringify(metrics);
}
Qt.quit()
quit()
}
//Added onActiveChanged so we can test if the score has been changed.
onActiveChanged : {
Expand Down