| 1 |
import QtQuick 2.9 |
| 2 |
import Lomiri.Components 1.3 |
| 3 |
import Lomiri.Components.Popups 1.3 |
| 4 |
import Lomiri.Components.ListItems 1.3 as ListItem |
| 5 |
|
| 6 |
Item { |
| 7 |
id: root |
| 8 |
|
| 9 |
property var signonRequest: request |
| 10 |
|
| 11 |
width: units.gu(60) |
| 12 |
height: units.gu(90) |
| 13 |
|
| 14 |
Component.onCompleted: dialog.show() |
| 15 |
|
| 16 |
Dialog { |
| 17 |
id: dialog |
| 18 |
objectName: "signOnUiDialog" |
| 19 |
title: signonRequest.title |
| 20 |
text: signonRequest.message |
| 21 |
|
| 22 |
Label { |
| 23 |
id: userNameLabel |
| 24 |
objectName: "userNameLabel" |
| 25 |
visible: signonRequest.queryUserName |
| 26 |
text: signonRequest.userNameText |
| 27 |
} |
| 28 |
|
| 29 |
TextField { |
| 30 |
id: userNameField |
| 31 |
objectName: "userNameField" |
| 32 |
visible: signonRequest.queryUserName |
| 33 |
text: signonRequest.userName |
| 34 |
onTextChanged: signonRequest.userName = text |
| 35 |
} |
| 36 |
|
| 37 |
Column { |
| 38 |
anchors.left: parent.left |
| 39 |
anchors.right: parent.right |
| 40 |
visible: signonRequest.queryPassword |
| 41 |
|
| 42 |
Label { |
| 43 |
id: passwordLabel |
| 44 |
objectName: "passwordLabel" |
| 45 |
text: signonRequest.passwordText |
| 46 |
} |
| 47 |
|
| 48 |
TextField { |
| 49 |
id: passwordField |
| 50 |
objectName: "passwordField" |
| 51 |
text: signonRequest.password |
| 52 |
echoMode: TextInput.Password |
| 53 |
onTextChanged: signonRequest.password = text |
| 54 |
Keys.onReturnPressed: signonRequest.accept() |
| 55 |
} |
| 56 |
Label { |
| 57 |
objectName: "forgotPasswordLabel" |
| 58 |
visible: signonRequest.forgotPasswordUrl.toString() !== "" |
| 59 |
text: "<a href=\"" + signonRequest.forgotPasswordUrl + "\">" + |
| 60 |
signonRequest.forgotPasswordText + "</a>" |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
Item { |
| 65 |
id: pageFooter |
| 66 |
anchors.left: parent.left |
| 67 |
anchors.right: parent.right |
| 68 |
visible: signonRequest.registerUrl.toString() !== "" |
| 69 |
|
| 70 |
ListItem.ThinDivider { |
| 71 |
anchors.bottom: registerUrlLabel.top |
| 72 |
} |
| 73 |
|
| 74 |
Label { |
| 75 |
id: registerUrlLabel |
| 76 |
objectName: "registerUrlLabel" |
| 77 |
anchors.bottom: parent.bottom |
| 78 |
text: "<a href=\"" + signonRequest.registerUrl + "\">" + |
| 79 |
signonRequest.registerText + "</a>" |
| 80 |
} |
| 81 |
} |
| 82 |
|
| 83 |
Item { |
| 84 |
anchors.left: parent.left |
| 85 |
anchors.right: parent.right |
| 86 |
height: childrenRect.height |
| 87 |
|
| 88 |
Button { |
| 89 |
objectName: "cancelButton" |
| 90 |
anchors.left: parent.left |
| 91 |
text: i18n.dtr("lomiri-online-accounts", "Cancel") |
| 92 |
width: (parent.width / 2) - 0.5 * units.gu(1) |
| 93 |
onClicked: signonRequest.cancel() |
| 94 |
} |
| 95 |
|
| 96 |
Button { |
| 97 |
objectName: "acceptButton" |
| 98 |
anchors.right: parent.right |
| 99 |
text: signonRequest.loginText |
| 100 |
width: (parent.width / 2) - 0.5 * units.gu(1) |
| 101 |
onClicked: signonRequest.accept() |
| 102 |
} |
| 103 |
} |
| 104 |
} |
| 105 |
} |