2021-10-06 09:16:39 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import QtGraphicalEffects 1.13
|
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
2021-10-26 09:30:05 +00:00
|
|
|
import StatusQ.Controls 0.1 as StatusQControls
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
import "../popups"
|
2021-12-30 12:39:47 +00:00
|
|
|
import "../stores"
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
clip: true
|
|
|
|
|
2021-12-30 12:39:47 +00:00
|
|
|
property PrivacyStore privacyStore
|
|
|
|
|
2021-12-09 13:28:02 +00:00
|
|
|
property int profileContentWidth
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: containerColumn
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 64
|
2021-12-09 13:28:02 +00:00
|
|
|
width: profileContentWidth
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: labelSecurity
|
|
|
|
//% "Security"
|
|
|
|
text: qsTrId("security")
|
|
|
|
bottomPadding: Style.current.halfPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
id: backupSeedPhrase
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
//% "Backup Seed Phrase"
|
|
|
|
title: qsTrId("backup-seed-phrase")
|
2021-12-30 12:39:47 +00:00
|
|
|
enabled: !root.privacyStore.mnemonicBackedUp
|
2021-10-06 09:16:39 +00:00
|
|
|
implicitHeight: 52
|
|
|
|
components: [
|
|
|
|
StatusBadge {
|
2021-12-30 12:39:47 +00:00
|
|
|
value: !root.privacyStore.mnemonicBackedUp
|
|
|
|
visible: !root.privacyStore.mnemonicBackedUp
|
2021-10-06 09:16:39 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
},
|
|
|
|
StatusIcon {
|
|
|
|
icon: "chevron-down"
|
|
|
|
rotation: 270
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
2021-12-30 12:39:47 +00:00
|
|
|
sensor.onClicked: Global.openBackUpSeedPopup()
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
title: qsTr("Change password")
|
|
|
|
implicitHeight: 52
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "chevron-down"
|
|
|
|
rotation: 270
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
sensor.onClicked: changePasswordModal.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
title: qsTr("Store pass to Keychain")
|
|
|
|
implicitHeight: 52
|
|
|
|
visible: Qt.platform.os == "osx" // For now, this is available only on MacOS
|
|
|
|
label: {
|
2021-10-17 10:44:21 +00:00
|
|
|
let value = localAccountSettings.storeToKeychainValue
|
2021-10-06 09:16:39 +00:00
|
|
|
if(value == Constants.storeToKeychainValueStore)
|
|
|
|
return qsTr("Store")
|
|
|
|
|
|
|
|
if(value == Constants.storeToKeychainValueNever)
|
|
|
|
return qsTr("Never")
|
|
|
|
|
|
|
|
return qsTr("Not now")
|
|
|
|
}
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "chevron-down"
|
|
|
|
rotation: 270
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
2021-12-07 20:33:12 +00:00
|
|
|
sensor.onClicked: Global.openPopup(storeToKeychainSelectionModal)
|
2021-10-06 09:16:39 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: storeToKeychainSelectionModal
|
|
|
|
StoreToKeychainSelectionModal {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ChangePasswordModal {
|
|
|
|
id: changePasswordModal
|
2021-12-30 12:39:47 +00:00
|
|
|
privacyStore: root.privacyStore
|
2021-10-06 09:16:39 +00:00
|
|
|
anchors.centerIn: parent
|
2021-12-09 13:28:02 +00:00
|
|
|
successPopup: successPopup
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ChangePasswordSuccessModal {
|
|
|
|
id: successPopup
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: spacer1
|
|
|
|
height: Style.current.bigPadding
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: labelPrivacy
|
|
|
|
//% "Privacy"
|
|
|
|
text: qsTrId("privacy")
|
|
|
|
topPadding: Style.current.padding
|
|
|
|
bottomPadding: Style.current.halfPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
//% "Display all profile pictures (not only contacts)"
|
|
|
|
title: qsTrId("display-all-profile-pictures--not-only-contacts-")
|
|
|
|
implicitHeight: 52
|
|
|
|
components: [
|
2021-10-26 09:30:05 +00:00
|
|
|
StatusQControls.StatusSwitch {
|
2021-10-06 09:16:39 +00:00
|
|
|
id: switch1
|
2021-10-20 09:50:50 +00:00
|
|
|
checked: !localAccountSensitiveSettings.onlyShowContactsProfilePics
|
2022-02-04 20:49:16 +00:00
|
|
|
onCheckedChanged: {
|
|
|
|
if (localAccountSensitiveSettings.onlyShowContactsProfilePics === checked) {
|
|
|
|
localAccountSensitiveSettings.onlyShowContactsProfilePics = !checked
|
|
|
|
}
|
2022-01-27 16:01:13 +00:00
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
]
|
2022-02-04 20:49:16 +00:00
|
|
|
sensor.onClicked: {
|
|
|
|
switch1.checked = !switch1.checked
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
//% "Display images in chat automatically"
|
|
|
|
title: qsTrId("display-images-in-chat-automatically")
|
|
|
|
implicitHeight: 52
|
|
|
|
components: [
|
2021-10-26 09:30:05 +00:00
|
|
|
StatusQControls.StatusSwitch {
|
2021-12-09 13:28:02 +00:00
|
|
|
id: switch2
|
2021-10-20 09:50:50 +00:00
|
|
|
checked: localAccountSensitiveSettings.displayChatImages
|
2022-02-04 20:49:16 +00:00
|
|
|
onCheckedChanged: {
|
|
|
|
if (localAccountSensitiveSettings.displayChatImages !== checked) {
|
|
|
|
localAccountSensitiveSettings.displayChatImages = checked
|
|
|
|
}
|
2022-01-27 16:01:13 +00:00
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
]
|
2022-02-04 20:49:16 +00:00
|
|
|
sensor.onClicked: {
|
|
|
|
switch2.checked = !switch2.checked
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
width: parent.width
|
|
|
|
//% "All images (links that contain an image extension) will be downloaded and displayed, regardless of the whitelist settings below"
|
|
|
|
text: qsTrId("all-images--links-that-contain-an-image-extension--will-be-downloaded-and-displayed--regardless-of-the-whitelist-settings-below")
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Thin
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
bottomPadding: Style.current.smallPadding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
//% "Chat link previews"
|
|
|
|
title: qsTrId("chat-link-previews")
|
|
|
|
implicitHeight: 52
|
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "chevron-down"
|
|
|
|
rotation: 270
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
2021-12-07 20:33:12 +00:00
|
|
|
sensor.onClicked: Global.openPopup(chatLinksPreviewModal)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: chatLinksPreviewModal
|
2021-12-30 12:39:47 +00:00
|
|
|
ChatLinksPreviewModal {
|
|
|
|
privacyStore: root.privacyStore
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: openLinksWithModal
|
|
|
|
OpenLinksWithModal {}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
//% "Open links with..."
|
|
|
|
title: qsTrId("open-links-with---")
|
|
|
|
implicitHeight: 52
|
|
|
|
//% "My default browser"
|
2021-10-20 09:50:50 +00:00
|
|
|
label: localAccountSensitiveSettings.openLinksInStatus ? "Status" : qsTrId("my-default-browser")
|
2021-10-06 09:16:39 +00:00
|
|
|
components: [
|
|
|
|
StatusIcon {
|
|
|
|
icon: "chevron-down"
|
|
|
|
rotation: 270
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
]
|
2021-12-07 20:33:12 +00:00
|
|
|
sensor.onClicked: Global.openPopup(openLinksWithModal)
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
//% "Allow new contact requests"
|
|
|
|
title: qsTrId("allow-new-contact-requests")
|
|
|
|
implicitHeight: 52
|
|
|
|
components: [
|
2021-10-26 09:30:05 +00:00
|
|
|
StatusQControls.StatusSwitch {
|
2021-10-06 09:16:39 +00:00
|
|
|
id: switch3
|
2022-02-04 20:49:16 +00:00
|
|
|
checked: !root.privacyStore.privacyModule.messagesFromContactsOnly
|
|
|
|
onCheckedChanged: {
|
|
|
|
// messagesFromContactsOnly needs to be accessed from the module (view),
|
|
|
|
// because otherwise doing `messagesFromContactsOnly = value` only changes the bool property on QML
|
|
|
|
if (root.privacyStore.privacyModule.messagesFromContactsOnly === checked) {
|
|
|
|
root.privacyStore.privacyModule.messagesFromContactsOnly = !checked
|
|
|
|
}
|
|
|
|
}
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
sensor.onClicked: {
|
2022-02-04 20:49:16 +00:00
|
|
|
switch3.checked = !switch3.checked
|
2021-10-06 09:16:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|