Rework HBox-based pages and account settings
- 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)
This commit is contained in:
@@ -37,8 +37,8 @@ HFileDialogOpener {
|
||||
|
||||
PasswordPopup {
|
||||
id: exportPasswordPopup
|
||||
details.text: qsTr("Passphrase to protect this file:")
|
||||
okText: qsTr("Export")
|
||||
summary.text: qsTr("Passphrase to protect this file:")
|
||||
validateButton.text: qsTr("Export")
|
||||
|
||||
onAcceptedPasswordChanged: exportKeys(file, acceptedPassword)
|
||||
|
||||
|
@@ -16,17 +16,16 @@ HFileDialogOpener {
|
||||
|
||||
|
||||
property string userId: ""
|
||||
property bool importing: false
|
||||
property Future importFuture: null
|
||||
|
||||
|
||||
PasswordPopup {
|
||||
id: importPasswordPopup
|
||||
details.text:
|
||||
importing ?
|
||||
summary.text:
|
||||
importFuture ?
|
||||
qsTr("This might take a while...") :
|
||||
qsTr("Passphrase used to protect this file:")
|
||||
okText: qsTr("Import")
|
||||
validateButton.text: qsTr("Import")
|
||||
|
||||
onClosed: if (importFuture) importFuture.cancel()
|
||||
|
||||
@@ -35,13 +34,10 @@ HFileDialogOpener {
|
||||
|
||||
|
||||
function verifyPassword(pass, callback) {
|
||||
importing = true
|
||||
|
||||
const call = py.callClientCoro
|
||||
const path = file.toString().replace(/^file:\/\//, "")
|
||||
|
||||
importFuture = call(userId, "import_keys", [path, pass], () => {
|
||||
importing = false
|
||||
importFuture = null
|
||||
callback(true)
|
||||
|
||||
@@ -78,7 +74,7 @@ HFileDialogOpener {
|
||||
|
||||
Binding on closePolicy {
|
||||
value: Popup.CloseOnEscape
|
||||
when: importing
|
||||
when: importFuture
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user