Files
amnezia-client/client/ui/qml/Pages2/PageSettings.qml
T

172 lines
4.8 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2023-06-01 11:25:33 +08:00
import QtQuick.Dialogs
import PageEnum 1.0
import Style 1.0
import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
PageType {
id: root
2023-06-01 11:25:33 +08:00
FlickableType {
id: fl
anchors.top: parent.top
anchors.bottom: parent.bottom
2023-06-01 11:25:33 +08:00
contentHeight: content.height
ColumnLayout {
id: content
2023-06-01 11:25:33 +08:00
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
2023-08-26 10:08:50 +03:00
spacing: 0
2025-05-02 23:54:36 -07:00
BaseHeaderType {
2024-04-18 17:54:55 +04:00
id: header
2023-06-01 11:25:33 +08:00
Layout.fillWidth: true
2023-08-26 10:08:50 +03:00
Layout.topMargin: 24
2023-06-01 11:25:33 +08:00
Layout.rightMargin: 16
Layout.leftMargin: 16
2023-06-01 11:25:33 +08:00
headerText: qsTr("Settings")
}
2023-06-01 11:25:33 +08:00
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: account
2023-06-01 11:25:33 +08:00
Layout.fillWidth: true
Layout.topMargin: 16
2023-06-01 11:25:33 +08:00
text: qsTr("Servers")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/server.svg"
2023-06-01 11:25:33 +08:00
clickedFunction: function() {
2023-09-06 13:37:37 +05:00
PageController.goToPage(PageEnum.PageSettingsServersList)
2023-06-01 11:25:33 +08:00
}
}
DividerType {}
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: connection
2023-06-01 11:25:33 +08:00
Layout.fillWidth: true
2023-06-01 11:25:33 +08:00
text: qsTr("Connection")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/radio.svg"
2023-06-01 11:25:33 +08:00
clickedFunction: function() {
2023-09-06 13:37:37 +05:00
PageController.goToPage(PageEnum.PageSettingsConnection)
}
}
2023-06-01 11:25:33 +08:00
DividerType {}
2023-06-01 11:25:33 +08:00
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: application
Layout.fillWidth: true
2023-06-01 11:25:33 +08:00
text: qsTr("Application")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/app.svg"
2023-06-01 11:25:33 +08:00
clickedFunction: function() {
2023-09-06 13:37:37 +05:00
PageController.goToPage(PageEnum.PageSettingsApplication)
}
}
2023-06-01 11:25:33 +08:00
DividerType {}
2025-06-20 02:22:44 +04:00
LabelWithButtonType {
id: news
Layout.fillWidth: true
text: qsTr("News & Notifications")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: NewsModel.hasUnread ? "qrc:/images/controls/news-unread.svg" : "qrc:/images/controls/news.svg"
clickedFunction: function() {
PageController.goToPage(PageEnum.PageSettingsNewsNotifications)
}
}
DividerType {}
2023-06-01 11:25:33 +08:00
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: backup
Layout.fillWidth: true
2023-06-01 11:25:33 +08:00
text: qsTr("Backup")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/save.svg"
2023-06-01 11:25:33 +08:00
clickedFunction: function() {
2023-09-06 13:37:37 +05:00
PageController.goToPage(PageEnum.PageSettingsBackup)
}
2023-06-01 11:25:33 +08:00
}
DividerType {}
2023-06-01 11:25:33 +08:00
LabelWithButtonType {
2023-10-12 01:15:05 +01:00
id: about
2023-06-01 11:25:33 +08:00
Layout.fillWidth: true
text: qsTr("About AmneziaVPN")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/amnezia.svg"
2023-06-01 11:25:33 +08:00
clickedFunction: function() {
2023-09-06 13:37:37 +05:00
PageController.goToPage(PageEnum.PageSettingsAbout)
}
}
2023-06-01 11:25:33 +08:00
DividerType {}
LabelWithButtonType {
id: devConsole
visible: SettingsController.isDevModeEnabled
Layout.fillWidth: true
text: qsTr("Dev console")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/bug.svg"
clickedFunction: function() {
PageController.goToPage(PageEnum.PageDevMenu)
}
}
DividerType {
visible: SettingsController.isDevModeEnabled
}
LabelWithButtonType {
2024-04-18 17:54:55 +04:00
id: close
2023-10-14 23:59:46 +01:00
visible: GC.isDesktop()
Layout.fillWidth: true
2023-10-12 01:15:05 +01:00
Layout.preferredHeight: about.height
text: qsTr("Close application")
leftImageSource: "qrc:/images/controls/x-circle.svg"
2024-12-31 04:16:52 +01:00
isLeftImageHoverEnabled: false
clickedFunction: function() {
PageController.closeApplication()
}
}
DividerType {
2023-10-14 23:59:46 +01:00
visible: GC.isDesktop()
}
}
2023-06-01 11:25:33 +08:00
}
}