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