Debian Codegraph @

resources/qml/dialogs/LeaveRoomDialog.qml

raw
1 // SPDX-FileCopyrightText: Nheko Contributors
2 //
3 // SPDX-License-Identifier: GPL-3.0-or-later
4
5 import Qt.labs.platform 1.1 as P
6 import QtQuick
7 import im.nheko
8
9 P.MessageDialog {
10 id: leaveRoomRoot
11
12 required property string roomId
13 property string reason: ""
14
15 title: qsTr("Leave room")
16 text: qsTr("Are you sure you want to leave?")
17 modality: Qt.ApplicationModal
18 buttons: P.MessageDialog.Ok | P.MessageDialog.Cancel
19
20 // Broken on macos, see https://bugreports.qt.io/browse/QTBUG-102078
21 //onAccepted: {
22 onOkClicked: {
23
24 if (CallManager.haveCallInvite) {
25 callManager.rejectInvite();
26 } else if (CallManager.isOnCall) {
27 CallManager.hangUp();
28 }
29 Rooms.leave(roomId, reason)
30 }
31
32 }