Skip to content

Commit cd8a3b0

Browse files
author
laurent
committed
"No score" dialog box.
1 parent da2d81f commit cd8a3b0

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

workoutbuilder.qml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,9 @@ MuseScore {
17111711
var score = curScore;
17121712

17131713
if (score == null) {
1714-
console.log("!! No Score");
1714+
console.log("no score");
1715+
cannotFetchPhraseFromSelectionDialog.message="No current score";
1716+
cannotFetchPhraseFromSelectionDialog.open();
17151717
return;
17161718
}
17171719

@@ -1730,7 +1732,9 @@ MuseScore {
17301732
}
17311733

17321734
if (!chords || (chords.length == 0)) {
1733-
console.log("!! No selection");
1735+
console.log("no selection");
1736+
cannotFetchPhraseFromSelectionDialog.message="No selection.";
1737+
cannotFetchPhraseFromSelectionDialog.open();
17341738
return;
17351739
}
17361740

@@ -1784,7 +1788,9 @@ MuseScore {
17841788
}
17851789

17861790
if (grid.length == 0) {
1787-
console.log("!! No chords");
1791+
console.log("no chords");
1792+
cannotFetchPhraseFromSelectionDialog.message="No chords text found in the selection";
1793+
cannotFetchPhraseFromSelectionDialog.open();
17881794
return;
17891795
}
17901796

@@ -2536,7 +2542,8 @@ MuseScore {
25362542
}
25372543
ImageButton {
25382544
imageSource: "upload.svg"
2539-
ToolTip.text: "Retrieve from selection"
2545+
ToolTip.text: "Fetch phrase from current score"
2546+
// enabled: curScore!=null
25402547
imageHeight: 25
25412548
imagePadding: (buttonBox.contentItem.height - imageHeight) / 2
25422549
onClicked: {
@@ -2569,7 +2576,7 @@ MuseScore {
25692576
when: modeIndex() != 0;
25702577
PropertyChanges {
25712578
target: labRoots
2572-
text: "Grid:"
2579+
text: "Phrase:"
25732580
}
25742581
}
25752582
]
@@ -3378,6 +3385,19 @@ MuseScore {
33783385
}
33793386
}
33803387

3388+
MessageDialog {
3389+
id: cannotFetchPhraseFromSelectionDialog
3390+
icon: StandardIcon.Warning
3391+
standardButtons: StandardButton.Ok
3392+
property var message: ""
3393+
title: 'Fetch phrase from score'
3394+
text: "Failed to fetch a phrase from the current score:\n"+message+
3395+
"\n\nNote: This action requires a score being openened and that a selection made, containing chord texts."
3396+
onAccepted: {
3397+
cannotFetchPhraseFromSelectionDialog.close()
3398+
}
3399+
}
3400+
33813401
function getPatterns(uglyHack) {
33823402
return patterns;
33833403
}

workoutbuilder/ImageButton.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Button {
1313
implicitWidth: smbtn.width
1414
implicitHeight: smbtn.height
1515

16-
color: smbtn.down ? "#C0C0C0" : (smbtn.hovered ? "#D0D0D0" : (smbtn.highlighted?"lightsteelblue":"transparent" /*"#E0E0E0"*/))
16+
color: smbtn.down ? "#C0C0C0" : (smbtn.enabled?(smbtn.hovered ? "#D0D0D0" : (smbtn.highlighted?"lightsteelblue":"transparent" /*"#E0E0E0"*/)):"#D7CEE0")
1717
//border.color: "red"
1818
//border.width: 1
1919
radius: 4

0 commit comments

Comments
 (0)