Add UI for importing and exporting megolm keys
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls as QQC2
|
||||
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.formcard as FormCard
|
||||
import org.kde.kirigamiaddons.labs.components as KirigamiComponents
|
||||
|
||||
import org.kde.neochat
|
||||
|
||||
@@ -16,6 +17,13 @@ FormCard.FormCardPage {
|
||||
|
||||
title: i18nc("@title", "Security")
|
||||
|
||||
header: KirigamiComponents.Banner {
|
||||
id: banner
|
||||
showCloseButton: true
|
||||
visible: false
|
||||
type: Kirigami.MessageType.Error
|
||||
}
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: i18nc("@title:group", "Invitations")
|
||||
}
|
||||
@@ -60,6 +68,43 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormHeader {
|
||||
visible: Controller.csSupported
|
||||
title: i18nc("@title", "Encryption Keys")
|
||||
}
|
||||
FormCard.FormCard {
|
||||
visible: Controller.csSupported
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("@action:button", "Import Encryption Keys")
|
||||
icon.name: "document-import"
|
||||
onClicked: {
|
||||
let dialog = root.QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent("org.kde.neochat.settings", "ImportKeysDialog"), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Import Keys"),
|
||||
});
|
||||
dialog.success.connect(() => {
|
||||
banner.text = i18nc("@info", "Keys imported successfully");
|
||||
banner.type = Kirigami.MessageType.Positive;
|
||||
banner.visible = true;
|
||||
});
|
||||
banner.visible = false;
|
||||
}
|
||||
}
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18nc("@action:button", "Export Encryption Keys")
|
||||
icon.name: "document-export"
|
||||
onClicked: {
|
||||
root.QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent("org.kde.neochat.settings", "ExportKeysDialog"), {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Export Keys")
|
||||
});
|
||||
banner.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: ignoredUsersDialogComponent
|
||||
IgnoredUsersDialog {
|
||||
|
||||
Reference in New Issue
Block a user