From 7f995c749fd6d4a49f7512eb15be33159a03a392 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Sep 2019 07:49:07 -0400 Subject: [PATCH] HPasswordPopup: enable OK if password not empty --- src/qml/Base/HBoxPopup.qml | 5 ++++- src/qml/Base/HPasswordPopup.qml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qml/Base/HBoxPopup.qml b/src/qml/Base/HBoxPopup.qml index 5f0154d9..746f995c 100644 --- a/src/qml/Base/HBoxPopup.qml +++ b/src/qml/Base/HBoxPopup.qml @@ -14,11 +14,14 @@ HPopup { property alias details: details property bool okClicked: false + property string okText: qsTr("OK") + property bool okEnabled: true + box.focusButton: "ok" box.clickButtonOnEnter: "ok" box.buttonModel: [ - { name: "ok", text: qsTr("OK"), iconName: "ok" }, + { name: "ok", text: okText, iconName: "ok" , enabled: okEnabled}, { name: "cancel", text: qsTr("Cancel"), iconName: "cancel" }, ] box.buttonCallbacks: ({ diff --git a/src/qml/Base/HPasswordPopup.qml b/src/qml/Base/HPasswordPopup.qml index 1065d7c9..962b4f5d 100644 --- a/src/qml/Base/HPasswordPopup.qml +++ b/src/qml/Base/HPasswordPopup.qml @@ -5,6 +5,7 @@ import "../SidePane" HBoxPopup { id: popup + okEnabled: Boolean(passwordField.text) onAboutToShow: { okClicked = false