Add button to get a QR code for the local user to the account editor page

This commit is contained in:
James Graham
2024-04-10 17:19:11 +00:00
parent 2887263f26
commit c61c73088f
2 changed files with 17 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ Components.AbstractMaximizeComponent {
id: root
required property string text
required property color avatarColor
property color avatarColor
required property string avatarSource
Shortcut {

View File

@@ -112,6 +112,22 @@ FormCard.FormCardPage {
text: root.connection ? root.connection.label : ""
}
FormCard.FormDelegateSeparator {}
FormCard.FormButtonDelegate {
text: i18nc("@action:button", "QR code for account")
onClicked: {
let qrMax = Qt.createComponent('org.kde.neochat', 'QrCodeMaximizeComponent.qml').createObject(QQC2.ApplicationWindow.overlay, {
text: "https://matrix.to/#/" + root.connection.localUser.id,
title: root.connection.localUser.displayName,
subtitle: root.connection.localUser.id,
avatarSource: root.connection.makeMediaUrl(root.connection.localUser.avatarUrl)
});
if (typeof root.closeDialog === "function") {
root.closeDialog();
}
qrMax.open();
}
}
FormCard.FormDelegateSeparator {}
FormCard.FormButtonDelegate {
text: i18n("Save")
onClicked: {