Confirm forgetting room with popup
This commit is contained in:
parent
88042cd111
commit
4ffa3470c7
21
src/qml/Popups/ForgetRoomPopup.qml
Normal file
21
src/qml/Popups/ForgetRoomPopup.qml
Normal 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: ""
|
||||
}
|
|
@ -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,
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user