2021-09-13 11:51:47 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 09:37:58 +00:00
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.controls 1.0
|
2021-09-13 11:51:47 +00:00
|
|
|
|
2021-10-14 11:33:34 +00:00
|
|
|
// TODO: replace with StatusModal
|
2021-09-13 11:51:47 +00:00
|
|
|
ModalPopup {
|
|
|
|
id: popup
|
|
|
|
|
|
|
|
title: qsTr("Store pass to Keychain")
|
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
|
|
|
|
2021-10-17 10:44:21 +00:00
|
|
|
function updateListState() {
|
|
|
|
if (localAccountSettings.storeToKeychainValue === Constants.storeToKeychainValueStore)
|
|
|
|
storeBtn.checked = true
|
|
|
|
else if (localAccountSettings.storeToKeychainValue === Constants.storeToKeychainValueNotNow ||
|
|
|
|
localAccountSettings.storeToKeychainValue === "")
|
|
|
|
notNowBtn.checked = true
|
|
|
|
else if (localAccountSettings.storeToKeychainValue === Constants.storeToKeychainValueNever)
|
|
|
|
neverBtn.checked = true
|
|
|
|
}
|
|
|
|
|
2021-09-13 11:51:47 +00:00
|
|
|
Column {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
|
|
|
|
spacing: 0
|
|
|
|
|
2021-10-17 10:44:21 +00:00
|
|
|
Connections {
|
|
|
|
target: localAccountSettings
|
|
|
|
onStoreToKeychainValueChanged: {
|
|
|
|
updateListState()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-13 11:51:47 +00:00
|
|
|
ButtonGroup {
|
|
|
|
id: openLinksWithGroup
|
|
|
|
}
|
|
|
|
|
2021-10-27 09:37:58 +00:00
|
|
|
RadioButtonSelector {
|
2021-10-17 10:44:21 +00:00
|
|
|
id: storeBtn
|
2021-10-27 09:37:58 +00:00
|
|
|
title: qsTr("Store")
|
2021-09-13 11:51:47 +00:00
|
|
|
buttonGroup: openLinksWithGroup
|
2021-10-17 10:44:21 +00:00
|
|
|
checked: localAccountSettings.storeToKeychainValue === Constants.storeToKeychainValueStore
|
2021-10-27 09:37:58 +00:00
|
|
|
onCheckedChanged: {
|
2021-10-17 10:44:21 +00:00
|
|
|
if (checked && localAccountSettings.storeToKeychainValue !== Constants.storeToKeychainValueStore) {
|
2021-09-13 11:51:47 +00:00
|
|
|
var storePassPopup = openPopup(storePasswordModal)
|
|
|
|
if(storePassPopup)
|
|
|
|
{
|
|
|
|
storePassPopup.closed.connect(function(){
|
2021-10-17 10:44:21 +00:00
|
|
|
updateListState()
|
2021-09-13 11:51:47 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-27 09:37:58 +00:00
|
|
|
RadioButtonSelector {
|
2021-09-13 11:51:47 +00:00
|
|
|
id: notNowBtn
|
2021-10-27 09:37:58 +00:00
|
|
|
title: qsTr("Not now")
|
2021-09-13 11:51:47 +00:00
|
|
|
buttonGroup: openLinksWithGroup
|
2021-10-17 10:44:21 +00:00
|
|
|
checked: localAccountSettings.storeToKeychainValue === Constants.storeToKeychainValueNotNow ||
|
|
|
|
localAccountSettings.storeToKeychainValue === ""
|
2021-10-27 09:37:58 +00:00
|
|
|
onCheckedChanged: {
|
2021-09-13 11:51:47 +00:00
|
|
|
if (checked) {
|
2021-10-17 10:44:21 +00:00
|
|
|
localAccountSettings.storeToKeychainValue = Constants.storeToKeychainValueNotNow
|
2021-09-13 11:51:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-27 09:37:58 +00:00
|
|
|
RadioButtonSelector {
|
2021-09-13 11:51:47 +00:00
|
|
|
id: neverBtn
|
2021-10-27 09:37:58 +00:00
|
|
|
title: qsTr("Never")
|
2021-09-13 11:51:47 +00:00
|
|
|
buttonGroup: openLinksWithGroup
|
2021-10-17 10:44:21 +00:00
|
|
|
checked: localAccountSettings.storeToKeychainValue === Constants.storeToKeychainValueNever
|
2021-10-27 09:37:58 +00:00
|
|
|
onCheckedChanged: {
|
2021-09-13 11:51:47 +00:00
|
|
|
if (checked) {
|
2021-10-17 10:44:21 +00:00
|
|
|
localAccountSettings.storeToKeychainValue = Constants.storeToKeychainValueNever
|
2021-09-13 11:51:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|