summaryrefstree
path: root/usr/bin/qml/Carlink/Carlink_Contacts_Select_Cont.qml
blob: 5fe5350ee81b4fa1d039198fe8267944528f9077 (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
import QtQuick 2.0
import "../eventsList.js" as EventsList
import "../com/neusoft/auto/widgets"
import "../layoutList.js" as Layout
import "../windowsList.js" as WindowsList
import "../Setting/Settinglist.js" as Settinglist
import Label 2.0

HMIWindow
{
    property int curContactIndex: 0
    property bool changevisiblenum: true
    property bool selectState: true
    property string aTozCurrent: ""
    Component.onCompleted:
    {
        windowID = WindowsList.CARLINK_CONTACTS_SELECT_CONT
    }
    onVisibleChanged:
    {
        bFullWindow = true
        changevisiblenum=true
    }
    HMILabel
    {
        x:24
        y:128-128
        width:700
        height:56
        text:"Interact"
        color: "white"
        font.pixelSize: 28
        verticalAlignment: Label.AlignVCenter
        horizontalAlignment: Label.AlignLeft
    }
    HMIButton
    {
        id:icon_back
        x:650
        y:10
        width: 90
        height: 21

        btnImg:icon_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_CONTACTS_NEW_MSG)

        }
    }
    HMIButton
    {
        id:icon_return
        x:650
        y:75
        width: 90
        height: 21
        labelText: "V"
        btnImg:icon_return.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_1_P"+bgImageStyle)
                                   :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_1"+bgImageStyle)
        onClicked:
        {
            ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_NEW_MSG)

        }
    }

    Item
    {
        x:20
        y:135
        width:700
        height: 540
        HMIListView
        {
            id:contact_people
            anchors.fill: parent
            clip:true
            model: carlinkCtrl.getPhoneListFromDB//carlinkPhoneBookListModel
            delegate: phone_Number
            keyNavigationWraps: true
            orientation: ListView.Vertical
            highlightFollowsCurrentItem: true
            snapMode: ListView.SnapOneItem
            rightMargin: 0
            scrollBar:true
            scrollBar_edge:0
            scrollBar_width:4
            spacing: 2
            scrollBar_img:"qrc:MATERIAL/MATERIAL_M8X_SLIDER_BAR"+bgImageStyle
        }
        Component
        {
            id:phone_Number
            HMIButton
            {
                id:contact_List
                enabled: col1=='1'?false:true
                height: 62
                btnImg:"qrc:MATERIAL/MATERIAL_M8X_LIST"+bgImageStyle
                //"qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_BK"+bgImageStyle
                Image
                {
                    height: 62
                    visible: (curContactIndex == index) ? true:false
                    source:(contact_List.pressed)?("qrc:MATERIAL/MATERIAL_M8X_LIST_P"+bgImageStyle)
                                                 :("qrc:MATERIAL/MATERIAL_M8X_LIST_C"+bgImageStyle)
                }
                Item
                {
                    x:col1=='1'?52-34:73-34
                    y:211-190
                    width: 520
                    height: 37
                    HMILabel
                    {
                        anchors.fill: parent
                        horizontalAlignment: Text.AlignLeft
                        elide: Label.ElideRight
                        font.pixelSize:24
                        text:col0
                    }
                }
                HMILabel
                {
                    x:100// 73-34-80
                    y: 211-190
                    width: 520
                    height: 37
                    font.pixelSize:24
                    text:col1
                }
                HMILabel
                {
                    x: 609-34-12
                    y: 211-190-2
                    width: 30
                    height: 25
                    font.pixelSize:24
                    visible: col1=='1'?false:true
                    text:"["
                }
                HMILabel
                {
                    x: 609-34+12
                    y: 211-190-2
                    width: 30
                    height: 25
                    font.pixelSize:24
                    visible: col1=="1"?false:true
                    text:"]"
                }
                Image
                {
                    id:check
                    x: 615-34
                    y: 211-190
                    width: 18
                    height: 19
                    visible: false
                    source: "qrc:MATERIAL/MATERIAL_M8X_ICON_CLOSE"+bgImageStyle
                    onVisibleChanged:
                    {
                        if(changevisiblenum===true)
                        {
                            changevisiblenum=false
                            if(visible==true)
                            {
                                console.debug("-------mo ren visible------ ")
                                console.debug("getCarlinkMsgContactUserid =")
                                carlinkCtrl.getCarlinkMsgContactUserid(col1);
                                carlinkCtrl.setCurrentPhoneNum(col1);
                                carlinkCtrl.setCurrentPhoneName(col0);
                                carlinkCtrl.setContactsChecked(true);
                                console.debug("-------mo ren visible  jiesu------ ")
                            }
                        }

                    }
                }
                onPressed:
                {

                        if (curContactIndex != index)
                        {
                            curContactIndex = index
                        }

                }
                onClicked:
                {
                    console.debug("tututuuttu")

                    if(carlinkCtrl.contactsChecked==false)
                    {
                         console.debug("333333333333333333333333333")
                        if(check.visible==false)
                        {
                            console.debug("getCarlinkMsgContactUserid =")
                            check.visible=true
                            carlinkCtrl.getCarlinkMsgContactUserid(col1);
                            carlinkCtrl.setCurrentPhoneNum(col1);
                            carlinkCtrl.setCurrentPhoneName(col0);
                            carlinkCtrl.setContactsChecked(true);
                        }
                    }
                     else
                        {
                         if(check.visible==true)
                         {
                            check.visible=false
                             carlinkCtrl.clearCurrentPhoneNum();
                             carlinkCtrl.clearCurrentPhoneName();
                            carlinkCtrl.setContactsChecked(false);
                         }
                        }

                }
                }

        }

    }
    HMIButton
    {
        id:icon_Send
        x:60
        y:822-128
        width: 100
        height: 66
        labelText: "Send"
        btnImg:icon_Send.pressed?("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_3_P"+bgImageStyle)
                               :("qrc:MATERIAL/MATERIAL_M8X_FUNCTION_BUTTON_3"+bgImageStyle)
        onClicked:
        {
            carlinkCtrl.carLinkContactsMsgSend(newMsgInput.text)
            newMsgInput.text = ""
            ScreenManager.changeForm(Layout.FM_OPEN,WindowsList.CARLINK_CONTACTS_ALL_LIST)
        }
    }
    Column{
        x:695
        y:120
        id: firstRow
        //anchors{top:parent.top;topMargin:50}
        Repeater{
            model:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","#"]
            HMILabel{
                width:23
                height: 21//24
                font.pixelSize: 22
                color:aTozCurrent== qsTr(modelData)?"white":"gray"
                text:qsTr(modelData);
                HMIMouseArea{
                    anchors.fill: parent
                    onPressed: {
                        console.debug(modelData)
                        aTozCurrent = modelData
                        contact_people.positionViewAtIndex(carlinkCtrl.getCLInitialSearchIndex(aTozCurrent), ListView.Beginning)

                    }
                }


            }
        }
    }











}