2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2022-03-07 20:34:59 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
import shared.controls 1.0
|
2022-08-31 08:32:08 +00:00
|
|
|
import shared.stores 1.0
|
2022-03-07 20:34:59 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
import "../stores"
|
|
|
|
import "../controls"
|
|
|
|
import "../popups"
|
|
|
|
import "../panels"
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
SettingsContentBase {
|
2022-03-07 20:34:59 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property MessagingStore messagingStore
|
2022-06-28 18:11:18 +00:00
|
|
|
property ContactsStore contactsStore
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: generalColumn
|
2022-05-26 16:02:41 +00:00
|
|
|
spacing: 2 * Constants.settingsSection.itemSpacing
|
2022-05-07 11:45:15 +00:00
|
|
|
width: root.contentWidth
|
2022-03-07 20:34:59 +00:00
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: showProfilePictureToGroup
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: seeProfilePicturesFromGroup
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: browserGroup
|
|
|
|
}
|
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
StatusListItem {
|
|
|
|
id: allowNewContactRequest
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
implicitHeight: 64
|
|
|
|
|
2022-04-04 11:26:30 +00:00
|
|
|
title: qsTr("Allow new contact requests")
|
2022-05-07 11:45:15 +00:00
|
|
|
|
|
|
|
components: [
|
|
|
|
StatusSwitch {
|
|
|
|
id: switch3
|
|
|
|
checked: !root.messagingStore.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.messagingStore.privacyModule.messagesFromContactsOnly === checked) {
|
|
|
|
root.messagingStore.privacyModule.messagesFromContactsOnly = !checked
|
2022-03-07 20:34:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
]
|
2022-08-24 14:37:05 +00:00
|
|
|
onClicked: {
|
2022-05-07 11:45:15 +00:00
|
|
|
switch3.checked = !switch3.checked
|
2022-03-07 20:34:59 +00:00
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
Separator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
// CONTACTS SECTION
|
|
|
|
StatusContactRequestsIndicatorListItem {
|
2022-10-26 20:00:40 +00:00
|
|
|
objectName: "MessagingView_ContactsListItem_btn"
|
2022-05-07 11:45:15 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Contacts, Requests, and Blocked Users")
|
2022-06-28 18:11:18 +00:00
|
|
|
requestsCount: root.contactsStore.receivedContactRequestsModel.count
|
2022-08-22 14:22:28 +00:00
|
|
|
onClicked: Global.changeAppSectionBySectionType(Constants.appSection.profile,
|
2024-10-15 19:26:12 +00:00
|
|
|
Constants.settingsSubsection.contacts)
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2022-05-07 11:45:15 +00:00
|
|
|
Separator {
|
|
|
|
id: separator2
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2022-03-07 20:34:59 +00:00
|
|
|
|
2023-10-16 16:05:55 +00:00
|
|
|
// GIF LINK PREVIEWS
|
|
|
|
StatusSectionHeadline {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-10-16 16:05:55 +00:00
|
|
|
text: qsTr("GIF link previews")
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
title: qsTr("Allow show GIF previews")
|
2023-12-13 13:34:46 +00:00
|
|
|
objectName: "MessagingView_AllowShowGifs_StatusListItem"
|
2023-10-16 16:05:55 +00:00
|
|
|
components: [
|
|
|
|
StatusSwitch {
|
|
|
|
id: showGifPreviewsSwitch
|
|
|
|
checked: localAccountSensitiveSettings.gifUnfurlingEnabled
|
|
|
|
onClicked: {
|
|
|
|
localAccountSensitiveSettings.gifUnfurlingEnabled = !localAccountSensitiveSettings.gifUnfurlingEnabled
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
onClicked: {
|
|
|
|
showGifPreviewsSwitch.clicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
// URL UNFRULING
|
|
|
|
StatusSectionHeadline {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-10-16 16:05:55 +00:00
|
|
|
text: qsTr("Website link previews")
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: urlUnfurlingGroup
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsRadioButton {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-10-16 16:05:55 +00:00
|
|
|
label: qsTr("Always ask")
|
2023-12-13 13:34:46 +00:00
|
|
|
objectName: "MessagingView_AlwaysAsk_RadioButton"
|
2023-10-16 16:05:55 +00:00
|
|
|
group: urlUnfurlingGroup
|
|
|
|
checked: root.messagingStore.privacyModule.urlUnfurlingMode === Constants.UrlUnfurlingModeAlwaysAsk
|
|
|
|
onClicked: {
|
|
|
|
root.messagingStore.privacyModule.urlUnfurlingMode = Constants.UrlUnfurlingModeAlwaysAsk
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsRadioButton {
|
|
|
|
Layout.topMargin: Constants.settingsSection.itemSpacing / 2
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-10-16 16:05:55 +00:00
|
|
|
label: qsTr("Always show previews")
|
2023-12-13 13:34:46 +00:00
|
|
|
objectName: "MessagingView_AlwaysShow_RadioButton"
|
2023-10-16 16:05:55 +00:00
|
|
|
group: urlUnfurlingGroup
|
|
|
|
checked: root.messagingStore.privacyModule.urlUnfurlingMode === Constants.UrlUnfurlingModeEnableAll
|
|
|
|
onClicked: {
|
|
|
|
root.messagingStore.privacyModule.urlUnfurlingMode = Constants.UrlUnfurlingModeEnableAll
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsRadioButton {
|
|
|
|
Layout.topMargin: Constants.settingsSection.itemSpacing / 2
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
|
|
|
Layout.rightMargin: Theme.padding
|
2023-10-16 16:05:55 +00:00
|
|
|
label: qsTr("Never show previews")
|
2023-12-13 13:34:46 +00:00
|
|
|
objectName: "MessagingView_NeverShow_RadioButton"
|
2023-10-16 16:05:55 +00:00
|
|
|
group: urlUnfurlingGroup
|
|
|
|
checked: root.messagingStore.privacyModule.urlUnfurlingMode === Constants.UrlUnfurlingModeDisableAll
|
|
|
|
onClicked: {
|
|
|
|
root.messagingStore.privacyModule.urlUnfurlingMode = Constants.UrlUnfurlingModeDisableAll
|
|
|
|
}
|
|
|
|
}
|
2022-05-07 11:45:15 +00:00
|
|
|
}
|
|
|
|
}
|