amnezia-client/client/ui/qml/DefaultVpn/Pages/PageSettingsLogging.qml
aiamnezia ffb398e231
feature: add country selection page (#5)
* Add country selection page for premium

* Add countryCode property

* Fix country visibility logic

* Add premium settings

* Fix binding loop

* Add settings page

* Add logging settings page

* Add confirmation dialog for server removing

* Fix flag size

* Fix flags sizes

* chore: added translation files

---------

Co-authored-by: vladimir.kuznetsov <nethiuswork@gmail.com>
2025-04-08 12:54:56 +07:00

120 lines
No EOL
3.6 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtCore
import PageEnum 1.0
import Config 1.0
import "../Components"
import "../Controls"
import "../Controls/TextTypes"
Page {
id: root
ColumnLayout {
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
anchors.topMargin: 8
RowLayout {
Layout.fillWidth: true
WhiteButtonNoBorder {
id: backButton
imageSource: "qrc:/images/controls/arrow-left.svg"
onClicked: PageController.closePage()
}
}
ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: 8
Layout.rightMargin: 8
Layout.topMargin: 8
RowLayout {
Layout.fillWidth: true
Header1TextType {
Layout.fillWidth: true
text: qsTr("Logging")
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
}
SwitcherType {
id: switcher
Layout.fillWidth: true
Layout.topMargin: 4
Layout.bottomMargin: 4
Layout.rightMargin: 4
checked: SettingsController.isLoggingEnabled
onCheckedChanged: {
if (checked !== SettingsController.isLoggingEnabled) {
SettingsController.isLoggingEnabled = checked
}
}
}
}
MediumTextType {
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("In case of application failures, enable logging to find the problem")
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
}
WhiteButtonWithBorder {
Layout.fillWidth: true
Layout.topMargin: 40
text: qsTr("Save logs to file")
onClicked: function() {
var fileName = ""
if (DeviceInfo.isMobile()) {
fileName = "DefaultVPN.log"
} else {
fileName = SystemController.getFileName(qsTr("Save"),
qsTr("Logs files (*.log)"),
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/DefaultVPN",
true,
".log")
}
if (fileName !== "") {
PageController.showBusyIndicator(true)
SettingsController.exportLogsFile(fileName)
PageController.showBusyIndicator(false)
PageController.showNotificationMessage(qsTr("Logs file saved"))
}
}
}
WhiteButtonWithBorder {
Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Open logs")
onClicked: function() {
SettingsController.openLogsFolder()
}
}
Item {
Layout.fillHeight: true
}
}
}
}