2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2020-11-17 19:02:56 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick.Layouts 1.13
|
2020-11-17 19:02:56 +00:00
|
|
|
import "./"
|
2020-05-27 21:28:25 +00:00
|
|
|
import "../../../../imports"
|
2020-06-19 18:06:58 +00:00
|
|
|
import "../../../../shared"
|
2020-09-18 08:29:31 +00:00
|
|
|
import "../../../../shared/status"
|
2020-05-27 21:28:25 +00:00
|
|
|
|
2020-09-18 12:24:16 +00:00
|
|
|
ScrollView {
|
|
|
|
height: parent.height
|
|
|
|
width: parent.width
|
|
|
|
contentHeight: notificationsContainer.height
|
|
|
|
clip: true
|
|
|
|
|
2020-11-17 19:02:56 +00:00
|
|
|
Rectangle {
|
2020-09-18 12:24:16 +00:00
|
|
|
id: notificationsContainer
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: contentMargin
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: contentMargin
|
|
|
|
height: this.childrenRect.height + 100
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: notificationSetting
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: soundSetting
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: messageSetting
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: sectionHeadlineNotifications
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Notification preferences"
|
|
|
|
text: qsTrId("notifications-preferences")
|
2020-09-18 12:24:16 +00:00
|
|
|
anchors.top: parent.top
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column
|
|
|
|
spacing: Style.current.padding
|
|
|
|
anchors.top: sectionHeadlineNotifications.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "All messages"
|
|
|
|
text: qsTrId("all-messages")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusRadioButton {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
ButtonGroup.group: notificationSetting
|
|
|
|
rightPadding: 0
|
2020-10-15 11:53:27 +00:00
|
|
|
checked: appSettings.notificationSetting === 0
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationSetting = 0
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Just @mentions"
|
|
|
|
text: qsTrId("just--mentions")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
StatusRadioButton {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
ButtonGroup.group: notificationSetting
|
|
|
|
rightPadding: 0
|
2020-10-15 11:53:27 +00:00
|
|
|
checked: appSettings.notificationSetting === 1
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationSetting = 1
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Nothing"
|
|
|
|
text: qsTrId("nothing")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
StatusRadioButton {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
ButtonGroup.group: notificationSetting
|
|
|
|
rightPadding: 0
|
2020-10-15 11:53:27 +00:00
|
|
|
checked: appSettings.notificationSetting === 2
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationSetting = 2
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator
|
|
|
|
anchors.top: column.bottom
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: sectionHeadlineSound
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Sound & Appearance"
|
|
|
|
text: qsTrId("sound---appearance")
|
2020-09-18 12:24:16 +00:00
|
|
|
anchors.top: separator.bottom
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column2
|
|
|
|
spacing: Style.current.padding
|
|
|
|
anchors.top: sectionHeadlineSound.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Play a sound when receiving a notification"
|
|
|
|
text: qsTrId("play-a-sound-when-receiving-a-notification")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSwitch {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
2020-10-15 15:04:53 +00:00
|
|
|
checked: appSettings.notificationSoundsEnabled
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationSoundsEnabled = this.checked
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-15 15:14:15 +00:00
|
|
|
/* GridLayout { */
|
|
|
|
/* columns: 4 */
|
|
|
|
/* width: parent.width */
|
|
|
|
|
|
|
|
/* StatusRadioButton { */
|
|
|
|
/* checked: true */
|
|
|
|
/* //% "Sound 1" */
|
|
|
|
/* text: qsTrId("sound-1") */
|
|
|
|
/* ButtonGroup.group: soundSetting */
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
/* StatusRadioButton { */
|
|
|
|
/* //% "Sound 2" */
|
|
|
|
/* text: qsTrId("sound-2") */
|
|
|
|
/* ButtonGroup.group: soundSetting */
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
/* StatusRadioButton { */
|
|
|
|
/* //% "Sound 3" */
|
|
|
|
/* text: qsTrId("sound-3") */
|
|
|
|
/* ButtonGroup.group: soundSetting */
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
/* StatusRadioButton { */
|
|
|
|
/* //% "Sound 4" */
|
|
|
|
/* text: qsTrId("sound-4") */
|
|
|
|
/* ButtonGroup.group: soundSetting */
|
|
|
|
/* } */
|
|
|
|
/* } */
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column3
|
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
anchors.top: column2.bottom
|
|
|
|
anchors.topMargin: Style.current.padding*2
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Message preview"
|
|
|
|
text: qsTrId("message-preview")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
2020-11-17 19:02:56 +00:00
|
|
|
Column {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: notificationAnonymous.width + Style.current.padding * 2
|
|
|
|
height: childrenRect.height + Style.current.padding + Style.current.halfPadding
|
|
|
|
color: labelAnonymous.checked ? Style.current.secondaryBackground : Style.current.transparent
|
|
|
|
radius: Style.current.radius
|
|
|
|
|
|
|
|
StatusRadioButton {
|
|
|
|
id: labelAnonymous
|
|
|
|
//% "Anonymous"
|
|
|
|
text: qsTrId("anonymous")
|
|
|
|
ButtonGroup.group: messageSetting
|
|
|
|
checked: appSettings.notificationMessagePreviewSetting === Constants.notificationPreviewAnonymous
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationMessagePreviewSetting = Constants.notificationPreviewAnonymous
|
|
|
|
}
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
|
2020-11-17 19:02:56 +00:00
|
|
|
StatusNotificationWithDropShadow {
|
|
|
|
id: notificationAnonymous
|
|
|
|
anchors.top: labelAnonymous.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
name: "Status"
|
|
|
|
chatType: Constants.chatTypePublic
|
|
|
|
message: qsTr("You have a new message")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
width: notificationAnonymous.width + Style.current.padding * 2
|
|
|
|
height: childrenRect.height + Style.current.padding + Style.current.halfPadding
|
|
|
|
color: labelNameOnly.checked ? Style.current.secondaryBackground : Style.current.transparent
|
|
|
|
radius: Style.current.radius
|
|
|
|
|
|
|
|
StatusRadioButton {
|
|
|
|
id: labelNameOnly
|
|
|
|
//% "Name only"
|
|
|
|
text: qsTrId("name-only")
|
|
|
|
ButtonGroup.group: messageSetting
|
|
|
|
checked: appSettings.notificationMessagePreviewSetting === Constants.notificationPreviewNameOnly
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationMessagePreviewSetting = Constants.notificationPreviewNameOnly
|
|
|
|
}
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusNotificationWithDropShadow {
|
|
|
|
id: notificationNameOnly
|
|
|
|
name: "Vitalik Buterin"
|
|
|
|
chatType: Constants.chatTypeOneToOne
|
|
|
|
message: qsTr("You have a new message")
|
|
|
|
anchors.top: labelNameOnly.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
}
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
|
2020-11-17 19:02:56 +00:00
|
|
|
Rectangle {
|
|
|
|
width: notificationAnonymous.width + Style.current.padding * 2
|
|
|
|
height: childrenRect.height + Style.current.padding + Style.current.halfPadding
|
|
|
|
color: labelNameAndMessage.checked ? Style.current.secondaryBackground : Style.current.transparent
|
|
|
|
radius: Style.current.radius
|
|
|
|
|
|
|
|
StatusRadioButton {
|
|
|
|
id: labelNameAndMessage
|
|
|
|
//% "Name & Message"
|
|
|
|
text: qsTrId("name---message")
|
|
|
|
ButtonGroup.group: messageSetting
|
|
|
|
checked: appSettings.notificationMessagePreviewSetting === Constants.notificationPreviewNameAndMessage
|
|
|
|
onCheckedChanged: {
|
|
|
|
appSettings.notificationMessagePreviewSetting = Constants.notificationPreviewNameAndMessage
|
|
|
|
}
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusNotificationWithDropShadow {
|
|
|
|
id: notificationNameAndMessage
|
|
|
|
name: "Vitalik Buterin"
|
|
|
|
chatType: Constants.chatTypeOneToOne
|
|
|
|
message: qsTr("Hi there! Yes, no problem, let me know if I can help.")
|
|
|
|
anchors.top: labelNameAndMessage.bottom
|
|
|
|
anchors.topMargin: Style.current.halfPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
}
|
|
|
|
}
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "No preview or Advanced? Go to Notification Center"
|
|
|
|
text: qsTrId("no-preview-or-advanced--go-to-notification-center")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator2
|
|
|
|
anchors.top: column3.bottom
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionHeadline {
|
|
|
|
id: sectionHeadlineContacts
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Contacts & Users"
|
|
|
|
text: qsTrId("contacts---users")
|
2020-09-18 12:24:16 +00:00
|
|
|
anchors.top: separator2.bottom
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column4
|
|
|
|
spacing: Style.current.padding
|
|
|
|
anchors.top: sectionHeadlineContacts.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
width: parent.width
|
|
|
|
RowLayout {
|
|
|
|
width: parent.width
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Receive notifications from non-contacts"
|
|
|
|
text: qsTrId("receive-notifications-from-non-contacts")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSwitch {
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionMenuItem {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Muted users"
|
|
|
|
label: qsTrId("muted-users")
|
2020-09-18 12:24:16 +00:00
|
|
|
info: "2"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSectionMenuItem {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Muted chats"
|
|
|
|
label: qsTrId("muted-chats")
|
|
|
|
//% "You can limit what gets shown in notifications"
|
|
|
|
description: qsTrId("you-can-limit-what-gets-shown-in-notifications")
|
|
|
|
//% "None"
|
|
|
|
info: qsTrId("none")
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
id: separator3
|
|
|
|
anchors.top: column4.bottom
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: -Style.current.padding
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: -Style.current.padding
|
2020-09-18 12:24:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: column5
|
|
|
|
spacing: Style.current.smallPadding
|
|
|
|
anchors.top: separator3.bottom
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
2020-11-17 19:02:56 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2020-09-18 12:24:16 +00:00
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
Button {
|
|
|
|
flat: true
|
|
|
|
horizontalPadding: 0
|
|
|
|
contentItem: Text {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Reset notification settings"
|
|
|
|
text: qsTrId("reset-notification-settings")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
color: Style.current.red
|
|
|
|
}
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: mouse.accepted = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
2020-09-22 07:53:03 +00:00
|
|
|
//% "Restore default notification settings and unmute all chats and users"
|
|
|
|
text: qsTrId("restore-default-notification-settings-and-unmute-all-chats-and-users")
|
2020-09-18 12:24:16 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
}
|
2020-05-27 21:28:25 +00:00
|
|
|
}
|
|
|
|
}
|