summary refs log tree commit diff
path: root/resources/qml/dialogs
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-09-23 21:18:48 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-10-11 19:00:40 -0400
commit14488a8fe78f829dadf3899a1c50ab389d05dbe9 (patch)
treec18e36ccbd831a51fd85288d6a92a15ea494f130 /resources/qml/dialogs
parentRemove unimplemented function declaration (diff)
downloadnheko-14488a8fe78f829dadf3899a1c50ab389d05dbe9.tar.xz
Use the same leave room dialog everywhere
This ports the leave room dialog to QML, everywhere. There are now no differences between the various leave dialogs.
Diffstat (limited to 'resources/qml/dialogs')
-rw-r--r--resources/qml/dialogs/LeaveRoomDialog.qml20
1 files changed, 20 insertions, 0 deletions
diff --git a/resources/qml/dialogs/LeaveRoomDialog.qml b/resources/qml/dialogs/LeaveRoomDialog.qml
new file mode 100644
index 00000000..1341ad72
--- /dev/null
+++ b/resources/qml/dialogs/LeaveRoomDialog.qml
@@ -0,0 +1,20 @@
+// SPDX-FileCopyrightText: 2021 Nheko Contributors
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import Qt.labs.platform 1.1
+import im.nheko 1.0
+
+MessageDialog {
+    id: leaveRoomRoot
+
+    required property string roomId
+
+    title: qsTr("Leave room")
+    text: qsTr("Are you sure you want to leave?")
+    modality: Qt.ApplicationModal
+    buttons: Dialog.Ok | Dialog.Cancel
+    onAccepted: Rooms.leave(roomId)
+}