mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
replace FlickableType with ListViewType in PageSettingsBackup
This commit is contained in:
@@ -41,51 +41,68 @@ PageType {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: 20
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if(backButton.enabled && backButton.activeFocus) {
|
||||
listView.positionViewAtBeginning()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
ListViewType {
|
||||
id: listView
|
||||
|
||||
anchors.top: backButton.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
contentHeight: content.height
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
header: ColumnLayout {
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: 16
|
||||
anchors.rightMargin: 16
|
||||
width: listView.width
|
||||
|
||||
spacing: 16
|
||||
|
||||
BaseHeaderType {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
headerText: qsTr("Back up your configuration")
|
||||
descriptionText: qsTr("You can save your settings to a backup file to restore them the next time you install the application.")
|
||||
}
|
||||
}
|
||||
|
||||
model: 1 // fake model to force the ListView to be created without a model
|
||||
|
||||
delegate: ColumnLayout { // TODO(CyAn84): add DelegateChooser when have migrated to 6.9
|
||||
|
||||
width: listView.width
|
||||
|
||||
spacing: 16
|
||||
|
||||
WarningType {
|
||||
Layout.topMargin: 16
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
textString: qsTr("The backup will contain your passwords and private keys for all servers added " +
|
||||
"to AmneziaVPN. Keep this information in a secure place.")
|
||||
"to AmneziaVPN. Keep this information in a secure place.")
|
||||
|
||||
iconPath: "qrc:/images/controls/alert-circle.svg"
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
id: makeBackupButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 14
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
text: qsTr("Make a backup")
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunc: function() {
|
||||
var fileName = ""
|
||||
if (GC.isMobile()) {
|
||||
@@ -108,8 +125,11 @@ PageType {
|
||||
|
||||
BasicButtonType {
|
||||
id: restoreBackupButton
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -8
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
defaultColor: AmneziaStyle.color.transparent
|
||||
hoveredColor: AmneziaStyle.color.translucentWhite
|
||||
@@ -120,8 +140,6 @@ PageType {
|
||||
|
||||
text: qsTr("Restore from backup")
|
||||
|
||||
parentFlickable: fl
|
||||
|
||||
clickedFunc: function() {
|
||||
var filePath = SystemController.getFileName(qsTr("Open backup file"),
|
||||
qsTr("Backup files (*.backup)"))
|
||||
|
||||
Reference in New Issue
Block a user