update logging settings page
This commit is contained in:
parent
d18f50a3e0
commit
b33b97802e
1 changed files with 69 additions and 102 deletions
|
|
@ -25,69 +25,6 @@ PageType {
|
||||||
anchors.topMargin: 20
|
anchors.topMargin: 20
|
||||||
}
|
}
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: clientLogs
|
|
||||||
|
|
||||||
property string title: qsTr("Client logs")
|
|
||||||
property string description: qsTr("AmneziaVPN logs")
|
|
||||||
property bool isVisible: true
|
|
||||||
property var openLogsHandler: function() {
|
|
||||||
SettingsController.openLogsFolder()
|
|
||||||
}
|
|
||||||
property var exportLogsHandler: function() {
|
|
||||||
var fileName = ""
|
|
||||||
if (GC.isMobile()) {
|
|
||||||
fileName = "AmneziaVPN.log"
|
|
||||||
} else {
|
|
||||||
fileName = SystemController.getFileName(qsTr("Save"),
|
|
||||||
qsTr("Logs files (*.log)"),
|
|
||||||
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN",
|
|
||||||
true,
|
|
||||||
".log")
|
|
||||||
}
|
|
||||||
if (fileName !== "") {
|
|
||||||
PageController.showBusyIndicator(true)
|
|
||||||
SettingsController.exportLogsFile(fileName)
|
|
||||||
PageController.showBusyIndicator(false)
|
|
||||||
PageController.showNotificationMessage(qsTr("Logs file saved"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: serviceLogs
|
|
||||||
|
|
||||||
property string title: qsTr("Service logs")
|
|
||||||
property string description: qsTr("AmneziaVPN-service logs")
|
|
||||||
property bool isVisible: !GC.isMobile()
|
|
||||||
property var openLogsHandler: function() {
|
|
||||||
SettingsController.openServiceLogsFolder()
|
|
||||||
}
|
|
||||||
property var exportLogsHandler: function() {
|
|
||||||
var fileName = ""
|
|
||||||
if (GC.isMobile()) {
|
|
||||||
fileName = "AmneziaVPN-service.log"
|
|
||||||
} else {
|
|
||||||
fileName = SystemController.getFileName(qsTr("Save"),
|
|
||||||
qsTr("Logs files (*.log)"),
|
|
||||||
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN-service",
|
|
||||||
true,
|
|
||||||
".log")
|
|
||||||
}
|
|
||||||
if (fileName !== "") {
|
|
||||||
PageController.showBusyIndicator(true)
|
|
||||||
SettingsController.exportServiceLogsFile(fileName)
|
|
||||||
PageController.showBusyIndicator(false)
|
|
||||||
PageController.showNotificationMessage(qsTr("Logs file saved"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property list<QtObject> logTypes: [
|
|
||||||
clientLogs,
|
|
||||||
serviceLogs
|
|
||||||
]
|
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
|
|
||||||
|
|
@ -98,47 +35,11 @@ PageType {
|
||||||
|
|
||||||
property bool isFocusable: true
|
property bool isFocusable: true
|
||||||
|
|
||||||
Keys.onTabPressed: {
|
|
||||||
FocusController.nextKeyTabItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onBacktabPressed: {
|
|
||||||
FocusController.previousKeyTabItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onUpPressed: {
|
|
||||||
FocusController.nextKeyUpItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onDownPressed: {
|
|
||||||
FocusController.nextKeyDownItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onLeftPressed: {
|
|
||||||
FocusController.nextKeyLeftItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onRightPressed: {
|
|
||||||
FocusController.nextKeyRightItem()
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBarType {}
|
ScrollBar.vertical: ScrollBarType {}
|
||||||
|
|
||||||
model: logTypes
|
|
||||||
spacing: 24
|
|
||||||
snapMode: ListView.SnapOneItem
|
|
||||||
|
|
||||||
reuseItems: true
|
|
||||||
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
id: headerContent
|
|
||||||
|
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
HeaderType {
|
HeaderType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: 16
|
Layout.leftMargin: 16
|
||||||
|
|
@ -199,14 +100,17 @@ PageType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model: logTypes
|
||||||
|
clip: true
|
||||||
|
reuseItems: true
|
||||||
|
snapMode: ListView.SnapOneItem
|
||||||
|
|
||||||
delegate: ColumnLayout {
|
delegate: ColumnLayout {
|
||||||
id: delegateContent
|
id: delegateContent
|
||||||
|
|
||||||
width: listView.width
|
width: listView.width
|
||||||
|
|
||||||
spacing: 0
|
enabled: isVisible
|
||||||
|
|
||||||
visible: isVisible
|
|
||||||
|
|
||||||
ListItemTitleType {
|
ListItemTitleType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -257,4 +161,67 @@ PageType {
|
||||||
DividerType {}
|
DividerType {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property list<QtObject> logTypes: [
|
||||||
|
clientLogs,
|
||||||
|
serviceLogs
|
||||||
|
]
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: clientLogs
|
||||||
|
|
||||||
|
readonly property string title: qsTr("Client logs")
|
||||||
|
readonly property string description: qsTr("AmneziaVPN logs")
|
||||||
|
readonly property bool isVisible: true
|
||||||
|
readonly property var openLogsHandler: function() {
|
||||||
|
SettingsController.openLogsFolder()
|
||||||
|
}
|
||||||
|
readonly property var exportLogsHandler: function() {
|
||||||
|
var fileName = ""
|
||||||
|
if (GC.isMobile()) {
|
||||||
|
fileName = "AmneziaVPN.log"
|
||||||
|
} else {
|
||||||
|
fileName = SystemController.getFileName(qsTr("Save"),
|
||||||
|
qsTr("Logs files (*.log)"),
|
||||||
|
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN",
|
||||||
|
true,
|
||||||
|
".log")
|
||||||
|
}
|
||||||
|
if (fileName !== "") {
|
||||||
|
PageController.showBusyIndicator(true)
|
||||||
|
SettingsController.exportLogsFile(fileName)
|
||||||
|
PageController.showBusyIndicator(false)
|
||||||
|
PageController.showNotificationMessage(qsTr("Logs file saved"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: serviceLogs
|
||||||
|
|
||||||
|
readonly property string title: qsTr("Service logs")
|
||||||
|
readonly property string description: qsTr("AmneziaVPN-service logs")
|
||||||
|
readonly property bool isVisible: !GC.isMobile()
|
||||||
|
readonly property var openLogsHandler: function() {
|
||||||
|
SettingsController.openServiceLogsFolder()
|
||||||
|
}
|
||||||
|
readonly property var exportLogsHandler: function() {
|
||||||
|
var fileName = ""
|
||||||
|
if (GC.isMobile()) {
|
||||||
|
fileName = "AmneziaVPN-service.log"
|
||||||
|
} else {
|
||||||
|
fileName = SystemController.getFileName(qsTr("Save"),
|
||||||
|
qsTr("Logs files (*.log)"),
|
||||||
|
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/AmneziaVPN-service",
|
||||||
|
true,
|
||||||
|
".log")
|
||||||
|
}
|
||||||
|
if (fileName !== "") {
|
||||||
|
PageController.showBusyIndicator(true)
|
||||||
|
SettingsController.exportServiceLogsFile(fileName)
|
||||||
|
PageController.showBusyIndicator(false)
|
||||||
|
PageController.showNotificationMessage(qsTr("Logs file saved"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue