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-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
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2021-01-15 19:21:19 +00:00
|
|
|
StatusSettingsLineButton {
|
2021-01-15 20:02:24 +00:00
|
|
|
id: backupSeedPhrase
|
2021-01-15 20:01:11 +00:00
|
|
|
//% "Backup Seed Phrase"
|
2021-01-15 19:21:19 +00:00
|
|
|
text: qsTrId("backup-seed-phrase")
|
|
|
|
isBadge: !profileModel.mnemonic.isBackedUp
|
|
|
|
isEnabled: !profileModel.mnemonic.isBackedUp
|
|
|
|
onClicked: {
|
|
|
|
backupSeedModal.open()
|
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
|
|
|
|
|
|
|
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
|
|
|
}
|
2021-01-15 15:37:23 +00:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
spacing: Style.current.padding
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
text: qsTr("Display all profile pictures (not only contacts)")
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSwitch {
|
|
|
|
id: showOnlyContactsPicsSwitch
|
|
|
|
Layout.rightMargin: 0
|
|
|
|
checked: !appSettings.onlyShowContactsProfilePics
|
|
|
|
onCheckedChanged: function (value) {
|
|
|
|
appSettings.onlyShowContactsProfilePics = !this.checked
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-21 21:03:22 +00:00
|
|
|
RowLayout {
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
spacing: Style.current.padding
|
|
|
|
width: parent.width
|
|
|
|
Column {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
StyledText {
|
|
|
|
//% "Display images in chat automatically"
|
|
|
|
text: qsTrId("display-images-in-chat-automatically")
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
width: parent.width
|
|
|
|
text: qsTr("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: Style.current.secondaryText
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
2020-07-21 21:03:22 +00:00
|
|
|
}
|
2020-09-17 16:42:59 +00:00
|
|
|
StatusSwitch {
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
id: displayChatImagesSwitch
|
|
|
|
Layout.rightMargin: 0
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-23 17:57:28 +00:00
|
|
|
|
2020-12-29 20:34:53 +00:00
|
|
|
Component {
|
|
|
|
id: openLinksWithModal
|
|
|
|
OpenLinksWithModal {}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSettingsLineButton {
|
|
|
|
text: qsTr("Open links with...")
|
|
|
|
currentValue: appSettings.openLinksInStatus ? "Status" : qsTr("My default browser")
|
|
|
|
onClicked: openPopup(openLinksWithModal)
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
Connections {
|
|
|
|
target: applicationWindow
|
|
|
|
onSettingsLoaded: {
|
|
|
|
let whitelist = JSON.parse(profileModel.getLinkPreviewWhitelist())
|
|
|
|
whitelist.forEach(entry => {
|
|
|
|
entry.isWhitelisted = appSettings.whitelistedUnfurlingSites[entry.address] || false
|
|
|
|
previewableSites.append(entry)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 {
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
checked: !!isWhitelisted
|
2020-10-23 17:57:28 +00:00
|
|
|
onCheckedChanged: function () {
|
feat: whitelist gifs (no url extension needed)
Fixes #1377.
Fixes #1479.
Two sites have been added to the whitelist: giphy.com and tenor.com.
`imageUrls` in its entirety has been removed and instead all links are being handle through the message `linkUrls`. This prevents double-handling of urls that may or may not be images.
The logic to automatically show links previews works like this:
1. If the setting "display chat images" is enabled, all links that *contain* ".png", ".jpg", ".jpeg", ".svg", ".gif" will be automatically shown. If the URL doesn't contain the extension, we are not downloading it. This was meant to be somewhat of a security compromise as we do not want to download each and every link posted in a message just to find out its true content type.
2. If the above setting is *disabled*, then we follow the whitelist settings for tenor and giphy. This allows us to preview gifs that do not have a file extension in their url.
feat: bump status-go to the commit that supports the new whitelist (https://github.com/status-im/status-go/pull/2094), and also lets us get link preview data from urls in the whitelist. NOTE: this commit was branched off status-go `develop`, so once it is merged, and we update this PR to the new commit, we will effectively be getting status-go develop changes. We *could* base that status-go PR off of master if it makes things easier.
fix: height on settings update issue
feat: move date/time of message below links
fix: layout issues when changing setting `neverAskAboutUnfurlingAgain`
feat: Add MessageBorder component to aid in showing rounded corners with different radius
2020-12-11 00:53:44 +00:00
|
|
|
const settings = appSettings.whitelistedUnfurlingSites
|
|
|
|
settings[address] = this.checked
|
|
|
|
appSettings.whitelistedUnfurlingSites = settings
|
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}
|
|
|
|
}
|
|
|
|
##^##*/
|