Confirm leaving room with popup
This commit is contained in:
parent
c38cc9d3df
commit
88042cd111
17
src/qml/Popups/LeaveRoomPopup.qml
Normal file
17
src/qml/Popups/LeaveRoomPopup.qml
Normal file
|
@ -0,0 +1,17 @@
|
|||
import QtQuick 2.12
|
||||
|
||||
BoxPopup {
|
||||
summary.text: qsTr("Leave %1?").arg(roomName)
|
||||
details.text: qsTr(
|
||||
"If this room is private, you will not be able to rejoin it."
|
||||
)
|
||||
okText: qsTr("Leave")
|
||||
box.focusButton: "ok"
|
||||
|
||||
onOk: py.callClientCoro(userId, "room_leave", [roomId])
|
||||
|
||||
|
||||
property string userId: ""
|
||||
property string roomId: ""
|
||||
property string roomName: ""
|
||||
}
|
|
@ -108,8 +108,14 @@ HTileDelegate {
|
|||
icon.color: theme.colors.negativeBackground
|
||||
text: invited ? qsTr("Decline invite") : qsTr("Leave")
|
||||
|
||||
onTriggered: py.callClientCoro(
|
||||
model.user_id, "room_leave", [model.data.room_id]
|
||||
onTriggered: Utils.makePopup(
|
||||
"Popups/LeaveRoomPopup.qml",
|
||||
sidePane,
|
||||
{
|
||||
userId: model.user_id,
|
||||
roomId: model.data.room_id,
|
||||
roomName: model.data.display_name,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user