aboutsummaryrefslogtreecommitdiff
path: root/components/PasswordDialog.qml
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2018-10-24 03:50:56 +0000
committerxiphon <xiphon@protonmail.com>2018-10-24 06:54:31 +0300
commit39855241fcd0747ebe95e2e92cd5cfcb2d5a64be (patch)
treef29dbcb964c9a8d1e25b37a2d83f95199a16a01a /components/PasswordDialog.qml
parent3aa6da058a697378d8b6ee0864a559c207a332e2 (diff)
downloadmonzero-gui-39855241fcd0747ebe95e2e92cd5cfcb2d5a64be.tar.gz
monzero-gui-39855241fcd0747ebe95e2e92cd5cfcb2d5a64be.tar.xz
monzero-gui-39855241fcd0747ebe95e2e92cd5cfcb2d5a64be.zip
password dialog: show error in place
Diffstat (limited to 'components/PasswordDialog.qml')
-rw-r--r--components/PasswordDialog.qml20
1 files changed, 19 insertions, 1 deletions
diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml
index 1da76a6d..230db37f 100644
--- a/components/PasswordDialog.qml
+++ b/components/PasswordDialog.qml
@@ -42,15 +42,17 @@ Item {
property alias password: passwordInput.text
property string walletName
+ property string errorText
// same signals as Dialog has
signal accepted()
signal rejected()
signal closeCallback()
- function open(walletName) {
+ function open(walletName, errorText) {
inactiveOverlay.visible = true // draw appwindow inactive
root.walletName = walletName ? walletName : ""
+ root.errorText = errorText ? errorText : "";
leftPanel.enabled = false
middlePanel.enabled = false
titleBar.enabled = false
@@ -60,6 +62,10 @@ Item {
passwordInput.text = ""
}
+ function showError(errorText) {
+ open(root.walletName, errorText);
+ }
+
function close() {
inactiveOverlay.visible = false
leftPanel.enabled = true
@@ -93,6 +99,18 @@ Item {
color: MoneroComponents.Style.defaultFontColor
}
+ Label {
+ text: root.errorText
+ visible: root.errorText
+
+ anchors.left: parent.left
+ color: MoneroComponents.Style.errorColor
+ font.pixelSize: 16 * scaleRatio
+ font.family: MoneroComponents.Style.fontLight.name
+ Layout.fillWidth: true
+ wrapMode: Text.Wrap
+ }
+
TextField {
id : passwordInput
Layout.topMargin: 6