import QtQuick 2.0 import "../com/neusoft/auto/widgets" import "../eventsList.js" as EventsList import "../layoutList.js" as Layout import "../windowsList.js" as WindowsList import Label 2.0 HMIWindow{ id:main_window property int pyeventx: 15 Component.onCompleted: { windowID = WindowsList.CARLINK_CHATINTERACTION } onVisibleChanged: { bMainWindow = false msg_list.model = carlinkCtrl.getAutoGroupList(); } HMILabel { id : text_titled x : 51 -pyeventx y : 148-131 height : 27 width : 250 font.pixelSize:27 horizontalAlignment: Label.AlignLeft text : qsTr("AutoGroup")+systemCtrl.emptyString } HMIButton{ id:back x:689 -pyeventx y:151-131 width:31 height:21 btnImg:back.pressed?"qrc:MATERIAL/MATERIAL_M8X_ICON_BACK_P"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_ICON_BACK"+bgImageStyle onClicked: { ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_MAIN) } } HMIButton{ id : clean x:630 -pyeventx y:193-131 labelText: qsTr("Clear")+systemCtrl.emptyString labelPixelSize: 23 btnImg:clean.pressed ?"qrc:MATERIAL/MATERIAL_M8X_POPUP_BUTTON_PUSHED"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_POPUP_BUTTON"+bgImageStyle onClicked: { if ( carlinkCtrl.getAllMsgCount() !== 0){ pop.popvisible = true; } } } Component{ id:model_delegate Item{ x:0 y:0 height:62 width:700 HMIButton{ id : itemBtn btnImg:itemBtn.pressed? "qrc:MATERIAL/MATERIAL_M8X_LIST_P"+bgImageStyle : "qrc:MATERIAL/MATERIAL_M8X_LIST"+bgImageStyle Image //head portrait { x:9; y:8 sourceSize.height:46 sourceSize.width:46 //source: "qrc:MATERIAL/MATERIAL_M8X_DEFAULT_AVATAR"+bgImageStyle source:model.modelData.Icon_Path } Image { x:4 ; y:3 source: "qrc:MATERIAL/MATERIAL_M8X_LIST_DEFAULT_UNREAD_1"+bgImageStyle visible: model.modelData.Unread ==="0"?false:true } HMILabel //friend nickname { id : f_name x:65 ; y:262-254 width:200 ; height:28 font.pixelSize:20 horizontalAlignment: Label.AlignLeft text:model.modelData.User_Name } HMILabel //friend message { id : message x:99-34 ; y: 292-254 height:18 ; width:280 font.pixelSize:13 elide: message.contentWidth >280?Label.ElideRight:Label.ElideNone horizontalAlignment: Label.AlignLeft text : (model.modelData.Msg_Type==="1")? model.modelData.Msg_Content: (model.modelData.Msg_Type==="2")?"[语音]": (model.modelData.Msg_Type==="3")?"[图片]": "" } HMILabel { id: msg_time x : 401-34 ; y:263-254 height:16 ; width:199 font.pixelSize:16 horizontalAlignment: Label.AlignRight text : model.modelData.Msg_Date } HMIButton{ id:del x:630-34 ; y:257-254 labelText: qsTr("Delete")+systemCtrl.emptyString labelPixelSize: 23 btnImg:del.pressed?"qrc:MATERIAL/MATERIAL_M8X_POPUP_BUTTON_PUSHED"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_POPUP_BUTTON"+bgImageStyle onClicked: { carlinkCtrl.deleteMsgforId(index, model.modelData.User_Id); } } onClicked: { carlinkCtrl.updateMsgTblforReaded(model.modelData.User_Id); if ("1"=== model.modelData.User_Type){ carlinkCtrl.selAutoGroupListforId(model.modelData.User_Id); } else if ("3" === model.modelData.User_Type ){ carlinkCtrl.selAutoGroupListforGroup(model.modelData.User_Id); } else{ //do nothing } carlinkCtrl.setCurrentUseId(model.modelData.User_Id); carlinkCtrl.setCurrentDialogId(model.modelData.User_Id); carlinkCtrl.setCurrentDialogName(model.modelData.User_Name); carlinkCtrl.setCurrentDialogtype(model.modelData.User_Type); ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_DIALOGBOX) ScreenManager.changeForm(Layout.FM_CLOSE,windowID) } } } } HMIListView{ id:msg_list x:34 -pyeventx y:254-131 width: 700+20 height: bMaxWindow?580:62*3 model: carlinkCtrl.getAutoGroupList(); delegate: model_delegate spacing: 2 showBar:true scrollBar:true } HMIButton{ id:chat_interaction x:70-pyeventx y:bMaxWindow?828-131-3:444-131-3 labelPixelSize:23 labelText: qsTr("Chats")+systemCtrl.emptyString btnImg:chat_interaction.pressed?"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_C"+bgImageStyle } HMIButton{ id:auto_list x:192-pyeventx y:bMaxWindow?828-131-3:444-131-3 labelPixelSize:23 labelText: qsTr("Contacts")+systemCtrl.emptyString btnImg:auto_list.pressed?"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4_P"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_4"+bgImageStyle onClicked: { ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_MYLIST) } } CarLink_AutoGrpPop{ id : pop popimageY : bMaxWindow ? 424-131 : 65 mask_height : bMaxWindow ? 695 : 310 pop_tex:"Are you sure to clear the chats?" popvisible : false pop_type:1 } Connections { target: carlinkCtrl onSigAutoGroupMsgListChanged : { console.log("autogrouplist changed---------->>>") msg_list.model = carlinkCtrl.getAutoGroupList(); } onSigAutoGroupMsgListReceiveUpdate : { console.log("auto group MsgRecv changed---------->>>") msg_list.model = carlinkCtrl.getAutoGroupListForUpdate(); } } }