summaryrefstree
path: root/usr/bin/qml/Carlink/Checkpassword.qml
blob: 761d232f4f883bad59a123e5fc20a7d832d445be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import QtQuick 2.0
import "../com/neusoft/auto/widgets"
import "../windowsList.js" as WindowsList
import "../layoutList.js" as Layout
import Label 2.0

HMIWindow {
    id : checkpassword

	
	Component.onCompleted:
    {
		windowID = WindowsList.CARLINK_CHECKPASSWORD
		
    }

	onVisibleChanged: 
	{ 
		bMainWindow = false 
		bFullWindow = true 
        defaulttext.text = qsTr("Please input password")+systemCtrl.emptyString
		if(checkpassword.visible)
		{
			pwd_input.text = "";
		}
	} 
	
    HMIButton {
            id : back
            x : 600
            labelText: "back"
            btnImg:"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+bgImageStyle
            onClicked: {
                console.log("back---------------------->>");
               ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_SETTING)
            }
    }
	Text {
			id : title
			property real rate: 0.860
            x : 14 ; y : 149-132
            width: 150 ; height:  26
			color: "white"
		    font.family: "方正兰亭黑简体"
		    font.pixelSize:31*title.rate
            text : qsTr ("Identity Verification")+systemCtrl.emptyString
    }

    Image{
        id : password_background
        x : 80 ; y : 55
		source : "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524"+bgImageStyle

        HMIInputText {
            id : pwd_input
			width:password_background.width
			height:password_background.height
            x : 5 ; y : 8
            focus:  false
            horizontalAlignment: Label.AlignLeft
            color: "white"
            font.pixelSize: 24
            autoScroll: false
            cursorVisible:pwd_input.focus?true:false
			Text {
				id : defaulttext
				property real rate: 0.860
				color: "grey"
				font.pixelSize:31*defaulttext.rate
                text : qsTr ("Please input password")+systemCtrl.emptyString
			}
			onContentWidthChanged: {
                    if (pwd_input.text.length > 16)
                    {
                        pwd_input.text = pwd_input.text.substring(0, pwd_input.text.length - 1);
                    }
                }
		}
		MouseArea {
				anchors.fill : parent

				onClicked: {
						pwd_input.focus = true
						pwd_input.text = ""
						pwd_input.echoMode = TextInput.Password
						keyBoard.opacity = 1
						keyBoard.enabled = true
						password_background.source = "qrc:MATERIAL/MATERIAL_M8X_INPUT-BOX_524_C"+bgImageStyle
						defaulttext.visible = false 
						

						 systemCtrl.setTextInputHandle(pwd_input)
				}
		}	
        
        
    }
    HMIButton {
		id : sure
        x : 80
        y : 105
        labelText: "OK"
        btnImg: sure.pressed ?"qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON_PUSHED"+bgImageStyle
						: "qrc:MATERIAL/MATERIAL_M8X_SETTINGS_BUTTON"+bgImageStyle

        /*****naca 69921  button tone down *******/
        enabled:    pwd_input.text.length>0 ?true : false
        labelColor : pwd_input.text.length>0 ?"#FFFFFF" : "#656565"
         /*****naca 69921  button tone down *******/
        onClicked: {
			if (pwd_input.text.length != 0) {
				console.log ("user", pwd_input.text);
				carlinkCtrl.check_hmi_user_psd(pwd_input.text);
				carlinkCtrl.setBindPopupDisplay(true);
				ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_SETTING)
			}
        }
    }

    Item {
        id: chinaKeyBoard
        x: 0
        y: 572-132
        HMIKeyBoard{
           id: keyBoard
           x: 0
           y: 0
           opacity: 0
           enabled: false
           iType:1
           isPinyin:false
           /*****naca 70011*****/
           iPassword : true
            /*****naca 70011*****/
           onClickspell:
           {
               if(!keyBoard.isPinyin)
               {                  
                   systemCtrl.setKeyPress(spell)
               }
           }
        }
    }
}