added restore default settings for dns settings page
This commit is contained in:
parent
9e7cf3ccd9
commit
152d7bc3b3
1 changed files with 37 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import "./"
|
||||||
import "../Controls2"
|
import "../Controls2"
|
||||||
import "../Config"
|
import "../Config"
|
||||||
import "../Controls2/TextTypes"
|
import "../Controls2/TextTypes"
|
||||||
|
import "../Components"
|
||||||
|
|
||||||
PageType {
|
PageType {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -72,6 +73,38 @@ PageType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BasicButtonType {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
defaultColor: "transparent"
|
||||||
|
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
|
||||||
|
pressedColor: Qt.rgba(1, 1, 1, 0.12)
|
||||||
|
disabledColor: "#878B91"
|
||||||
|
textColor: "#D7D8DB"
|
||||||
|
borderWidth: 1
|
||||||
|
|
||||||
|
text: qsTr("Restore default")
|
||||||
|
|
||||||
|
onClicked: function() {
|
||||||
|
questionDrawer.headerText = qsTr("Restore default DNS settings?")
|
||||||
|
questionDrawer.yesButtonText = qsTr("Continue")
|
||||||
|
questionDrawer.noButtonText = qsTr("Cancel")
|
||||||
|
|
||||||
|
questionDrawer.yesButtonFunction = function() {
|
||||||
|
questionDrawer.visible = false
|
||||||
|
SettingsController.primaryDns = "1.1.1.1"
|
||||||
|
primaryDns.textFieldText = SettingsController.primaryDns
|
||||||
|
SettingsController.secondaryDns = "1.0.0.1"
|
||||||
|
secondaryDns.textFieldText = SettingsController.secondaryDns
|
||||||
|
PageController.showNotificationMessage(qsTr("Settings have been reset"))
|
||||||
|
}
|
||||||
|
questionDrawer.noButtonFunction = function() {
|
||||||
|
questionDrawer.visible = false
|
||||||
|
}
|
||||||
|
questionDrawer.visible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BasicButtonType {
|
BasicButtonType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
|
@ -84,8 +117,12 @@ PageType {
|
||||||
if (secondaryDns.textFieldText !== SettingsController.secondaryDns) {
|
if (secondaryDns.textFieldText !== SettingsController.secondaryDns) {
|
||||||
SettingsController.secondaryDns = secondaryDns.textFieldText
|
SettingsController.secondaryDns = secondaryDns.textFieldText
|
||||||
}
|
}
|
||||||
|
PageController.showNotificationMessage(qsTr("Settings saved"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QuestionDrawer {
|
||||||
|
id: questionDrawer
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue