Skip to content

Commit e16dd52

Browse files
diedenoJojo-Schmitz
authored andcommitted
Port to Musescore 4
1 parent c86371e commit e16dd52

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

blacknotes.qml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,26 @@ MuseScore {
2828
description: "This plugin paints all chords and rests in black"
2929
menuPath: "Plugins.Notes.Color Notes in Black"
3030

31+
32+
Component.onCompleted : {
33+
if (mscoreMajorVersion >= 4) {
34+
title = qsTr("Black Notes") ;
35+
// thumbnailName = ".png";
36+
categoryCode = "color-notes";
37+
}
38+
}
39+
40+
41+
42+
43+
3144
MessageDialog {
3245
id: versionError
3346
visible: false
3447
title: qsTr("Unsupported MuseScore Version")
3548
text: qsTr("This plugin needs MuseScore 3.0.2 or later")
3649
onAccepted: {
37-
Qt.quit()
50+
quit()
3851
}
3952
}
4053

@@ -129,12 +142,18 @@ MuseScore {
129142
}
130143

131144
onRun: {
145+
146+
curScore.startCmd()
147+
132148
console.log("Hello, Black Notes")
133149
// check MuseScore version
134-
if (mscoreMajorVersion == 3 && mscoreMinorVersion == 0 && mscoreUpdateVersion <= 1)
150+
if ((mscoreMajorVersion < 3) || ((mscoreMajorVersion == 3 && mscoreMinorVersion == 0 && mscoreUpdateVersion <= 1)))
135151
versionError.open()
136152
else
137-
applyToChordsAndRestsInSelection(blackenElement)
138-
Qt.quit();
153+
applyToChordsAndRestsInSelection(blackenElement)
154+
155+
curScore.endCmd()
156+
157+
quit();
139158
}
140159
}

0 commit comments

Comments
 (0)