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 { Platform.MenuItem {
text: qsTr("Leave room") text: qsTr("Leave room")
onTriggered: Rooms.leave(roomContextMenu.roomid) onTriggered: leaveRoomDialog.open()
} }
Platform.MenuSeparator { Platform.MenuSeparator {

View file

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