Uncheck messages before clearing event list
This commit is contained in:
parent
7f66ebb786
commit
d058926902
1
TODO.md
1
TODO.md
|
@ -6,7 +6,6 @@
|
||||||
- device list keyboard navigation
|
- device list keyboard navigation
|
||||||
- device IP geolocation
|
- device IP geolocation
|
||||||
- field/area focus line in popups weird
|
- field/area focus line in popups weird
|
||||||
- clear listview checked on message clear
|
|
||||||
- unregister popup/menu when destroyed without being closed
|
- unregister popup/menu when destroyed without being closed
|
||||||
- menu click-through padding to close it easily
|
- menu click-through padding to close it easily
|
||||||
- show scrollbars for a few secs if there's content to scroll on beginning
|
- show scrollbars for a few secs if there's content to scroll on beginning
|
||||||
|
|
|
@ -96,6 +96,11 @@ ListView {
|
||||||
checkedIndiceChanged()
|
checkedIndiceChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uncheckAll() {
|
||||||
|
checked = {}
|
||||||
|
checkedIndice = new Set()
|
||||||
|
}
|
||||||
|
|
||||||
function toggleCheck(...indices) {
|
function toggleCheck(...indices) {
|
||||||
const checkedNow = []
|
const checkedNow = []
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,11 @@ HColumnLayout {
|
||||||
|
|
||||||
popup: "Popups/ClearMessagesPopup.qml"
|
popup: "Popups/ClearMessagesPopup.qml"
|
||||||
popupParent: chat
|
popupParent: chat
|
||||||
properties: ({userId: chat.userId, roomId: chat.roomId})
|
properties: ({
|
||||||
|
userId: chat.userId,
|
||||||
|
roomId: chat.roomId,
|
||||||
|
preClearCallback: eventList.uncheckAll,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,6 +170,7 @@ Rectangle {
|
||||||
{
|
{
|
||||||
userId: window.uiState.pageProperties.userId,
|
userId: window.uiState.pageProperties.userId,
|
||||||
roomId: window.uiState.pageProperties.roomId,
|
roomId: window.uiState.pageProperties.roomId,
|
||||||
|
preClearCallback: eventList.uncheckAll,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ HFlickableColumnPopup {
|
||||||
|
|
||||||
property string userId: ""
|
property string userId: ""
|
||||||
property string roomId: ""
|
property string roomId: ""
|
||||||
|
property var preClearCallback: null
|
||||||
|
|
||||||
|
|
||||||
page.footer: ButtonLayout {
|
page.footer: ButtonLayout {
|
||||||
|
@ -17,6 +18,7 @@ HFlickableColumnPopup {
|
||||||
text: qsTr("Clear")
|
text: qsTr("Clear")
|
||||||
icon.name: "clear-messages"
|
icon.name: "clear-messages"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (preClearCallback) preClearCallback()
|
||||||
py.callClientCoro(userId, "clear_events", [roomId])
|
py.callClientCoro(userId, "clear_events", [roomId])
|
||||||
popup.close()
|
popup.close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user