Show confirmation dialog when leaving a room via the context menu

This commit is contained in:
Nicolas Werner 2021-07-22 15:07:33 +02:00
parent 5ae73bf8fd
commit 0ac550ecbb
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 12 additions and 2 deletions

View file

@ -61,9 +61,19 @@ Page {
}
}
Platform.MessageDialog {
id: leaveRoomDialog
title: qsTr("Leave Room")
text: qsTr("Are you sure you want to leave this room?")
modality: Qt.Modal
onAccepted: Rooms.leave(roomContextMenu.roomid)
buttons: Dialog.Ok | Dialog.Cancel
}
Platform.MenuItem {
text: qsTr("Leave room")
onTriggered: Rooms.leave(roomContextMenu.roomid)
onTriggered: leaveRoomDialog.open()
}
Platform.MenuSeparator {

View file

@ -219,7 +219,7 @@ ApplicationWindow {
title: qsTr("End-to-End Encryption")
text: qsTr("Encryption is currently experimental and things might break unexpectedly. <br>
Please take note that it can't be disabled afterwards.")
modality: Qt.NonModal
modality: Qt.Modal
onAccepted: {
if (roomSettings.isEncryptionEnabled)
return ;