Confirm leaving room with popup

This commit is contained in:
miruka 2019-09-09 09:12:51 -04:00
parent c38cc9d3df
commit 88042cd111
2 changed files with 25 additions and 2 deletions

View 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: ""
}

View File

@ -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,
}
)
}