Some code organisation and recovery procedure fix

This commit is contained in:
2024-12-09 23:23:11 +01:00
parent 5f08435816
commit 3acafaea32
7 changed files with 305 additions and 234 deletions

View File

@@ -1,10 +1,13 @@
import QtCore
import QtQuick
import QtQuick.Controls
import QtQuick.Dialogs
import QtQuick.Layouts
Item
{
property string recpass: ""
anchors.fill: parent
ColumnLayout
@@ -133,11 +136,58 @@ Item
Layout.fillHeight: true
}
Dialog
{
id: recoveryPaswordDialog
modal: true
title: qsTr("Wiederherstellung")
anchors.centerIn: parent
standardButtons: Dialog.Ok | Dialog.Cancel
onAccepted:
{
recpass = recoveryPaswordInput.text
getRecoveryDialog.open()
}
ColumnLayout
{
RowLayout
{
Label
{
text: qsTr("Wiederherstellungspasswort eingeben: ")
}
TextField
{
id: recoveryPaswordInput
text: ""
echoMode: TextInput.Password
implicitWidth: 300
placeholderText: qsTr("Hier Wiederherstellungspasswort eingeben")
}
}
}
}
FileDialog
{
id: getRecoveryDialog
title: qsTr("Wiederherstellungsdatei")
fileMode: FileDialog.OpenFile
nameFilters: ["PYQCRM Recovery files (*.pyqrec)"]
currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0]
onAccepted: config.getRecoveryKey(getRecoveryDialog.currentFile, recpass)
onRejected: quit()
}
}
Component.onCompleted:
{
loggedin_user.loginOkay.connect(loggedin)
config.invalidEncryptionKey.connect(getEncryptionKey)
config.checkEncryptionKey()
}
function loggedin()
@@ -145,4 +195,8 @@ Item
appLoader.source = "Dashboard.qml"
}
function getEncryptionKey()
{
recoveryPaswordDialog.open()
}
}