Files
amnezia-client/client/ui/qml/Pages/PageGeneralSettings.qml
T

166 lines
5.0 KiB
QML
Raw Normal View History

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
2021-08-09 00:41:52 +07:00
import PageEnum 1.0
2021-07-28 16:13:29 +07:00
import "./"
2021-08-19 01:27:22 +03:00
import "../Controls"
import "../Config"
2021-07-28 16:13:29 +07:00
2021-09-14 00:39:07 +03:00
PageBase {
2021-07-28 16:13:29 +07:00
id: root
2021-09-14 00:39:07 +03:00
page: PageEnum.GeneralSettings
logic: GeneralSettingsLogic
2021-09-08 15:09:16 +03:00
BackButton {
2021-07-28 16:13:29 +07:00
id: back
z: -1
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
Flickable {
id: fl
width: root.width
2021-10-28 00:04:54 +03:00
anchors.top: back.bottom
anchors.topMargin: 0
anchors.bottom: root.bottom
anchors.bottomMargin: 10
anchors.left: root.left
anchors.leftMargin: 30
anchors.right: root.right
anchors.rightMargin: 30
2021-10-28 00:04:54 +03:00
contentHeight: content.height
clip: true
2021-10-28 00:04:54 +03:00
ColumnLayout {
id: content
enabled: logic.pageEnabled
anchors.top: parent.top
anchors.topMargin: 10
anchors.left: parent.left
anchors.right: parent.right
2021-10-28 00:04:54 +03:00
spacing: 15
2021-10-28 00:04:54 +03:00
// ---------- App settings ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/settings_black_24dp.svg"
text: qsTr("App settings")
onClicked: {
UiLogic.goToPage(PageEnum.AppSettings)
}
}
2021-10-28 00:04:54 +03:00
// ---------- Network settings ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/settings_suggest_black_24dp.svg"
text: qsTr("Network settings")
onClicked: {
UiLogic.goToPage(PageEnum.NetworkSettings)
}
}
2021-10-28 00:04:54 +03:00
// ---------- Server settings ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/vpn_key_black_24dp.svg"
text: qsTr("Server Settings")
onClicked: {
GeneralSettingsLogic.onPushButtonGeneralSettingsServerSettingsClicked()
}
}
2021-10-28 00:04:54 +03:00
// ---------- Share connection ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/share_black_24dp.svg"
text: qsTr("Share connection")
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable
onClicked: {
GeneralSettingsLogic.onPushButtonGeneralSettingsShareConnectionClicked()
}
}
2021-10-28 00:04:54 +03:00
// ---------- Servers ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/format_list_bulleted_black_24dp.svg"
text: qsTr("Servers")
onClicked: {
UiLogic.goToPage(PageEnum.ServersList)
}
}
// ---------- Add server ------------
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
icon.source: "qrc:/images/svg/control_point_black_24dp.svg"
text: qsTr("Add server")
onClicked: {
UiLogic.goToPage(PageEnum.Start)
}
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
color: "#DDDDDD"
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: fl.height > (75+1) * 6 ? fl.height - (75+1) * 6 : 0
}
SettingButtonType {
Layout.fillWidth: true
Layout.preferredHeight: 30
Layout.bottomMargin: 20
icon.source: "qrc:/images/svg/logout_black_24dp.svg"
text: qsTr("Exit")
onClicked: {
Qt.quit()
}
}
2021-08-19 01:27:22 +03:00
}
}
2021-07-28 16:13:29 +07:00
}