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:carlinkhome_page Component.onCompleted: { windowID = WindowsList.CARLINKLOGIN_MAIN } onVisibleChanged: { bMainWindow = false bFullWindow = true if(carlinkhome_page.visible) { psw_input.text = ""; if(carlinkCtrl.isCleanCurName) { user_input.text = ""; carlinkCtrl.setIsCleanCurName (false); } } isNameScreen =false } property bool isNameScreen : false MouseArea{ width:carlinkhome_page.width height:carlinkhome_page.height-50 // for close button valid onClicked: { console.log("carlinkhome_page------->onClicked ") isNameScreen = false } } HMILabel{ id:loginTitle x:51 y:148-132 width:300 height:30 horizontalAlignment: Label.AlignLeft text:qsTr("Login telematics")+systemCtrl.emptyString; } Item{ id:password x:34 y:257-132 Image { id: psw_background x: 0 y: 0 source:psw_input.focus ? "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524_C"+bgImageStyle : "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524"+bgImageStyle HMILabel { id: psw_title y:7 width: psw_background.width height: 30 color:"gray" text:qsTr("Please input password")+systemCtrl.emptyString font.pixelSize: 24 horizontalAlignment: Label.AlignLeft visible:psw_input.focus||psw_input.text.length>0?false:true } HMIInputText { id: psw_input x: 5 y: 8 width: psw_background.width//378 height: psw_background.height//48 focus: false horizontalAlignment: Label.AlignLeft color: "white" text:"admin123" font.pixelSize: 24 autoScroll: false echoMode:TextInput.Password cursorVisible:psw_input.focus?true:false onCursorPositionChanged: { if(psw_input.text.length>0) { keyBoard.deleteEnable=true } else { keyBoard.deleteEnable=false } } onContentWidthChanged: { if (psw_input.text.length > 16) { psw_input.text = psw_input.text.substring(0, psw_input.text.length - 1); } } MouseArea { anchors.fill: parent onClicked: { psw_input.focus = true keyBoard.opacity = 1 keyBoard.enabled = true isNameScreen =false /*****naca 70011*****/ keyBoard.iPassword = true /*****naca 70011*****/ if(psw_input.text.length > 0) { keyBoard.deleteEnable=true } else { keyBoard.deleteEnable=false } systemCtrl.setTextInputHandle(psw_input) } } } } } Item{ id:username x:34 y:65 Image { id: user_background x: 0 y: 0 source:user_input.focus ? "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524_C"+bgImageStyle : "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524"+bgImageStyle HMILabel { id: user_title y:7 width: user_background.width height: 30 color:"gray" text:qsTr("Please input user ID")+systemCtrl.emptyString font.pixelSize: 24 horizontalAlignment: Label.AlignLeft visible:user_input.focus||user_input.text.length>0?false:true } HMIInputText { id: user_input x: 5 y: 8 width: user_background.width height: user_background.height focus: false horizontalAlignment: Label.AlignLeft color: "white" text:"" font.pixelSize: 24 autoScroll: false cursorVisible:user_input.focus?true:false onCursorPositionChanged: { console.log("=====================onCursorPositionChanged======================user_input====="+user_input.text) if(user_input.text.length>0) { keyBoard.deleteEnable=true } else { keyBoard.deleteEnable=false } } onContentWidthChanged: { if (user_input.text.length > 16) { user_input.text = user_input.text.substring(0, user_input.text.length - 1); } } /****************************for naca 69927************************/ onTextChanged: { psw_input.text = "" } /****************************for naca 69927************************/ MouseArea { anchors.fill: parent onClicked: { user_input.focus = true /*****naca 70011*****/ keyBoard.iPassword = false /*****naca 70011*****/ if(user_input.text.length > 0) { keyBoard.deleteEnable=true } else { keyBoard.deleteEnable=false } systemCtrl.setTextInputHandle(user_input) } } } } } HMIButton { id: btn_login x:574 y:193-132 labelText: qsTr("Login")+systemCtrl.emptyString enabled: ((!carlinkCtrl.isLogining) && (psw_input.text.length > 0)&&(user_input.text.length >0)) ? true:false btnImg: btn_login.enabled?(btn_login.pressed ? "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_PUSHED"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+bgImageStyle) :"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+bgImageStyle /*****NACA69921******/ labelColor: ((!carlinkCtrl.isLogining) && (psw_input.text.length > 0)&&(user_input.text.length >0)) ?"#FFFFFF" : "#656565" /*****NACA69921******/ onClicked: { console.log("[btn_login] onClick") isNameScreen = false carlinkCtrl.judgeRemainingTime() if(!carlinkCtrl.isLoginLock) { console.log("[CarlinkLogin.qml][btn_login][getlockinfo]--->carlinkCtrl.isLoginLock = false") carlinkCtrl.get_hmi_user_name_pswd(user_input.text,psw_input.text) //carlinkCtrl.setIsLogining(true) } else { console.log("[CarlinkLogin.qml][btn_login][getlockinfo]--->") carlinkCtrl.setLogfailRemainingTimeText(); } } } HMIButton { id: btn_forgetpswd x:574; y:253-132; labelText: qsTr("Forget?")+systemCtrl.emptyString btnImg: btn_forgetpswd.pressed? "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_PUSHED"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+bgImageStyle onClicked: { isNameScreen =false console.log("[btn_login] onClick ------cancel") ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.FORGETPASSWORD) } } Item { id: chinaKeyBoard x: 0 y: 400 HMIKeyBoard{ id: keyBoard x: 0 y: 0 opacity: 1 enabled: true iType:1 isPinyin:true iSerach:false iConfirm:true onClickspell: { if(!keyBoard.isPinyin) { console.log("====ddddddddddddddddddddd====") systemCtrl.setKeyPress(spell) } } } } HMIButton{ id:btnAccountList x:516 y:214-132 btnImg:isNameScreen?(btnAccountList.pressed?"qrc:MATERIAL/MATERIAL_M8X_SUB-ARROW_UP_P"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_SUB-ARROW_UP"+bgImageStyle) :(btnAccountList.pressed?"qrc:MATERIAL/MATERIAL_M8X_SUB-ARROW_DOWN_P"+bgImageStyle :"qrc:MATERIAL/MATERIAL_M8X_SUB-ARROW_DOWN"+bgImageStyle) onClicked: { console.log("btnAccountList-->>>onclick") showAccountList(); carlinkCtrl.getAccountListDisplay(); } } LoginAccountList { id: imgAccountList x:242 y:182 visible:isNameScreen } function showAccountList() { console.log("showAccountList----->>>>>") if(isNameScreen==false) { console.log("isNameScreen-->false") isNameScreen=true; } else { console.log("isNameScreen-->true") isNameScreen=false; } } Connections{ target: imgAccountList onNameListClicked:{ console.log("onNameListClicked----------->>>") user_input.text = carlinkCtrl.getUserName() isNameScreen=false; } } }