fix: proper wl name on connection key page (#1867)

* fix: proper wl name on connection key page

* some changings

* little change

* added missing import

* fix: proper wl default filename
This commit is contained in:
MrMirDan
2025-09-29 05:55:53 +03:00
committed by GitHub
parent 7a96c212f3
commit f3539b2632
@@ -6,6 +6,8 @@ import Qt.labs.platform 1.1
import QtCore import QtCore
import SortFilterProxyModel 0.2
import PageEnum 1.0 import PageEnum 1.0
import Style 1.0 import Style 1.0
@@ -17,6 +19,33 @@ import "../Components"
PageType { PageType {
id: root id: root
property var processedServer
Connections {
target: ServersModel
function onProcessedServerChanged() {
root.processedServer = proxyServersModel.get(0)
}
}
SortFilterProxyModel {
id: proxyServersModel
objectName: "proxyServersModel"
sourceModel: ServersModel
filters: [
ValueFilter {
roleName: "isCurrentlyProcessed"
value: true
}
]
Component.onCompleted: {
root.processedServer = proxyServersModel.get(0)
}
}
Component.onCompleted: { Component.onCompleted: {
PageController.showBusyIndicator(true) PageController.showBusyIndicator(true)
ApiConfigsController.prepareVpnKeyExport() ApiConfigsController.prepareVpnKeyExport()
@@ -40,7 +69,7 @@ PageType {
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
Layout.topMargin: 16 Layout.topMargin: 16
text: qsTr("Amnezia Premium\nsubscription key") text: qsTr(root.processedServer.name + "\nsubscription key")
font.pixelSize: 32 font.pixelSize: 32
font.bold: true font.bold: true
color: AmneziaStyle.color.paleGray color: AmneziaStyle.color.paleGray
@@ -79,11 +108,11 @@ PageType {
clickedFunc: function() { clickedFunc: function() {
var fileName = GC.isMobile() var fileName = GC.isMobile()
? "amnezia_vpn_key.vpn" ? root.processedServer.name.toLowerCase().replace(/\s+/g, "_") + "_key.vpn"
: SystemController.getFileName( : SystemController.getFileName(
qsTr("Save AmneziaVPN config"), qsTr("Save AmneziaVPN config"),
qsTr("Config files (*.vpn)"), qsTr("Config files (*.vpn)"),
StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/amnezia_vpn_key", StandardPaths.standardLocations(StandardPaths.DocumentsLocation) + "/" + root.processedServer.name.toLowerCase().replace(/\s+/g, "_") + "_key",
true, true,
".vpn" ".vpn"
) )
@@ -177,7 +206,7 @@ PageType {
Header2Type { Header2Type {
Layout.fillWidth: true Layout.fillWidth: true
headerText: qsTr("Amnezia Premium Subscription key") headerText: qsTr(root.processedServer.name + " Subscription key")
} }
TextArea { TextArea {