2019-12-19 22:46:16 +11:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
2019-09-09 20:23:46 +10:00
|
|
|
import QtQuick 2.12
|
2020-07-12 12:52:14 +10:00
|
|
|
import "../Base"
|
|
|
|
import "../Base/Buttons"
|
2019-09-09 20:23:46 +10:00
|
|
|
|
2020-06-25 22:32:08 +10:00
|
|
|
HFlickableColumnPopup {
|
|
|
|
id: popup
|
2019-09-09 20:23:46 +10:00
|
|
|
|
|
|
|
property string userId: ""
|
|
|
|
property string roomId: ""
|
2020-06-26 20:09:20 +10:00
|
|
|
property var preClearCallback: null
|
2020-06-25 22:32:08 +10:00
|
|
|
|
|
|
|
|
2020-07-12 12:52:14 +10:00
|
|
|
page.footer: AutoDirectionLayout {
|
2020-06-25 22:32:08 +10:00
|
|
|
ApplyButton {
|
|
|
|
id: clearButton
|
|
|
|
text: qsTr("Clear")
|
|
|
|
icon.name: "clear-messages"
|
|
|
|
onClicked: {
|
2020-06-26 20:09:20 +10:00
|
|
|
if (preClearCallback) preClearCallback()
|
2020-06-25 22:32:08 +10:00
|
|
|
py.callClientCoro(userId, "clear_events", [roomId])
|
|
|
|
popup.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CancelButton {
|
|
|
|
onClicked: popup.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SummaryLabel {
|
|
|
|
text: qsTr("Clear this room's messages?")
|
|
|
|
}
|
|
|
|
|
|
|
|
DetailsLabel {
|
|
|
|
text: qsTr(
|
|
|
|
"The messages will only be removed on your side. " +
|
|
|
|
"They will be available again after you restart the application."
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
onOpened: clearButton.forceActiveFocus()
|
2019-09-09 20:23:46 +10:00
|
|
|
}
|