import QtQuick 2.0 import "../com/neusoft/auto/widgets" import "../windowsList.js" as WindowsList import "../layoutList.js" as Layout Item { id : bluelist width: 500 height: 600 Image { id: background x : 0 ; y : 0 height: 30 Text { property real rate: 0.860 id : text_title height : 30 width : 250 color: "white" font.family: "方正兰亭黑简体" font.pixelSize:31*text_title.rate text : qsTr("BT device lists")+systemCtrl.emptyString } } Item { id: page x :0 ; y : 30 width: 360 height: 640 ListView { id: view anchors.fill: parent anchors.rightMargin: 12 model : carlinkCtrl.getMacList(); delegate: model_delegate spacing: 30 interactive: false } Component { id: model_delegate Image { width: 700 height: 40 Text { property real rate: 0.860 id : label height : 40 width : 250 color: "white" font.family: "方正兰亭黑简体" font.pixelSize:31*label.rate horizontalAlignment: label.AlignHCenter text : model.modelData.macName } HMIButton { id : bindbtn x :520 btnImg: bindbtn.pressed ?"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_PUSHED"+systemCtrl.style : "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+systemCtrl.style HMILabel { id:lab anchors.fill: parent text: model.modelData.isBind? qsTr("Unbind")+systemCtrl.emptyString : qsTr("Bind")+systemCtrl.emptyString color:"white" font.pixelSize: 24 } onClicked: { console.log ("selected mac :" ,label.text); console.log ("selected index : " ,index ); carlinkCtrl.set_hmi_selected_mac(label.text); carlinkCtrl.setCurrentIndex(index); if (modelData.isBind){ console.log("unbind------------------->>") carlinkCtrl.setIsBindMac(false); ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CHECKPASSWORD) } else { console.log("bind------------------->>") carlinkCtrl.setIsBindMac(true); //Naca70191 [The upper limit of the same account to bind Bluetooth device is eight]by sunjiaqi console.log("carlinkCtrl.getBindMacCount():"+carlinkCtrl.getBindMacCount()) if(carlinkCtrl.getBindMacCount() == 8){ if (0 ===systemCtrl.getLanguage() ){ carlinkCtrl.showPromptInfo ("Too many bound BT device,Please unbind one to add new." , true); } else{ carlinkCtrl.showPromptInfo ("可绑定的蓝牙设备已达上限,请先解绑一个设备." , true); } } else{ ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CHECKPASSWORD) } } } } } } } Connections { target: carlinkCtrl onSig_isMaclistChanged : { console.log("maclist changed---------->>>") view.model = carlinkCtrl.getMacList(); console.log("maclist changed---------->>>over") } } }