116 lines
2.6 KiB
QML
116 lines
2.6 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import QtQuick.Dialogs
|
|
import QtCore
|
|
import "../js/qmldict.js" as JsLib
|
|
|
|
|
|
|
|
GridLayout
|
|
{
|
|
anchors.fill: parent
|
|
anchors.topMargin: 150
|
|
columns: 2
|
|
Label
|
|
{
|
|
Layout.columnSpan: 2
|
|
Layout.alignment: Qt.AlignHCenter
|
|
text: qsTr("Sicherung")
|
|
font.pixelSize: 35
|
|
}
|
|
|
|
Label
|
|
{
|
|
text: qsTr("Konfiguration")
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
}
|
|
Button
|
|
{
|
|
id: saveConfig
|
|
text: qsTr("Jetzt sichern!")
|
|
onClicked: dialog.open()
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Verschlüsselung")
|
|
Layout.alignment: Qt.AlignRight
|
|
}
|
|
Button
|
|
{
|
|
id: saveEncryption
|
|
text: qsTr("Jetzt sichern!")
|
|
onClicked: apploader.item.recoverEnc.open()
|
|
}
|
|
Item
|
|
{
|
|
id: spacer
|
|
Layout.fillHeight: true
|
|
}
|
|
Dialog
|
|
{
|
|
anchors.centerIn: parent
|
|
id: dialog
|
|
title: "Title"
|
|
standardButtons: Dialog.Apply | Dialog.Cancel
|
|
|
|
onApplied:
|
|
{
|
|
|
|
if (configPwd.text === repeatConfigPwd.text)
|
|
{
|
|
|
|
saveConfigFile.open()
|
|
}
|
|
else
|
|
{
|
|
configPwd.text = ""
|
|
configPwd.placeholderText = qsTr("Passwort stimmt nicht überein")
|
|
configPwd.placeholderTextColor = "red"
|
|
repeatConfigPwd.placeholderText = qsTr("")
|
|
repeatConfigPwd.text = ""
|
|
}
|
|
}
|
|
onRejected: console.log("Cancel clicked")
|
|
GridLayout
|
|
{
|
|
id: gridPw
|
|
columns: 2
|
|
Label
|
|
{
|
|
text: qsTr("Passwort eingeben")
|
|
}
|
|
TextField
|
|
{
|
|
|
|
id: configPwd
|
|
placeholderText: qsTr("Sicherungspasswort festlegen")
|
|
}
|
|
Label
|
|
{
|
|
text: qsTr("Passwort wiederholen")
|
|
}
|
|
TextField
|
|
{
|
|
property string name: "password"
|
|
id: repeatConfigPwd
|
|
placeholderText: qsTr("Sicherungspasswort wiederholen")
|
|
}
|
|
|
|
}
|
|
}
|
|
FileDialog
|
|
{
|
|
id: saveConfigFile
|
|
fileMode: FileDialog.SaveFile
|
|
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
|
|
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
|
|
onAccepted:
|
|
{
|
|
var pw = JsLib.parseForm(gridPw)
|
|
config.backupConfig(saveConfigFile.currentFile, pw["password"])
|
|
}
|
|
}
|
|
}
|