mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
added button 'Reset settings and remove all data from the application'
This commit is contained in:
@@ -48,6 +48,7 @@ PageType {
|
||||
Layout.topMargin: 16
|
||||
|
||||
text: qsTr("Language")
|
||||
descriptionText: LanguageModel.getCurrentLanuageName()
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
@@ -60,6 +61,22 @@ PageType {
|
||||
}
|
||||
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Logging")
|
||||
descriptionText: SettingsController.isLoggingEnable ? qsTr("Enabled") : qsTr("Disabled")
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
goToPage(PageEnum.PageSettingsLogging)
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -67,10 +84,27 @@ PageType {
|
||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
questionDrawer.headerText = qsTr("Reset settings and remove all data from the application?")
|
||||
questionDrawer.descriptionText = qsTr("All settings will be reset to default. All installed AmneziaVPN services will still remain on the server.")
|
||||
questionDrawer.yesButtonText = qsTr("Continue")
|
||||
questionDrawer.noButtonText = qsTr("Cancel")
|
||||
|
||||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
SettingsController.clearSettings()
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
}
|
||||
questionDrawer.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
|
||||
QuestionDrawer {
|
||||
id: questionDrawer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,96 +44,6 @@ PageType {
|
||||
headerText: qsTr("Backup")
|
||||
}
|
||||
|
||||
SwitcherType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
text: qsTr("Save logs")
|
||||
|
||||
checked: SettingsController.isSaveLogsEnabled()
|
||||
onCheckedChanged: {
|
||||
if (checked !== SettingsController.isSaveLogsEnabled()) {
|
||||
SettingsController.setSaveLogs(checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredWidth: root.width / 3
|
||||
|
||||
ImageButtonType {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
image: "qrc:/images/controls/folder-open.svg"
|
||||
|
||||
onClicked: SettingsController.openLogsFolder()
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Open folder with logs")
|
||||
color: "#D7D8DB"
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredWidth: root.width / 3
|
||||
|
||||
ImageButtonType {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
image: "qrc:/images/controls/save.svg"
|
||||
|
||||
onClicked: SettingsController.exportLogsFile()
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Save logs to file")
|
||||
color: "#D7D8DB"
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredWidth: root.width / 3
|
||||
|
||||
ImageButtonType {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
image: "qrc:/images/controls/delete.svg"
|
||||
|
||||
onClicked: SettingsController.clearLogs()
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Clear logs")
|
||||
color: "#D7D8DB"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListItemTitleType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 10
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import PageEnum 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Config"
|
||||
import "../Controls2/TextTypes"
|
||||
|
||||
PageType {
|
||||
id: root
|
||||
|
||||
BackButtonType {
|
||||
id: backButton
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: backButton.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: content.height
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 16
|
||||
anchors.rightMargin: 16
|
||||
|
||||
spacing: 16
|
||||
|
||||
HeaderType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
headerText: qsTr("Logging")
|
||||
}
|
||||
|
||||
SwitcherType {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
text: qsTr("Save logs")
|
||||
|
||||
checked: SettingsController.isLoggingEnable
|
||||
onCheckedChanged: {
|
||||
if (checked !== SettingsController.isLoggingEnable) {
|
||||
SettingsController.isLoggingEnable = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredWidth: root.width / 3
|
||||
|
||||
ImageButtonType {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
image: "qrc:/images/controls/folder-open.svg"
|
||||
|
||||
onClicked: SettingsController.openLogsFolder()
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Open folder with logs")
|
||||
color: "#D7D8DB"
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredWidth: root.width / 3
|
||||
|
||||
ImageButtonType {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
image: "qrc:/images/controls/save.svg"
|
||||
|
||||
onClicked: SettingsController.exportLogsFile()
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Save logs to file")
|
||||
color: "#D7D8DB"
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignBaseline
|
||||
Layout.preferredWidth: root.width / 3
|
||||
|
||||
ImageButtonType {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
implicitWidth: 56
|
||||
implicitHeight: 56
|
||||
|
||||
image: "qrc:/images/controls/delete.svg"
|
||||
|
||||
onClicked: SettingsController.clearLogs()
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Clear logs")
|
||||
color: "#D7D8DB"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user