2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-05-27 07:15:42 +00:00
|
|
|
import QtQuick.Dialogs 1.3
|
2020-06-17 19:18:31 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2021-10-12 18:26:02 +00:00
|
|
|
|
2022-05-06 06:46:41 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2022-07-21 11:29:18 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Controls.Validators 0.1
|
2022-05-06 06:46:41 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-10-20 12:23:58 +00:00
|
|
|
|
2022-08-22 15:35:39 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
import shared.controls 1.0
|
2022-04-07 19:02:54 +00:00
|
|
|
import shared.controls.chat 1.0
|
2022-05-06 06:46:41 +00:00
|
|
|
import "../panels"
|
2021-10-12 18:26:02 +00:00
|
|
|
import "../popups"
|
|
|
|
import "../stores"
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-20 22:47:23 +00:00
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2020-05-27 07:15:42 +00:00
|
|
|
|
2020-06-11 21:23:27 +00:00
|
|
|
Item {
|
2022-07-20 12:34:44 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property StartupStore startupStore
|
2020-06-01 14:36:06 +00:00
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
d.resetLogin()
|
|
|
|
}
|
2021-09-13 11:51:47 +00:00
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
onStateChanged: {
|
2022-09-26 09:31:32 +00:00
|
|
|
d.loading = false
|
2022-07-21 11:29:18 +00:00
|
|
|
pinInputField.statesInitialization()
|
|
|
|
pinInputField.forceFocus()
|
2021-09-13 11:51:47 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
property bool loading: false
|
|
|
|
|
|
|
|
readonly property string stateLoginRegularUser: "regularUserLogin"
|
|
|
|
readonly property string stateLoginKeycardUser: "keycardUserLogin"
|
|
|
|
|
|
|
|
property int index: 0
|
|
|
|
property variant images : [
|
|
|
|
Style.svg("keycard/card0@2x"),
|
|
|
|
Style.svg("keycard/card1@2x"),
|
|
|
|
Style.svg("keycard/card2@2x"),
|
|
|
|
Style.svg("keycard/card3@2x")
|
|
|
|
]
|
|
|
|
|
|
|
|
property int remainingAttempts: parseInt(root.startupStore.startupModuleInst.keycardData, 10)
|
|
|
|
onRemainingAttemptsChanged: {
|
|
|
|
pinInputField.statesInitialization()
|
|
|
|
pinInputField.forceFocus()
|
2021-09-13 11:51:47 +00:00
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
|
|
|
|
function doLogin(password) {
|
|
|
|
if (d.loading || password.length === 0)
|
|
|
|
return
|
|
|
|
|
|
|
|
d.loading = true
|
|
|
|
txtPassword.textField.clear()
|
|
|
|
root.startupStore.setPassword(password)
|
|
|
|
root.startupStore.doPrimaryAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
function doKeycardLogin(pin) {
|
|
|
|
if (d.loading || pin.length === 0)
|
|
|
|
return
|
|
|
|
|
|
|
|
d.loading = true
|
|
|
|
root.startupStore.setPin(pin)
|
|
|
|
root.startupStore.doPrimaryAction()
|
|
|
|
}
|
|
|
|
|
|
|
|
function resetLogin() {
|
|
|
|
if(localAccountSettings.storeToKeychainValue !== Constants.keychain.storedValue.store)
|
|
|
|
{
|
|
|
|
if (!root.startupStore.selectedLoginAccount.keycardCreatedAccount){
|
|
|
|
txtPassword.visible = true
|
|
|
|
txtPassword.forceActiveFocus(Qt.MouseFocusReason)
|
|
|
|
}
|
|
|
|
}
|
2021-09-13 11:51:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
Timer {
|
|
|
|
interval: 400
|
|
|
|
running: root.state === d.stateLoginKeycardUser ||
|
|
|
|
root.state === Constants.startupState.loginKeycardInsertKeycard ||
|
|
|
|
root.state === Constants.startupState.loginKeycardReadingKeycard
|
|
|
|
repeat: true
|
|
|
|
onTriggered: {
|
|
|
|
d.index++
|
|
|
|
image.source = d.images[d.index % d.images.length]
|
|
|
|
}
|
2021-09-13 11:51:47 +00:00
|
|
|
}
|
|
|
|
|
2021-10-17 10:44:21 +00:00
|
|
|
Connections{
|
2022-07-20 12:34:44 +00:00
|
|
|
target: root.startupStore.startupModuleInst
|
2021-09-13 11:51:47 +00:00
|
|
|
|
2021-10-17 10:44:21 +00:00
|
|
|
onObtainingPasswordError: {
|
2022-07-21 11:29:18 +00:00
|
|
|
if (root.startupStore.selectedLoginAccount.keycardCreatedAccount) {
|
|
|
|
root.startupStore.doPrimaryAction() // in this case, switch to enter pin state
|
|
|
|
}
|
|
|
|
|
|
|
|
if (errorType === Constants.keychain.errorType.authentication) {
|
|
|
|
// We are notifying user only about keychain errors.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-10-17 10:44:21 +00:00
|
|
|
obtainingPasswordErrorNotification.confirmationText = errorDescription
|
|
|
|
obtainingPasswordErrorNotification.open()
|
|
|
|
}
|
2021-09-13 11:51:47 +00:00
|
|
|
|
2021-10-17 10:44:21 +00:00
|
|
|
onObtainingPasswordSuccess: {
|
2022-07-21 11:29:18 +00:00
|
|
|
if(localAccountSettings.storeToKeychainValue !== Constants.keychain.storedValue.store)
|
|
|
|
return
|
|
|
|
|
|
|
|
if (root.startupStore.selectedLoginAccount.keycardCreatedAccount) {
|
|
|
|
d.doKeycardLogin(password)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
d.doLogin(password)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onAccountLoginError: {
|
|
|
|
if (error) {
|
|
|
|
if (!root.startupStore.selectedLoginAccount.keycardCreatedAccount) {
|
|
|
|
// SQLITE_NOTADB: "file is not a database"
|
|
|
|
if (error === "file is not a database") {
|
|
|
|
txtPassword.validationError = qsTr("Password incorrect")
|
|
|
|
} else {
|
|
|
|
txtPassword.validationError = qsTr("Login failed: %1").arg(error.toUpperCase())
|
|
|
|
}
|
|
|
|
d.loading = false
|
|
|
|
txtPassword.textField.forceActiveFocus()
|
|
|
|
}
|
|
|
|
}
|
2021-10-17 10:44:21 +00:00
|
|
|
}
|
|
|
|
}
|
2021-09-13 11:51:47 +00:00
|
|
|
|
|
|
|
ConfirmationDialog {
|
|
|
|
id: obtainingPasswordErrorNotification
|
|
|
|
height: 270
|
|
|
|
confirmButtonLabel: qsTr("Ok")
|
|
|
|
|
|
|
|
onConfirmButtonClicked: {
|
|
|
|
close()
|
|
|
|
}
|
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
txtPassword.visible = true
|
|
|
|
}
|
2020-05-28 04:06:57 +00:00
|
|
|
}
|
2020-06-30 20:01:37 +00:00
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
ColumnLayout {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
spacing: Style.current.bigPadding
|
2020-05-27 07:15:42 +00:00
|
|
|
|
2022-05-06 06:46:41 +00:00
|
|
|
Image {
|
2022-07-21 11:29:18 +00:00
|
|
|
id: image
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-05-06 06:46:41 +00:00
|
|
|
fillMode: Image.PreserveAspectFit
|
2022-07-21 11:29:18 +00:00
|
|
|
antialiasing: true
|
|
|
|
mipmap: true
|
2020-06-04 13:00:17 +00:00
|
|
|
}
|
2020-05-27 07:15:42 +00:00
|
|
|
|
2022-05-06 06:46:41 +00:00
|
|
|
StatusBaseText {
|
2022-07-21 11:29:18 +00:00
|
|
|
id: title
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2020-06-11 21:23:27 +00:00
|
|
|
font.weight: Font.Bold
|
2022-08-09 14:41:23 +00:00
|
|
|
font.pixelSize: Constants.onboarding.titleFontSize
|
2022-05-06 06:46:41 +00:00
|
|
|
color: Theme.palette.directColor1
|
2020-05-27 07:15:42 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
Item {
|
|
|
|
id: userInfo
|
|
|
|
height: userImage.height
|
|
|
|
width: 318
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-08-09 14:41:23 +00:00
|
|
|
Layout.topMargin: Style.current.xlPadding
|
2022-07-21 11:29:18 +00:00
|
|
|
|
|
|
|
UserImage {
|
|
|
|
id: userImage
|
2022-08-18 07:38:47 +00:00
|
|
|
objectName: "loginViewUserImage"
|
2022-07-21 11:29:18 +00:00
|
|
|
image: root.startupStore.selectedLoginAccount.thumbnailImage
|
|
|
|
name: root.startupStore.selectedLoginAccount.username
|
|
|
|
colorId: root.startupStore.selectedLoginAccount.colorId
|
|
|
|
colorHash: root.startupStore.selectedLoginAccount.colorHash
|
|
|
|
anchors.left: parent.left
|
2022-08-09 14:41:23 +00:00
|
|
|
imageHeight: Constants.onboarding.userImageHeight
|
|
|
|
imageWidth: Constants.onboarding.userImageWidth
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: usernameText
|
2022-09-01 07:53:22 +00:00
|
|
|
objectName: "currentUserNameLabel"
|
2022-07-21 11:29:18 +00:00
|
|
|
text: root.startupStore.selectedLoginAccount.username
|
|
|
|
font.pixelSize: 17
|
|
|
|
anchors.left: userImage.right
|
|
|
|
anchors.right: root.startupStore.selectedLoginAccount.keycardCreatedAccount?
|
|
|
|
keycardIcon.left : changeAccountBtn.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.verticalCenter: userImage.verticalCenter
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
elide: Text.ElideRight
|
2020-06-12 20:47:44 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
StatusIcon {
|
|
|
|
id: keycardIcon
|
|
|
|
visible: root.startupStore.selectedLoginAccount.keycardCreatedAccount
|
|
|
|
anchors.right: changeAccountBtn.left
|
|
|
|
anchors.verticalCenter: userImage.verticalCenter
|
|
|
|
icon: "keycard"
|
|
|
|
height: Style.current.padding
|
|
|
|
color: Theme.palette.baseColor1
|
2020-06-11 21:23:27 +00:00
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: changeAccountBtn.clicked(mouse)
|
2020-06-12 20:47:44 +00:00
|
|
|
}
|
2020-06-11 21:23:27 +00:00
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: changeAccountBtn
|
2022-08-03 17:31:59 +00:00
|
|
|
objectName: "loginChangeAccountButton"
|
2022-07-21 11:29:18 +00:00
|
|
|
icon.name: "chevron-down"
|
2022-08-09 14:41:23 +00:00
|
|
|
icon.rotation: accountsPopup.opened ? 180 : 0
|
2022-07-21 11:29:18 +00:00
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
width: 24
|
|
|
|
height: 24
|
|
|
|
anchors.verticalCenter: usernameText.verticalCenter
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
if (accountsPopup.opened) {
|
|
|
|
accountsPopup.close()
|
|
|
|
} else {
|
2022-08-15 08:05:03 +00:00
|
|
|
accountsPopup.topMargin =
|
|
|
|
Qt.binding(function(){
|
|
|
|
return userInfo.mapToItem(
|
|
|
|
root,
|
|
|
|
root.height,
|
|
|
|
userInfo.height + Style.current.halfPadding).y
|
|
|
|
})
|
2022-08-09 14:41:23 +00:00
|
|
|
accountsPopup.popup(
|
|
|
|
userInfo,
|
|
|
|
(userInfo.width - accountsPopup.width) / 2,
|
|
|
|
userInfo.height + Style.current.halfPadding)
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusPopupMenu {
|
|
|
|
id: accountsPopup
|
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
2022-08-09 14:41:23 +00:00
|
|
|
width: parent.width + Style.current.bigPadding
|
2022-07-21 11:29:18 +00:00
|
|
|
dim: false
|
2022-08-22 15:35:39 +00:00
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: proxyModel
|
|
|
|
sourceModel: root.startupStore.startupModuleInst.loginAccountsModel
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "keyUid"
|
|
|
|
value: root.startupStore.selectedLoginAccount.keyUid
|
|
|
|
inverted: true
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-22 15:35:39 +00:00
|
|
|
Column {
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: proxyModel
|
|
|
|
|
|
|
|
delegate: AccountMenuItemPanel {
|
|
|
|
label: model.username
|
|
|
|
image: model.thumbnailImage
|
|
|
|
colorId: model.colorId
|
|
|
|
colorHash: model.colorHash
|
|
|
|
keycardCreatedAccount: model.keycardCreatedAccount
|
|
|
|
onClicked: {
|
|
|
|
d.resetLogin()
|
|
|
|
accountsPopup.close()
|
|
|
|
const realIndex = proxyModel.mapToSource(index)
|
|
|
|
root.startupStore.setSelectedLoginAccountByIndex(realIndex)
|
|
|
|
}
|
|
|
|
}
|
2022-05-11 14:45:15 +00:00
|
|
|
}
|
|
|
|
|
2022-08-22 15:35:39 +00:00
|
|
|
AccountMenuItemPanel {
|
|
|
|
label: qsTr("Add new user")
|
2022-09-09 12:51:10 +00:00
|
|
|
asset.name: "add"
|
2022-08-22 15:35:39 +00:00
|
|
|
onClicked: {
|
|
|
|
accountsPopup.close()
|
|
|
|
root.startupStore.doSecondaryAction()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AccountMenuItemPanel {
|
|
|
|
label: qsTr("Add existing Status user")
|
2022-09-09 12:51:10 +00:00
|
|
|
asset.name: "wallet"
|
2022-08-22 15:35:39 +00:00
|
|
|
onClicked: {
|
|
|
|
accountsPopup.close()
|
|
|
|
root.startupStore.doTertiaryAction()
|
|
|
|
}
|
2020-06-12 20:47:44 +00:00
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
2020-06-03 06:38:26 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
Item {
|
|
|
|
id: passwordSection
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: txtPassword.height
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
|
|
|
Input {
|
|
|
|
id: txtPassword
|
2022-08-03 17:31:59 +00:00
|
|
|
textField.objectName: "loginPasswordInput"
|
|
|
|
validationErrorObjectName: "loginPassworkInputValidationErrorText"
|
2022-07-21 11:29:18 +00:00
|
|
|
width: 318
|
|
|
|
height: 70
|
|
|
|
enabled: !d.loading
|
|
|
|
validationErrorAlignment: Text.AlignHCenter
|
|
|
|
validationErrorTopMargin: 10
|
|
|
|
placeholderText: d.loading ?
|
|
|
|
qsTr("Connecting...") :
|
|
|
|
qsTr("Password")
|
|
|
|
textField.echoMode: TextInput.Password
|
|
|
|
Keys.onReturnPressed: {
|
|
|
|
d.doLogin(textField.text)
|
|
|
|
}
|
|
|
|
onTextEdited: {
|
|
|
|
validationError = "";
|
|
|
|
d.loading = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusRoundButton {
|
|
|
|
id: submitBtn
|
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
type: StatusRoundButton.Type.Secondary
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
opacity: (d.loading || txtPassword.text.length > 0) ? 1 : 0
|
|
|
|
anchors.left: txtPassword.right
|
|
|
|
anchors.leftMargin: (d.loading || txtPassword.text.length > 0) ? Style.current.padding : Style.current.smallPadding
|
|
|
|
state: d.loading ? "pending" : "default"
|
|
|
|
onClicked: {
|
|
|
|
d.doLogin(txtPassword.textField.text)
|
|
|
|
}
|
|
|
|
|
|
|
|
// https://www.figma.com/file/BTS422M9AkvWjfRrXED3WC/%F0%9F%91%8B-Onboarding%E2%8E%9CDesktop?node-id=6%3A0
|
|
|
|
Behavior on opacity {
|
|
|
|
OpacityAnimator {
|
|
|
|
from: 0.5
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Behavior on anchors.leftMargin {
|
|
|
|
NumberAnimation {
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
2021-01-26 18:37:58 +00:00
|
|
|
}
|
2020-05-27 07:15:42 +00:00
|
|
|
}
|
2021-07-21 05:50:35 +00:00
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
Column {
|
|
|
|
id: pinSection
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
spacing: Style.current.padding
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: qsTr("Enter Keycard PIN")
|
2021-07-21 05:50:35 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
StatusPinInput {
|
|
|
|
id: pinInputField
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
validator: StatusIntValidator{bottom: 0; top: 999999;}
|
|
|
|
pinLen: Constants.keycard.general.keycardPinLength
|
|
|
|
enabled: !d.loading
|
|
|
|
|
|
|
|
onPinInputChanged: {
|
|
|
|
if(pinInput.length == 0)
|
|
|
|
return
|
|
|
|
root.startupStore.setPin(pinInput)
|
|
|
|
root.startupStore.doPrimaryAction()
|
2021-07-21 05:50:35 +00:00
|
|
|
}
|
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: info
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize3
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
id: message
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize3
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: button
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
onClicked: {
|
|
|
|
root.startupStore.doPrimaryAction()
|
2020-06-11 21:23:27 +00:00
|
|
|
}
|
2020-06-22 19:32:00 +00:00
|
|
|
}
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
StatusBaseText {
|
|
|
|
id: link
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
color: Theme.palette.primaryColor1
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: {
|
|
|
|
parent.font.underline = true
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
parent.font.underline = false
|
|
|
|
}
|
|
|
|
onClicked: {
|
|
|
|
root.startupStore.doPrimaryAction()
|
2021-10-15 19:47:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-27 07:15:42 +00:00
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
|
|
|
|
states: [
|
|
|
|
State {
|
|
|
|
name: d.stateLoginRegularUser
|
|
|
|
when: !root.startupStore.selectedLoginAccount.keycardCreatedAccount
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.png("status-logo")
|
2022-08-10 13:42:09 +00:00
|
|
|
Layout.preferredHeight: 128
|
|
|
|
Layout.preferredWidth: 128
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: qsTr("Welcome back")
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: d.stateLoginKeycardUser
|
|
|
|
when: root.startupStore.selectedLoginAccount.keycardCreatedAccount &&
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.login
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
2022-09-13 09:55:19 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginPlugin
|
|
|
|
when: root.startupStore.selectedLoginAccount.keycardCreatedAccount &&
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.loginPlugin
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Plug in Keycard reader...")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardInsertKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardInsertKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Insert your Keycard...")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
2022-08-12 07:33:12 +00:00
|
|
|
visible: root.startupStore.startupModuleInst.keycardData !== ""
|
|
|
|
text: qsTr("Check the card, it might be wrongly inserted")
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize3
|
|
|
|
color: Theme.palette.baseColor1
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardReadingKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardReadingKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Reading Keycard...")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardEnterPin
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardEnterPin
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardWrongKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardWrongKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card-wrong3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Wrong Keycard!\nThe card inserted is not linked to your profile.")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: qsTr("Insert another Keycard")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardWrongPin
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardWrongPin
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card-wrong3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("PIN incorrect")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
text: qsTr("%n attempt(s) remaining", "", d.remainingAttempts)
|
|
|
|
color: d.remainingAttempts === 1?
|
|
|
|
Theme.palette.dangerColor1 :
|
|
|
|
Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardMaxPinRetriesReached
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardMaxPinRetriesReached
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card-error3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Keycard locked")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: qsTr("Recover your Keycard")
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardMaxPukRetriesReached
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardMaxPukRetriesReached
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card-error3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Keycard locked")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: qsTr("Recover with seed phrase")
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardEmpty
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardEmpty
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card-wrong3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("The card inserted is empty")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: qsTr("Generate keys for a new Keycard")
|
|
|
|
visible: true
|
|
|
|
}
|
2022-09-13 09:55:19 +00:00
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginNotKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginNotKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.svg("keycard/card-wrong3@2x")
|
|
|
|
Layout.preferredHeight: sourceSize.height
|
|
|
|
Layout.preferredWidth: sourceSize.width
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("This is not a Keycard")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: qsTr("The card inserted is not a recognised Keycard,\nplease remove and try and again")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
]
|
2022-08-12 07:33:12 +00:00
|
|
|
}
|