diff --git a/Gui/BackupSettings.qml b/Gui/BackupSettings.qml index 12813bc..475fbb4 100644 --- a/Gui/BackupSettings.qml +++ b/Gui/BackupSettings.qml @@ -2,6 +2,8 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts import QtQuick.Dialogs +import QtCore + GridLayout { @@ -14,7 +16,6 @@ GridLayout Layout.alignment: Qt.AlignHCenter text: qsTr("Sicherung") font.pixelSize: 35 - } Label @@ -27,7 +28,7 @@ GridLayout { id: saveConfig text: qsTr("Jetzt sichern!") - onClicked: settingsFileDialog.open() + onClicked: dialog.open() } Label { @@ -38,7 +39,7 @@ GridLayout { id: saveEncryption text: qsTr("Jetzt sichern!") - onClicked: recoverEnc.open() + onClicked: apploader.item.recoverEnc.open() } Item { @@ -98,6 +99,12 @@ GridLayout { id: saveConfigFile fileMode: FileDialog.SaveFile - + nameFilters: ["PYQCRM Recovery files (*.pyqrec)"] + currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0] + onAccepted: + { + var test = config.backupConfig(saveConfigFile.currentFile) + console.log() + } } } diff --git a/Gui/Firststart.qml b/Gui/Firststart.qml index 7c2a134..031d688 100644 --- a/Gui/Firststart.qml +++ b/Gui/Firststart.qml @@ -12,7 +12,6 @@ Item property string recpass: "" property bool adminAvailable: true property alias recoverEnc: recoveryPaswordDialog - property alias first: firstStartItem id: firstStartItem anchors.fill: parent diff --git a/Gui/main.qml b/Gui/main.qml index 2d65ba1..cb948c4 100644 --- a/Gui/main.qml +++ b/Gui/main.qml @@ -14,6 +14,7 @@ ApplicationWindow property string confile: "" property alias settingsFileDialog: settingsFiledialog + TopBar { diff --git a/lib/ConfigLoader.py b/lib/ConfigLoader.py index a3bda34..8b2ee1f 100644 --- a/lib/ConfigLoader.py +++ b/lib/ConfigLoader.py @@ -195,6 +195,7 @@ class ConfigLoader(QObject): except Exception as e: print(str(e)) + def getConfig(self): # print(f"In {__file__} file, getConfig()") # print(self.__config) @@ -212,3 +213,8 @@ class ConfigLoader(QObject): self.__config['pyqcrm']['ENCRYPTION_KEY'] = enc_key self.__saveConfig() + @Slot(str) + def backupConfig(self, pw): + print(pw) + new_config = self.getConfig() + print(new_config)