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-09-30 19:16:15 +00:00
|
|
|
import shared.popups.keycard.helpers 1.0
|
|
|
|
|
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"
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-10-12 09:42:51 +00:00
|
|
|
import AppLayouts.Onboarding.stores 1.0
|
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-09-30 19:16:15 +00:00
|
|
|
if(state === Constants.startupState.loginKeycardPinVerified) {
|
|
|
|
pinInputField.setPin("123456") // we are free to set fake pin in this case
|
|
|
|
pinInputField.enabled = false
|
|
|
|
} else {
|
|
|
|
pinInputField.statesInitialization()
|
|
|
|
pinInputField.forceFocus()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Timer {
|
|
|
|
id: timer
|
|
|
|
interval: 1000
|
|
|
|
running: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardRecognizedKeycard ||
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardPinVerified
|
|
|
|
onTriggered: {
|
|
|
|
root.startupStore.doPrimaryAction()
|
|
|
|
}
|
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"
|
|
|
|
|
2022-11-16 18:35:40 +00:00
|
|
|
property int remainingAttempts: root.startupStore.startupModuleInst.remainingAttempts
|
2022-07-21 11:29:18 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 (errorType === Constants.keychain.errorType.authentication) {
|
|
|
|
// We are notifying user only about keychain errors.
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-09-30 19:16:15 +00:00
|
|
|
image.source = Style.png("keycard/biometrics-fail")
|
|
|
|
info.icon = ""
|
|
|
|
info.color = Theme.palette.dangerColor1
|
|
|
|
info.text = qsTr("Fingerprint not recognized")
|
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginHeight
|
2022-07-21 11:29:18 +00:00
|
|
|
spacing: Style.current.bigPadding
|
2020-05-27 07:15:42 +00:00
|
|
|
|
2022-09-30 19:16:15 +00:00
|
|
|
KeycardImage {
|
2022-07-21 11:29:18 +00:00
|
|
|
id: image
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-09-30 19:16:15 +00:00
|
|
|
Layout.preferredHeight: Constants.keycard.general.imageHeight
|
|
|
|
Layout.preferredWidth: Constants.keycard.general.imageWidth
|
|
|
|
|
|
|
|
onAnimationCompleted: {
|
|
|
|
if (root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardInsertedKeycard ||
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardReadingKeycard) {
|
|
|
|
root.startupStore.doPrimaryAction()
|
|
|
|
}
|
|
|
|
}
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
Layout.preferredHeight: userImage.height
|
|
|
|
Layout.preferredWidth: 318
|
2022-07-21 11:29:18 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-09-30 19:16:15 +00:00
|
|
|
enabled: root.startupStore.currentStartupState.stateType !== Constants.startupState.loginKeycardReadingKeycard &&
|
|
|
|
root.startupStore.currentStartupState.stateType !== Constants.startupState.loginKeycardRecognizedKeycard &&
|
|
|
|
root.startupStore.currentStartupState.stateType !== Constants.startupState.loginKeycardPinVerified
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusMenu {
|
2022-07-21 11:29:18 +00:00
|
|
|
id: accountsPopup
|
2022-08-09 14:41:23 +00:00
|
|
|
width: parent.width + Style.current.bigPadding
|
2022-08-22 15:35:39 +00:00
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: proxyModel
|
|
|
|
sourceModel: root.startupStore.startupModuleInst.loginAccountsModel
|
2023-01-16 13:37:14 +00:00
|
|
|
sorters: StringSorter {
|
|
|
|
roleName: "order"
|
|
|
|
sortOrder: Qt.AscendingOrder
|
|
|
|
}
|
2022-08-22 15:35:39 +00:00
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "keyUid"
|
|
|
|
value: root.startupStore.selectedLoginAccount.keyUid
|
|
|
|
inverted: true
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-16 13:37:14 +00:00
|
|
|
onAboutToShow: {
|
|
|
|
repeaterId.model = []
|
|
|
|
repeaterId.model = proxyModel
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
Repeater {
|
2023-01-16 13:37:14 +00:00
|
|
|
id: repeaterId
|
2022-12-01 16:58:37 +00:00
|
|
|
objectName: "LoginView_AccountsRepeater"
|
2022-05-11 14:45:15 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
delegate: AccountMenuItemPanel {
|
2023-01-16 13:37:14 +00:00
|
|
|
objectName: {
|
|
|
|
if (model.username === Constants.appTranslatableConstants.loginAccountsListAddNewUser) {
|
|
|
|
return "LoginView_addNewUserItem"
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
label: {
|
|
|
|
if (model.username === Constants.appTranslatableConstants.loginAccountsListAddNewUser ||
|
|
|
|
model.username === Constants.appTranslatableConstants.loginAccountsListAddExistingUser) {
|
|
|
|
return Constants.appTranslationMap[model.username]
|
|
|
|
}
|
|
|
|
return model.username
|
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
image: model.thumbnailImage
|
2023-01-16 13:37:14 +00:00
|
|
|
asset.name: model.icon
|
|
|
|
colorId: model.colorId > -1? model.colorId : ""
|
2022-12-01 16:58:37 +00:00
|
|
|
colorHash: model.colorHash
|
|
|
|
keycardCreatedAccount: model.keycardCreatedAccount
|
2022-08-22 15:35:39 +00:00
|
|
|
onClicked: {
|
2023-01-16 13:37:14 +00:00
|
|
|
if (model.username === Constants.appTranslatableConstants.loginAccountsListAddNewUser) {
|
|
|
|
accountsPopup.close()
|
|
|
|
root.startupStore.doTertiaryAction()
|
|
|
|
}
|
|
|
|
else if (model.username === Constants.appTranslatableConstants.loginAccountsListAddExistingUser) {
|
|
|
|
accountsPopup.close()
|
|
|
|
root.startupStore.doQuaternaryAction()
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
d.resetLogin()
|
|
|
|
accountsPopup.close()
|
|
|
|
const realIndex = proxyModel.mapToSource(index)
|
|
|
|
root.startupStore.setSelectedLoginAccountByIndex(realIndex)
|
|
|
|
}
|
2022-08-22 15:35:39 +00:00
|
|
|
}
|
|
|
|
}
|
2022-12-01 16:58:37 +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
|
|
|
|
|
2022-09-30 19:16:15 +00:00
|
|
|
property alias text: pinText.text
|
|
|
|
|
2022-07-21 11:29:18 +00:00
|
|
|
StatusBaseText {
|
2022-09-30 19:16:15 +00:00
|
|
|
id: pinText
|
2022-07-21 11:29:18 +00:00
|
|
|
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: {
|
2022-09-30 19:16:15 +00:00
|
|
|
if (root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardPinVerified)
|
|
|
|
return
|
|
|
|
if (root.state !== Constants.startupState.loginKeycardWrongPin) {
|
|
|
|
image.source = Style.png("keycard/enter-pin-%1".arg(pinInput.length))
|
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2022-09-30 19:16:15 +00:00
|
|
|
Row {
|
2022-07-21 11:29:18 +00:00
|
|
|
id: info
|
2022-09-30 19:16:15 +00:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
|
|
|
|
property alias text: infoTxt.text
|
|
|
|
property alias font: infoTxt.font
|
|
|
|
property alias color: infoTxt.color
|
|
|
|
property alias icon: infoIcon.icon
|
|
|
|
|
|
|
|
StatusIcon {
|
|
|
|
id: infoIcon
|
|
|
|
visible: icon !== ""
|
|
|
|
width: Style.current.padding
|
|
|
|
height: Style.current.padding
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
StatusLoadingIndicator {
|
|
|
|
id: loading
|
|
|
|
visible: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardReadingKeycard
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
id: infoTxt
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize3
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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: {
|
2022-09-30 19:16:15 +00:00
|
|
|
root.startupStore.doSecondaryAction()
|
2021-10-15 19:47:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-30 19:16:15 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2020-05-27 07:15:42 +00:00
|
|
|
}
|
2022-07-21 11:29:18 +00:00
|
|
|
|
|
|
|
states: [
|
|
|
|
State {
|
|
|
|
name: d.stateLoginRegularUser
|
2022-09-30 19:16:15 +00:00
|
|
|
when: !root.startupStore.selectedLoginAccount.keycardCreatedAccount &&
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.login
|
2022-07-21 11:29:18 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-09-30 19:16:15 +00:00
|
|
|
source: localAccountSettings.storeToKeychainValue === Constants.keychain.storedValue.store?
|
|
|
|
Style.png("keycard/biometrics-success") : Style.png("status-logo")
|
|
|
|
pattern: ""
|
|
|
|
Layout.preferredHeight: localAccountSettings.storeToKeychainValue === Constants.keychain.storedValue.store?
|
|
|
|
Constants.keycard.general.imageHeight :
|
|
|
|
Constants.keycard.general.loginStatusLogoHeight
|
|
|
|
Layout.preferredWidth: localAccountSettings.storeToKeychainValue === Constants.keychain.storedValue.store?
|
|
|
|
Constants.keycard.general.imageWidth :
|
|
|
|
Constants.keycard.general.loginStatusLogoWidth
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
2022-09-30 19:16:15 +00:00
|
|
|
text: localAccountSettings.storeToKeychainValue === Constants.keychain.storedValue.store? "" : qsTr("Welcome back")
|
|
|
|
visible: localAccountSettings.storeToKeychainValue !== Constants.keychain.storedValue.store
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
2022-09-30 19:16:15 +00:00
|
|
|
visible: localAccountSettings.storeToKeychainValue !== Constants.keychain.storedValue.store
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Waiting for TouchID...")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: "touch-id"
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Use password instead")
|
|
|
|
visible: true
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: d.stateLoginKeycardUser
|
|
|
|
when: root.startupStore.selectedLoginAccount.keycardCreatedAccount &&
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.login
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-09-30 19:16:15 +00:00
|
|
|
source: Style.png("keycard/biometrics-success")
|
|
|
|
pattern: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Waiting for TouchID...")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: "touch-id"
|
2022-09-13 09:55:19 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Use PIN instead")
|
|
|
|
visible: true
|
2022-09-13 09:55:19 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginPlugin
|
|
|
|
when: root.startupStore.selectedLoginAccount.keycardCreatedAccount &&
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.loginPlugin
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-09-30 19:16:15 +00:00
|
|
|
source: Style.png("keycard/empty-reader")
|
|
|
|
pattern: ""
|
2022-09-13 09:55:19 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.cardInsert.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInsert.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.cardInsert.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.cardInsert.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.cardInsert.duration
|
|
|
|
loops: Constants.keycardAnimations.cardInsert.loops
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
2022-09-29 13:30:17 +00:00
|
|
|
visible: root.startupStore.startupModuleInst.keycardData & Constants.predefinedKeycardData.wronglyInsertedCard
|
2022-08-12 07:33:12 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
},
|
2022-09-30 19:16:15 +00:00
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardInsertedKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardInsertedKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.cardInserted.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInserted.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.cardInserted.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.cardInserted.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.cardInserted.duration
|
|
|
|
loops: Constants.keycardAnimations.cardInserted.loops
|
2022-09-30 19:16:15 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Keycard inserted...")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
2022-07-21 11:29:18 +00:00
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardReadingKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardReadingKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.warning.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.warning.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.warning.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.warning.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.warning.duration
|
|
|
|
loops: Constants.keycardAnimations.warning.loops
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardRecognizedKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardRecognizedKeycard
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.success.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.success.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.success.duration
|
|
|
|
loops: Constants.keycardAnimations.success.loops
|
2022-09-30 19:16:15 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: qsTr("Keycard recognized")
|
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: "checkmark"
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardEnterPassword
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardEnterPassword
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
|
|
|
source: Style.png("status-logo")
|
|
|
|
pattern: ""
|
|
|
|
Layout.preferredHeight: Constants.keycard.general.loginStatusLogoHeight
|
|
|
|
Layout.preferredWidth: Constants.keycard.general.loginStatusLogoWidth
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: qsTr("Welcome back")
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
|
|
|
text: ""
|
|
|
|
visible: true
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
source: Style.png("keycard/card-empty")
|
|
|
|
pattern: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: true
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Enter Keycard PIN")
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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 {
|
2022-09-30 19:16:15 +00:00
|
|
|
name: Constants.startupState.loginKeycardPinVerified
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardPinVerified
|
2022-07-21 11:29:18 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.strongSuccess.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongSuccess.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongSuccess.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongSuccess.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.strongSuccess.duration
|
|
|
|
loops: Constants.keycardAnimations.strongSuccess.loops
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
2022-09-30 19:16:15 +00:00
|
|
|
visible: true
|
|
|
|
text: qsTr("PIN Verified")
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
2022-09-30 19:16:15 +00:00
|
|
|
visible: false
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
2022-09-30 19:16:15 +00:00
|
|
|
text: ""
|
|
|
|
visible: false
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
2022-09-30 19:16:15 +00:00
|
|
|
name: Constants.startupState.loginKeycardWrongKeycard
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardWrongKeycard
|
2022-07-21 11:29:18 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.strongError.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongError.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.strongError.duration
|
|
|
|
loops: Constants.keycardAnimations.strongError.loops
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
2022-09-30 19:16:15 +00:00
|
|
|
visible: false
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Wrong Keycard!\nThe card inserted is not linked to your profile.")
|
2022-07-21 11:29:18 +00:00
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight2
|
|
|
|
icon: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Insert proper Keycard")
|
2022-07-21 11:29:18 +00:00
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
2022-09-30 19:16:15 +00:00
|
|
|
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 {
|
2022-09-30 19:16:15 +00:00
|
|
|
name: Constants.startupState.loginKeycardWrongPin
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardWrongPin
|
2022-07-21 11:29:18 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-09-30 19:16:15 +00:00
|
|
|
source: Style.png("keycard/plain-error")
|
|
|
|
pattern: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
2022-09-30 19:16:15 +00:00
|
|
|
visible: true
|
|
|
|
text: qsTr("Enter Keycard PIN")
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("PIN incorrect")
|
2022-07-21 11:29:18 +00:00
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
2022-09-30 19:16:15 +00:00
|
|
|
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
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
2022-09-30 19:16:15 +00:00
|
|
|
text: ""
|
|
|
|
visible: false
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
2022-09-30 19:16:15 +00:00
|
|
|
name: Constants.startupState.loginKeycardMaxPinRetriesReached
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardMaxPinRetriesReached ||
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardMaxPukRetriesReached ||
|
|
|
|
root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardMaxPairingSlotsReached
|
2022-07-21 11:29:18 +00:00
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.strongError.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongError.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.strongError.duration
|
|
|
|
loops: Constants.keycardAnimations.strongError.loops
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: message
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: button
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("Unlock Keycard")
|
2022-07-21 11:29:18 +00:00
|
|
|
visible: true
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: link
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
State {
|
|
|
|
name: Constants.startupState.loginKeycardEmpty
|
|
|
|
when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardEmpty
|
|
|
|
PropertyChanges {
|
|
|
|
target: image
|
2022-09-30 19:16:15 +00:00
|
|
|
source: Style.png("keycard/card-empty")
|
|
|
|
pattern: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: title
|
|
|
|
text: ""
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: passwordSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: pinSection
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
PropertyChanges {
|
|
|
|
target: info
|
2022-09-30 19:16:15 +00:00
|
|
|
text: qsTr("The card inserted is empty (has no profile linked).")
|
2022-07-21 11:29:18 +00:00
|
|
|
visible: true
|
|
|
|
font.pixelSize: Constants.keycard.general.fontSize2
|
|
|
|
color: Theme.palette.dangerColor1
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
2022-07-21 11:29:18 +00:00
|
|
|
}
|
|
|
|
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
|
2022-10-18 08:31:23 +00:00
|
|
|
pattern: Constants.keycardAnimations.strongError.pattern
|
2022-09-30 19:16:15 +00:00
|
|
|
source: ""
|
2022-10-18 08:31:23 +00:00
|
|
|
startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop
|
|
|
|
startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops
|
|
|
|
endImgIndex: Constants.keycardAnimations.strongError.endImgIndex
|
|
|
|
duration: Constants.keycardAnimations.strongError.duration
|
|
|
|
loops: Constants.keycardAnimations.strongError.loops
|
2022-09-13 09:55:19 +00:00
|
|
|
}
|
|
|
|
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
|
2022-09-30 19:16:15 +00:00
|
|
|
height: Constants.keycard.general.loginInfoHeight1
|
|
|
|
icon: ""
|
2022-09-13 09:55:19 +00:00
|
|
|
}
|
|
|
|
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
|
|
|
}
|