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

97 lines
2.3 KiB
QML
Raw Normal View History

2021-07-28 16:13:29 +07:00
import QtQuick 2.12
import QtQuick.Controls 2.12
2021-09-14 00:39:07 +03: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.NetworkSettings
logic: NetworkSettingsLogic
2021-09-08 15:09:16 +03:00
BackButton {
2021-07-28 16:13:29 +07:00
id: back
}
2021-09-08 21:24:09 +03:00
Caption {
2021-10-21 19:49:53 +03:00
id: caption
2021-07-28 16:13:29 +07:00
text: qsTr("DNS Servers")
}
LabelType {
2021-10-21 19:49:53 +03:00
id: l1
2021-07-28 16:13:29 +07:00
x: 40
2021-10-21 19:49:53 +03:00
anchors.top: caption.bottom
width: parent.width - 40
2021-07-28 16:13:29 +07:00
height: 21
text: qsTr("Primary DNS server")
}
TextFieldType {
id: dns1
x: 40
2021-10-21 19:49:53 +03:00
anchors.top: l1.bottom
width: parent.width - 90
2021-07-28 16:13:29 +07:00
height: 40
2021-09-07 22:11:43 +03:00
text: NetworkSettingsLogic.lineEditDns1Text
2021-07-28 16:13:29 +07:00
onEditingFinished: {
2021-09-07 22:11:43 +03:00
NetworkSettingsLogic.lineEditDns1Text = text
NetworkSettingsLogic.onLineEditDns1EditFinished(text)
2021-07-28 16:13:29 +07:00
}
validator: RegExpValidator {
2021-09-03 20:17:13 +03:00
regExp: NetworkSettingsLogic.ipAddressValidatorRegex
2021-07-28 16:13:29 +07:00
}
}
2021-10-21 19:49:53 +03:00
ImageButtonType {
id: resetDNS1
anchors. left: dns1.right
anchors.leftMargin: 10
anchors.verticalCenter: dns1.verticalCenter
width: 24
height: 24
icon.source: "qrc:/images/reload.png"
onClicked: {
NetworkSettingsLogic.onPushButtonResetDns1Clicked()
}
}
LabelType {
id: l2
x: 40
anchors.top: dns1.bottom
anchors.topMargin: 20
width: parent.width - 40
height: 21
text: qsTr("Secondray DNS server")
}
2021-07-28 16:13:29 +07:00
TextFieldType {
id: dns2
x: 40
2021-10-21 19:49:53 +03:00
anchors.top: l2.bottom
width: parent.width - 90
2021-07-28 16:13:29 +07:00
height: 40
2021-09-07 22:11:43 +03:00
text: NetworkSettingsLogic.lineEditDns2Text
2021-07-28 16:13:29 +07:00
onEditingFinished: {
2021-09-07 22:11:43 +03:00
NetworkSettingsLogic.lineEditDns2Text = text
NetworkSettingsLogic.onLineEditDns2EditFinished(text)
2021-07-28 16:13:29 +07:00
}
validator: RegExpValidator {
2021-09-03 20:17:13 +03:00
regExp: NetworkSettingsLogic.ipAddressValidatorRegex
2021-07-28 16:13:29 +07:00
}
}
ImageButtonType {
id: resetDNS2
2021-10-21 19:49:53 +03:00
anchors. left: dns2.right
anchors.leftMargin: 10
anchors.verticalCenter: dns2.verticalCenter
2021-07-28 16:13:29 +07:00
width: 24
height: 24
icon.source: "qrc:/images/reload.png"
onClicked: {
2021-09-07 22:11:43 +03:00
NetworkSettingsLogic.onPushButtonResetDns2Clicked()
2021-07-28 16:13:29 +07:00
}
}
2021-10-21 19:49:53 +03:00
Logo {
anchors.bottom: parent.bottom
}
2021-07-28 16:13:29 +07:00
}