HPasswordPopup: enable OK if password not empty
This commit is contained in:
parent
e5893c5569
commit
7f995c749f
|
@ -14,11 +14,14 @@ HPopup {
|
||||||
property alias details: details
|
property alias details: details
|
||||||
property bool okClicked: false
|
property bool okClicked: false
|
||||||
|
|
||||||
|
property string okText: qsTr("OK")
|
||||||
|
property bool okEnabled: true
|
||||||
|
|
||||||
|
|
||||||
box.focusButton: "ok"
|
box.focusButton: "ok"
|
||||||
box.clickButtonOnEnter: "ok"
|
box.clickButtonOnEnter: "ok"
|
||||||
box.buttonModel: [
|
box.buttonModel: [
|
||||||
{ name: "ok", text: qsTr("OK"), iconName: "ok" },
|
{ name: "ok", text: okText, iconName: "ok" , enabled: okEnabled},
|
||||||
{ name: "cancel", text: qsTr("Cancel"), iconName: "cancel" },
|
{ name: "cancel", text: qsTr("Cancel"), iconName: "cancel" },
|
||||||
]
|
]
|
||||||
box.buttonCallbacks: ({
|
box.buttonCallbacks: ({
|
||||||
|
|
|
@ -5,6 +5,7 @@ import "../SidePane"
|
||||||
|
|
||||||
HBoxPopup {
|
HBoxPopup {
|
||||||
id: popup
|
id: popup
|
||||||
|
okEnabled: Boolean(passwordField.text)
|
||||||
|
|
||||||
onAboutToShow: {
|
onAboutToShow: {
|
||||||
okClicked = false
|
okClicked = false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user