2021-07-28 16:13:29 +07:00
|
|
|
import QtQuick 2.12
|
|
|
|
|
import QtQuick.Controls 2.12
|
2022-02-15 17:08:55 +03:00
|
|
|
import QtQuick.Layouts 1.15
|
2022-02-05 15:52:14 +03:00
|
|
|
import QtGraphicalEffects 1.15
|
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
|
2022-02-15 17:08:55 +03:00
|
|
|
z: -1
|
2021-07-28 16:13:29 +07:00
|
|
|
}
|
2021-10-28 00:04:54 +03:00
|
|
|
|
2022-12-24 16:41:53 +00:00
|
|
|
FlickableType {
|
2022-02-15 17:08:55 +03:00
|
|
|
id: fl
|
2021-10-28 00:04:54 +03:00
|
|
|
anchors.top: back.bottom
|
2022-02-15 17:08:55 +03:00
|
|
|
anchors.topMargin: 0
|
|
|
|
|
anchors.bottomMargin: 10
|
|
|
|
|
contentHeight: content.height
|
2021-10-28 00:04:54 +03:00
|
|
|
|
2022-02-15 17:08:55 +03:00
|
|
|
ColumnLayout {
|
|
|
|
|
id: content
|
|
|
|
|
enabled: logic.pageEnabled
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.topMargin: 10
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
2023-01-07 13:40:35 +00:00
|
|
|
anchors.rightMargin: GC.defaultMargin
|
2021-10-28 00:04:54 +03:00
|
|
|
|
2022-02-15 17:08:55 +03:00
|
|
|
spacing: 15
|
2021-10-28 00:04:54 +03:00
|
|
|
|
|
|
|
|
|
2022-02-15 17:08:55 +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
|
|
|
|
2022-02-15 17:08:55 +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
|
|
|
|
2022-02-15 17:08:55 +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
|
|
|
|
2022-02-15 17:08:55 +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
|
|
|
|
2022-02-15 17:08:55 +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
|
|
|
}
|
|
|
|
|
}
|
2022-02-15 17:08:55 +03:00
|
|
|
|
|
|
|
|
|
2021-07-28 16:13:29 +07:00
|
|
|
}
|