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

188 lines
4.2 KiB
QML
Raw Normal View History

2021-07-28 16:13:29 +07:00
import QtQuick 2.12
import QtQuick.Controls 2.12
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
}
2021-10-28 00:04:54 +03:00
// ---------- App settings ------------
2021-08-19 01:27:22 +03:00
Rectangle {
2021-10-28 00:04:54 +03:00
id: l1
visible: !GC.isMobile()
anchors.top: back.bottom
2021-08-19 01:27:22 +03:00
x: 20
width: parent.width - 40
2021-10-28 00:04:54 +03:00
height: GC.isMobile() ? 0: 1
2021-08-19 01:27:22 +03:00
color: "#DDDDDD"
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
SettingButtonType {
id: b1
visible: !GC.isMobile()
anchors.top: l1.bottom
anchors.topMargin: GC.isMobile() ? 0: 15
x: 30
2021-08-19 01:27:22 +03:00
width: parent.width - 40
2021-10-28 00:04:54 +03:00
height: GC.isMobile() ? 0: 30
icon.source: "qrc:/images/settings.png"
text: qsTr("App settings")
onClicked: {
UiLogic.goToPage(PageEnum.AppSettings)
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
// ---------- Network settings ------------
2021-08-19 01:27:22 +03:00
Rectangle {
2021-10-28 00:04:54 +03:00
id: l2
anchors.top: b1.bottom
anchors.topMargin: 15
2021-08-19 01:27:22 +03:00
x: 20
width: parent.width - 40
2021-07-28 16:13:29 +07:00
height: 1
2021-08-19 01:27:22 +03:00
color: "#DDDDDD"
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
SettingButtonType {
id: b2
x: 30
anchors.top: l2.bottom
anchors.topMargin: 15
2021-08-19 01:27:22 +03:00
width: parent.width - 40
2021-10-28 00:04:54 +03:00
height: 30
icon.source: "qrc:/images/settings.png"
text: qsTr("Network settings")
onClicked: {
UiLogic.goToPage(PageEnum.NetworkSettings)
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
// ---------- Server settings ------------
2021-08-19 01:27:22 +03:00
Rectangle {
2021-10-28 00:04:54 +03:00
id: l3
anchors.top: b2.bottom
anchors.topMargin: 15
2021-08-19 01:27:22 +03:00
x: 20
width: parent.width - 40
2021-07-28 16:13:29 +07:00
height: 1
2021-08-19 01:27:22 +03:00
color: "#DDDDDD"
2021-07-28 16:13:29 +07:00
}
SettingButtonType {
2021-10-28 00:04:54 +03:00
id: b3
2021-07-28 16:13:29 +07:00
x: 30
2021-10-28 00:04:54 +03:00
anchors.top: l3.bottom
anchors.topMargin: 15
2021-07-28 16:13:29 +07:00
width: 330
height: 30
2021-10-28 00:04:54 +03:00
icon.source: "qrc:/images/server_settings.png"
text: qsTr("Server Settings")
2021-08-09 00:41:52 +07:00
onClicked: {
2021-10-28 00:04:54 +03:00
GeneralSettingsLogic.onPushButtonGeneralSettingsServerSettingsClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
// ---------- Share connection ------------
Rectangle {
id: l4
anchors.top: b3.bottom
anchors.topMargin: 15
x: 20
width: parent.width - 40
height: 1
color: "#DDDDDD"
2021-07-28 16:13:29 +07:00
}
SettingButtonType {
2021-10-28 00:04:54 +03:00
id: b4
2021-07-28 16:13:29 +07:00
x: 30
2021-10-28 00:04:54 +03:00
anchors.top: l4.bottom
anchors.topMargin: 15
2021-07-28 16:13:29 +07:00
width: 330
height: 30
2021-10-28 00:04:54 +03:00
icon.source: "qrc:/images/share.png"
text: qsTr("Share connection")
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable
2021-08-09 00:41:52 +07:00
onClicked: {
2021-10-28 00:04:54 +03:00
GeneralSettingsLogic.onPushButtonGeneralSettingsShareConnectionClicked()
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
// ---------- Servers ------------
Rectangle {
id: l5
anchors.top: b4.bottom
anchors.topMargin: 15
x: 20
width: parent.width - 40
height: 1
color: "#DDDDDD"
2021-07-28 16:13:29 +07:00
}
SettingButtonType {
2021-10-28 00:04:54 +03:00
id: b5
2021-07-28 16:13:29 +07:00
x: 30
2021-10-28 00:04:54 +03:00
anchors.top: l5.bottom
anchors.topMargin: 15
2021-07-28 16:13:29 +07:00
width: 330
height: 30
icon.source: "qrc:/images/server_settings.png"
text: qsTr("Servers")
2021-08-09 00:41:52 +07:00
onClicked: {
UiLogic.goToPage(PageEnum.ServersList)
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
// ---------- Add server ------------
Rectangle {
id: l6
anchors.top: b5.bottom
anchors.topMargin: 15
x: 20
width: parent.width - 40
height: 1
color: "#DDDDDD"
}
2021-07-28 16:13:29 +07:00
SettingButtonType {
2021-10-28 00:04:54 +03:00
id: b6
2021-07-28 16:13:29 +07:00
x: 30
2021-10-28 00:04:54 +03:00
anchors.top: l6.bottom
anchors.topMargin: 15
2021-07-28 16:13:29 +07:00
width: 330
height: 30
2021-10-28 00:04:54 +03:00
icon.source: "qrc:/images/plus.png"
text: qsTr("Add server")
2021-08-09 00:41:52 +07:00
onClicked: {
2021-10-28 00:04:54 +03:00
UiLogic.goToPage(PageEnum.Start)
2021-08-09 00:41:52 +07:00
}
2021-07-28 16:13:29 +07:00
}
2021-10-28 00:04:54 +03:00
Rectangle {
id: l7
anchors.top: b6.bottom
anchors.topMargin: 15
x: 20
width: parent.width - 40
height: 1
color: "#DDDDDD"
}
2021-08-19 01:27:22 +03:00
SettingButtonType {
x: 30
anchors.bottom: parent.bottom
anchors.bottomMargin: 20
width: 330
height: 30
icon.source: "qrc:/images/settings.png"
text: qsTr("Exit")
onClicked: {
Qt.quit()
}
}
2021-07-28 16:13:29 +07:00
}