mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
added confirmation dialog when clearing logs and notification after clearing
This commit is contained in:
@@ -4,9 +4,9 @@ import QtQuick.Layouts
|
||||
|
||||
import PageEnum 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
import "../Config"
|
||||
import "../Components"
|
||||
import "../Controls2/TextTypes"
|
||||
|
||||
PageType {
|
||||
@@ -121,7 +121,23 @@ PageType {
|
||||
|
||||
image: "qrc:/images/controls/delete.svg"
|
||||
|
||||
onClicked: SettingsController.clearLogs()
|
||||
onClicked: function() {
|
||||
questionDrawer.headerText = qsTr("Clear logs?")
|
||||
questionDrawer.yesButtonText = qsTr("Continue")
|
||||
questionDrawer.noButtonText = qsTr("Cancel")
|
||||
|
||||
questionDrawer.yesButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.clearLogs()
|
||||
PageController.showBusyIndicator(false)
|
||||
PageController.showNotificationMessage(qsTr("Logs have been cleaned up"))
|
||||
}
|
||||
questionDrawer.noButtonFunction = function() {
|
||||
questionDrawer.visible = false
|
||||
}
|
||||
questionDrawer.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
CaptionTextType {
|
||||
@@ -133,6 +149,10 @@ PageType {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QuestionDrawer {
|
||||
id: questionDrawer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user