Commit f663bd84 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Improve error message when review dialog contents are wrong

BUG: 387261
parent 1b70104f
......@@ -34,20 +34,19 @@ Kirigami.OverlaySheet
TextArea {
id: reviewInput
property bool acceptableInput: false
readonly property bool acceptableInput: inputIssue.count === 0
readonly property string inputIssue: length < 15 ? i18n("Comment too short") :
length > 3000 ? i18n("Comment too long") : ""
Layout.fillWidth: true
Layout.fillHeight: true
onLengthChanged: {
acceptableInput = length >= 15 && length < 3000
}
}
Button {
id: acceptButton
Layout.alignment: Qt.AlignRight
enabled: summaryInput.acceptableInput && reviewInput.acceptableInput
text: i18n("Accept")
text: summaryInput.acceptableInput && reviewInput.acceptableInput ? i18n("Accept")
: !summaryInput.acceptableInput ? i18n("Improve summary") : reviewInput.inputIssue
onClicked: {
reviewDialog.accepted()
reviewDialog.sheetOpen = false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment