2024-03-14 18:28:13 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtQuick.Extras 1.4
|
|
|
|
|
|
|
|
import shared.views 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.Profile.stores 1.0
|
2024-03-14 18:28:13 +00:00
|
|
|
import AppLayouts.Profile.views 1.0
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
StackLayout {
|
|
|
|
id: wrapper
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
ChangePasswordView {
|
|
|
|
id: passwordView
|
|
|
|
|
|
|
|
implicitWidth: parent.width
|
|
|
|
implicitHeight: parent.height
|
|
|
|
|
|
|
|
contentWidth: 560
|
|
|
|
sectionTitle: "Password"
|
|
|
|
|
|
|
|
passwordStrengthScoreFunction: (newPass) => Math.min(newPass.length, 4)
|
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
privacyStore: PrivacyStore {
|
2024-03-14 18:28:13 +00:00
|
|
|
property QtObject privacyModule: QtObject {
|
|
|
|
signal passwordChanged(success: bool, errorMsg: string)
|
|
|
|
signal storeToKeychainError(errorDescription: string)
|
|
|
|
signal storeToKeychainSuccess()
|
|
|
|
}
|
2024-03-14 19:04:15 +00:00
|
|
|
|
|
|
|
function tryStoreToKeyChain(errorDescription) {
|
|
|
|
if (generateMacKeyChainStoreError.checked) {
|
|
|
|
privacyModule.storeToKeychainError(errorDescription)
|
|
|
|
} else {
|
2024-03-15 12:13:35 +00:00
|
|
|
passwordView.localAccountSettings.storeToKeychainValue = Constants.keychain.storedValue.store
|
2024-03-14 19:04:15 +00:00
|
|
|
privacyModule.storeToKeychainSuccess()
|
|
|
|
privacyModule.passwordChanged(true, "")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function tryRemoveFromKeyChain() {
|
|
|
|
if (generateMacKeyChainStoreError.checked) {
|
2024-03-15 12:13:35 +00:00
|
|
|
privacyModule.storeToKeychainError("Error removing from keychain")
|
2024-03-14 19:04:15 +00:00
|
|
|
} else {
|
2024-03-15 12:13:35 +00:00
|
|
|
passwordView.localAccountSettings.storeToKeychainValue = Constants.keychain.storedValue.notNow
|
2024-03-14 19:04:15 +00:00
|
|
|
privacyModule.storeToKeychainSuccess()
|
|
|
|
}
|
|
|
|
}
|
2024-03-14 18:28:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
property QtObject localAccountSettings: QtObject {
|
|
|
|
property string storeToKeychainValue: Constants.keychain.storedValue.notNow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 150
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
|
|
|
RowLayout {
|
2024-03-14 19:04:15 +00:00
|
|
|
Switch {
|
|
|
|
id: generateMacKeyChainStoreError
|
|
|
|
text: "Generate key chain error"
|
|
|
|
checked: false
|
|
|
|
}
|
2024-03-14 18:28:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// category: Views
|
2024-05-02 10:43:37 +00:00
|
|
|
|
|
|
|
// https://www.figma.com/file/d0G7m8X6ELjQlFOEKQpn1g/Profile-WIP?type=design&node-id=11-115317&mode=design&t=mBpxe2bJKzpseHGN-0
|