da4a5ab5cd
- Refactor everything about HBox, and adapt all the pages and popups that used it - Replace HTabContainer by HTabbedBox - Make boxes swippable - Make esc presses in boxes click the cancel button - Make all boxes and popups scrollable when needed - Replace generic apply button icons in popups - Fix tab focus for error and invite popups - Rework (still WIP) the account settings page: - Use the standard tabbed design of other pages - Ditch the horizontal profile layout, hacky and impossible to extend - Add real-time coloring for the display name field - Implement a device list in account settings (Sessions, still WIP)
48 lines
1.1 KiB
QML
48 lines
1.1 KiB
QML
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
import QtQuick 2.12
|
|
import Qt.labs.platform 1.1
|
|
import "../Popups"
|
|
|
|
HFileDialogOpener {
|
|
fill: false
|
|
dialog.title: qsTr("Save decryption keys file as...")
|
|
dialog.fileMode: FileDialog.SaveFile
|
|
onFilePicked: {
|
|
exportPasswordPopup.file = file
|
|
exportPasswordPopup.open()
|
|
}
|
|
|
|
|
|
// This is used for the SignOutPopup to know when the export is done
|
|
// so it can close
|
|
signal done()
|
|
|
|
|
|
property string userId: ""
|
|
property bool exporting: false
|
|
|
|
|
|
function exportKeys(file, passphrase) {
|
|
exporting = true
|
|
|
|
const path = file.toString().replace(/^file:\/\//, "")
|
|
|
|
py.callClientCoro(userId, "export_keys", [path, passphrase], () => {
|
|
exporting = false
|
|
done()
|
|
})
|
|
}
|
|
|
|
|
|
PasswordPopup {
|
|
id: exportPasswordPopup
|
|
summary.text: qsTr("Passphrase to protect this file:")
|
|
validateButton.text: qsTr("Export")
|
|
|
|
onAcceptedPasswordChanged: exportKeys(file, acceptedPassword)
|
|
|
|
property url file: ""
|
|
}
|
|
}
|