2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-07-21 21:03:22 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-05-27 21:28:25 +00:00
|
|
|
import "../../../../imports"
|
2020-06-19 18:06:58 +00:00
|
|
|
import "../../../../shared"
|
2020-09-17 16:42:59 +00:00
|
|
|
import "../../../../shared/status"
|
2020-10-04 23:03:37 +00:00
|
|
|
import "Privileges/"
|
2020-05-27 21:28:25 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: privacyContainer
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2020-10-23 17:57:28 +00:00
|
|
|
ListModel {
|
|
|
|
id: previewableSites
|
|
|
|
}
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
const sites = profileModel.getLinkPreviewWhitelist()
|
|
|
|
try {
|
|
|
|
const sitesJSON = JSON.parse(sites)
|
2020-10-23 20:38:36 +00:00
|
|
|
let settingUpdadted = false
|
2020-10-23 17:57:28 +00:00
|
|
|
sitesJSON.forEach(function (site) {
|
2020-10-23 20:38:36 +00:00
|
|
|
if (appSettings.whitelistedUnfurlingSites[site.address] === undefined) {
|
|
|
|
appSettings.whitelistedUnfurlingSites[site.address] = false
|
|
|
|
settingUpdadted = true
|
|
|
|
}
|
|
|
|
|
2020-10-23 17:57:28 +00:00
|
|
|
previewableSites.append(site)
|
|
|
|
})
|
2020-10-23 20:38:36 +00:00
|
|
|
if (settingUpdadted) {
|
|
|
|
applicationWindow.whitelistChanged()
|
|
|
|
}
|
2020-10-23 17:57:28 +00:00
|
|
|
} catch (e) {
|
2020-10-23 20:38:36 +00:00
|
|
|
console.error('Could not parse the whitelist for sites', e)
|
2020-10-23 17:57:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-04 23:03:37 +00:00
|
|
|
property Component dappListPopup: DappList {
|
|
|
|
onClosed: destroy()
|
|
|
|
}
|
|
|
|
|
2020-10-23 17:57:28 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: containerColumn
|
|
|
|
spacing: Style.current.padding
|
2020-05-27 21:28:25 +00:00
|
|
|
anchors.top: parent.top
|
2020-10-23 17:57:28 +00:00
|
|
|
anchors.topMargin: Style.current.padding
|
2020-07-21 21:03:22 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: contentMargin
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: contentMargin
|
|
|
|
anchors.bottom: parent.bottom
|
2020-06-22 11:43:34 +00:00
|
|
|
|
2020-09-18 08:29:31 +00:00
|
|
|
StatusSectionHeadline {
|
2020-07-21 21:03:22 +00:00
|
|
|
id: labelSecurity
|
|
|
|
//% "Security"
|
|
|
|
text: qsTrId("security")
|
|
|
|
}
|
2020-06-22 11:43:34 +00:00
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
Item {
|
|
|
|
id: backupSeedPhrase
|
|
|
|
height: backupText.height
|
|
|
|
width: parent.width
|
2020-06-22 11:43:34 +00:00
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
StyledText {
|
|
|
|
id: backupText
|
|
|
|
//% "Backup Seed Phrase"
|
|
|
|
text: qsTrId("backup-seed-phrase")
|
|
|
|
font.pixelSize: 15
|
2020-10-26 20:20:31 +00:00
|
|
|
color: !badge.visible ? Style.current.darkGrey : Style.current.textColor
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
2020-10-26 20:20:31 +00:00
|
|
|
Rectangle {
|
|
|
|
id: badge
|
|
|
|
visible: !profileModel.isMnemonicBackedUp
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2020-07-21 21:03:22 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
2020-10-26 20:20:31 +00:00
|
|
|
radius: 9
|
|
|
|
color: Style.current.blue
|
|
|
|
width: 18
|
|
|
|
height: 18
|
|
|
|
Text {
|
|
|
|
font.pixelSize: 12
|
|
|
|
color: Style.current.white
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: "1"
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
2020-10-26 20:20:31 +00:00
|
|
|
enabled: !profileModel.isMnemonicBackedUp
|
2020-07-21 21:03:22 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: backupSeedModal.open()
|
2020-10-26 20:20:31 +00:00
|
|
|
cursorShape: enabled && Qt.PointingHandCursor
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BackupSeedModal {
|
|
|
|
id: backupSeedModal
|
|
|
|
}
|
|
|
|
|
2020-10-23 17:57:28 +00:00
|
|
|
Separator {
|
|
|
|
id: separator
|
|
|
|
Layout.topMargin: Style.current.bigPadding - containerColumn.spacing
|
|
|
|
}
|
2020-10-04 23:03:37 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: dappPermissions
|
|
|
|
height: dappPermissionsText.height
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: dappPermissionsText
|
|
|
|
text: qsTr("Set DApp access permissions")
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: caret2
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
anchors.verticalCenter: dappPermissionsText.verticalCenter
|
|
|
|
source: "../../../img/caret.svg"
|
|
|
|
width: 13
|
|
|
|
height: 7
|
|
|
|
rotation: -90
|
|
|
|
}
|
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: caret2
|
2020-10-26 20:20:31 +00:00
|
|
|
source: caret2
|
2020-10-04 23:03:37 +00:00
|
|
|
color: Style.current.darkGrey
|
|
|
|
rotation: -90
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: dappListPopup.createObject(privacyContainer).open()
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
2020-10-23 17:57:28 +00:00
|
|
|
id: separator2
|
|
|
|
Layout.topMargin: Style.current.bigPadding - containerColumn.spacing
|
2020-10-04 23:03:37 +00:00
|
|
|
}
|
|
|
|
|
2020-09-18 08:29:31 +00:00
|
|
|
StatusSectionHeadline {
|
2020-07-21 21:03:22 +00:00
|
|
|
id: labelPrivacy
|
2020-08-26 15:52:26 +00:00
|
|
|
//% "Privacy"
|
|
|
|
text: qsTrId("privacy")
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: displayImageSettings
|
|
|
|
StyledText {
|
|
|
|
//% "Display images in chat automatically"
|
|
|
|
text: qsTrId("display-images-in-chat-automatically")
|
|
|
|
}
|
2020-09-17 16:42:59 +00:00
|
|
|
StatusSwitch {
|
2020-07-21 21:03:22 +00:00
|
|
|
checked: appSettings.displayChatImages
|
|
|
|
onCheckedChanged: function (value) {
|
2020-09-15 19:47:13 +00:00
|
|
|
appSettings.displayChatImages = this.checked
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
//% "under development"
|
|
|
|
text: qsTrId("under-development")
|
|
|
|
}
|
|
|
|
}
|
2020-10-23 17:57:28 +00:00
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: labelURLUnfurling
|
2020-11-03 19:02:35 +00:00
|
|
|
text: qsTr("Chat link previews")
|
|
|
|
font.pixelSize: 17
|
|
|
|
font.weight: Font.Bold
|
|
|
|
color: Style.current.textColor
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: labelWebsites
|
|
|
|
text: qsTr("Websites")
|
2020-10-23 17:57:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: sitesListView
|
|
|
|
width: parent.width
|
|
|
|
model: previewableSites
|
|
|
|
interactive: false
|
|
|
|
height: childrenRect.height
|
2020-11-03 19:02:35 +00:00
|
|
|
spacing: Style.current.padding
|
2020-10-23 17:57:28 +00:00
|
|
|
|
|
|
|
delegate: Component {
|
2020-11-03 19:02:35 +00:00
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: siteTitle
|
|
|
|
text: title
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
}
|
|
|
|
|
2020-10-23 17:57:28 +00:00
|
|
|
StyledText {
|
2020-11-03 19:02:35 +00:00
|
|
|
text: address
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Thin
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
anchors.top: siteTitle.bottom
|
2020-10-23 17:57:28 +00:00
|
|
|
}
|
2020-11-03 19:02:35 +00:00
|
|
|
|
2020-10-23 17:57:28 +00:00
|
|
|
StatusSwitch {
|
|
|
|
checked: !!appSettings.whitelistedUnfurlingSites[address]
|
|
|
|
onCheckedChanged: function () {
|
2020-10-23 20:38:36 +00:00
|
|
|
changeUnfurlingWhitelist(address, this.checked)
|
2020-10-23 17:57:28 +00:00
|
|
|
}
|
2020-11-03 19:02:35 +00:00
|
|
|
anchors.verticalCenter: siteTitle.bottom
|
|
|
|
anchors.right: parent.right
|
2020-10-23 17:57:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-11-03 19:02:35 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
text: qsTr("Previewing links from these websites may share your metadata with their owners.")
|
|
|
|
width: parent.width
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.weight: Font.Thin
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
2020-06-22 11:43:34 +00:00
|
|
|
}
|
2020-05-27 21:28:25 +00:00
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|