Confirm forgetting room with popup

This commit is contained in:
miruka 2019-09-09 09:24:45 -04:00
parent 88042cd111
commit 4ffa3470c7
2 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,21 @@
import QtQuick 2.12
BoxPopup {
summary.text: qsTr(
"You will leave the room and lose its messages. Forget %1?"
).arg(roomName)
details.text: qsTr(
"If all members forget the room, it will be removed from the servers."
)
okText: qsTr("Forget")
box.focusButton: "ok"
onOk: py.callClientCoro(userId, "room_forget", [roomId])
property string userId: ""
property string roomId: ""
property string roomName: ""
}

View File

@ -124,8 +124,14 @@ HTileDelegate {
icon.color: theme.colors.negativeBackground
text: qsTr("Forget")
onTriggered: py.callClientCoro(
model.user_id, "room_forget", [model.data.room_id]
onTriggered: Utils.makePopup(
"Popups/ForgetRoomPopup.qml",
sidePane,
{
userId: model.user_id,
roomId: model.data.room_id,
roomName: model.data.display_name,
}
)
}
}