Merge pull request #11630 from VanSHOE/task11455

fix:#11455: Double clicking instrument automatically submits
This commit is contained in:
Casper Jeukendrup 2022-05-14 11:18:09 +02:00 committed by GitHub
commit 751c0866ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 6 deletions

View File

@ -39,6 +39,8 @@ Rectangle {
property NavigationSection navigationSection: null
signal submitRequested()
function instruments() {
if (root.canSelectMultipleInstruments) {
return instrumentsOnScoreView.instruments()
@ -142,6 +144,10 @@ Rectangle {
onAddSelectedInstrumentsToScoreRequested: {
prv.addSelectedInstrumentsToScore()
if (!root.canSelectMultipleInstruments) {
root.submitRequested()
}
}
}

View File

@ -43,6 +43,15 @@ StyledDialogView {
instrumentsPage.focusOnFirst()
}
function submit() {
var result = {}
result["instruments"] = instrumentsPage.instruments()
result["scoreOrder"] = instrumentsPage.currentOrder()
root.ret = { errcode: 0, value: result }
root.hide()
}
ColumnLayout {
anchors.fill: parent
spacing: 20
@ -57,6 +66,10 @@ StyledDialogView {
currentInstrumentId: root.currentInstrumentId
navigationSection: root.navigationSection
onSubmitRequested: {
root.submit()
}
}
RowLayout {
@ -106,12 +119,7 @@ StyledDialogView {
navigation.column: 2
onClicked: {
var result = {}
result["instruments"] = instrumentsPage.instruments()
result["scoreOrder"] = instrumentsPage.currentOrder()
root.ret = { errcode: 0, value: result }
root.hide()
root.submit()
}
}
}