~feng-kylin/youker-assistant/youker-assistant

« back to all changes in this revision

Viewing changes to qml/func/info/NICInfo.qml

  • Committer: kobe
  • Date: 2015-02-13 07:37:10 UTC
  • Revision ID: xiangli@ubuntukylin.com-20150213073710-0jyp02ilyi5njj10
Qt Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; version 3.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 */
16
 
 
17
 
import QtQuick 1.1
18
 
import "../common" as Common
19
 
import "../bars" as Bars
20
 
import "../common/InfoGroup.js" as InfoGroup
21
 
 
22
 
Rectangle {
23
 
    id: home; width: parent.width; height: 476
24
 
 
25
 
    property int fontSize: 14
26
 
    property string homepath
27
 
    Component.onCompleted: {
28
 
        home.homepath = sessiondispatcher.getHomePath();
29
 
    }
30
 
 
31
 
//    Component.onCompleted: {
32
 
    function init_data() {
33
 
        systemdispatcher.get_networkcard_info_qt();//获取详细信息
34
 
        var netName = systemdispatcher.getHWSingleInfo("NetVendor", "networkcard");
35
 
        logo.source = InfoGroup.judgeName(netName.toUpperCase()) ? (home.homepath + "/.cache/youker-assistant/uk-img/Manufacturer/" + netName.toUpperCase() + ".jpg") : ("../../img/toolWidget/ubuntukylin.png");
36
 
 
37
 
        modelText.text = systemdispatcher.getHWSingleInfo("NetProduct", "networkcard");
38
 
        vendorText.text = netName;
39
 
        driverText.text = systemdispatcher.getHWSingleInfo("NetDrive", "networkcard");
40
 
        busText.text = systemdispatcher.getHWSingleInfo("NetBusinfo", "networkcard");
41
 
        deviceText.text = systemdispatcher.getHWSingleInfo("NetLogicalname", "networkcard");
42
 
        ipText.text = systemdispatcher.getHWSingleInfo("NetIp", "networkcard");
43
 
        macText.text = systemdispatcher.getHWSingleInfo("NetSerial", "networkcard");
44
 
        linkText.text = systemdispatcher.getHWSingleInfo("NetLink", "networkcard");
45
 
        maxText.text = systemdispatcher.getHWSingleInfo("NetCapacity", "networkcard") + " Mbit/s";
46
 
 
47
 
        var wnetName = systemdispatcher.getHWSingleInfo("WlanVendor", "networkcard");
48
 
        wlogo.source = InfoGroup.judgeName(wnetName.toUpperCase()) ? (home.homepath + "/.cache/youker-assistant/uk-img/Manufacturer/" + wnetName.toUpperCase() + ".jpg") : ("../../img/toolWidget/ubuntukylin.png");
49
 
        wdriverText.text = systemdispatcher.getHWSingleInfo("WlanDrive", "networkcard");
50
 
        wvendorText.text = wnetName;
51
 
        wmodelText.text = systemdispatcher.getHWSingleInfo("WlanProduct", "networkcard");
52
 
        wbusText.text = systemdispatcher.getHWSingleInfo("WlanBusinfo", "networkcard");
53
 
        wdeviceText.text = systemdispatcher.getHWSingleInfo("WlanLogicalname", "networkcard");
54
 
        wmacText.text = systemdispatcher.getHWSingleInfo("WlanSerial", "networkcard");
55
 
        wipText.text = systemdispatcher.getHWSingleInfo("WlanIp", "networkcard");
56
 
    }
57
 
 
58
 
    Connections
59
 
    {
60
 
        target: sessiondispatcher
61
 
        onTellDetailPageUpdateData: {
62
 
            if (infoFlag == "networkcard") {
63
 
                home.init_data();
64
 
            }
65
 
        }
66
 
    }
67
 
 
68
 
    Common.ScrollArea {
69
 
        frame:false
70
 
        anchors.left: parent.left
71
 
        anchors.top: parent.top
72
 
        anchors.topMargin: 30
73
 
        height: parent.height - 40
74
 
        width: parent.width
75
 
        Column {
76
 
            anchors {
77
 
                top: parent.top
78
 
                topMargin: 10
79
 
                left: parent.left
80
 
                leftMargin: 30
81
 
            }
82
 
            spacing: 18
83
 
 
84
 
            Row {
85
 
                Common.Label {
86
 
                    id: basictitle
87
 
                    text: qsTr("NIC Info")//有线网卡信息
88
 
                    font.bold: true
89
 
                    font.pixelSize: 14
90
 
                    color: "#383838"
91
 
                }
92
 
                Common.Separator {
93
 
                    anchors.verticalCenter: parent.verticalCenter
94
 
                    width: home.width - basictitle.width - 30 * 2
95
 
                }
96
 
            }
97
 
 
98
 
            Column {
99
 
                anchors.left: parent.left
100
 
                anchors.leftMargin: 20
101
 
                spacing: 10
102
 
                Row {
103
 
                    spacing: 10
104
 
                    Common.Label {
105
 
                        text: qsTr("NIC Model:")//有线网卡型号:
106
 
                        font.pixelSize: home.fontSize
107
 
                        color: "#7a7a7a"
108
 
                        width: 150
109
 
                    }
110
 
                    Text {
111
 
                        id: modelText
112
 
                        width: 450
113
 
                        wrapMode: Text.WordWrap
114
 
                        text: ""//systemdispatcher.getHWSingleInfo("NetProduct")
115
 
                        font.pixelSize: home.fontSize
116
 
                        color: "#7a7a7a"
117
 
                    }
118
 
                }
119
 
                Row {
120
 
                    spacing: 10
121
 
                    Common.Label {
122
 
                        text: qsTr("Vendor:")//制造商:
123
 
                        font.pixelSize: home.fontSize
124
 
                        color: "#7a7a7a"
125
 
                        width: 150
126
 
                    }
127
 
                    Text {
128
 
                        id: vendorText
129
 
                        text: ""
130
 
                        font.pixelSize: home.fontSize
131
 
                        color: "#7a7a7a"
132
 
                    }
133
 
                }
134
 
                Row {
135
 
                    spacing: 10
136
 
                    Common.Label {
137
 
                        text: qsTr("NIC Driver:")//有线网卡驱动:
138
 
                        font.pixelSize: home.fontSize
139
 
                        color: "#7a7a7a"
140
 
                        width: 150
141
 
                    }
142
 
                    Text {
143
 
                        id: driverText
144
 
                        text: ""
145
 
                        font.pixelSize: home.fontSize
146
 
                        color: "#7a7a7a"
147
 
                    }
148
 
                }
149
 
                Row {
150
 
                    spacing: 10
151
 
                    Common.Label {
152
 
                        text: qsTr("Bus Address:")//总线地址:
153
 
                        font.pixelSize: home.fontSize
154
 
                        color: "#7a7a7a"
155
 
                        width: 150
156
 
                    }
157
 
                    Text {
158
 
                        id: busText
159
 
                        text: ""
160
 
                        font.pixelSize: home.fontSize
161
 
                        color: "#7a7a7a"
162
 
                    }
163
 
                }
164
 
                Row {
165
 
                    spacing: 10
166
 
                    Common.Label {
167
 
                        text: qsTr("Device Name:")//设备名称:
168
 
                        font.pixelSize: home.fontSize
169
 
                        color: "#7a7a7a"
170
 
                        width: 150
171
 
                    }
172
 
                    Text {
173
 
                        id: deviceText
174
 
                        text: ""
175
 
                        font.pixelSize: home.fontSize
176
 
                        color: "#7a7a7a"
177
 
                    }
178
 
                }
179
 
                Row {
180
 
                    spacing: 10
181
 
                    Common.Label {
182
 
                        text: qsTr("IP Address:")//IP地址:
183
 
                        font.pixelSize: home.fontSize
184
 
                        color: "#7a7a7a"
185
 
                        width: 150
186
 
                    }
187
 
                    Text {
188
 
                        id: ipText
189
 
                        text: ""
190
 
                        font.pixelSize: home.fontSize
191
 
                        color: "#7a7a7a"
192
 
                    }
193
 
                }
194
 
                Row {
195
 
                    spacing: 10
196
 
                    Common.Label {
197
 
                        text: qsTr("Mac Address:")//MAC地址:
198
 
                        font.pixelSize: home.fontSize
199
 
                        color: "#7a7a7a"
200
 
                        width: 150
201
 
                    }
202
 
                    Text {
203
 
                        id: macText
204
 
                        text: ""
205
 
                        font.pixelSize: home.fontSize
206
 
                        color: "#7a7a7a"
207
 
                    }
208
 
                }
209
 
                Row {
210
 
                    spacing: 10
211
 
                    Common.Label {
212
 
                        text: qsTr("Connection Status: ")//连接状态:
213
 
                        font.pixelSize: home.fontSize
214
 
                        color: "#7a7a7a"
215
 
                        width: 150
216
 
                    }
217
 
                    Text {
218
 
                        id: linkText
219
 
                        text: ""
220
 
                        font.pixelSize: home.fontSize
221
 
                        color: "#7a7a7a"
222
 
                    }
223
 
                }
224
 
                Row {
225
 
                    spacing: 10
226
 
                    Common.Label {
227
 
                        text: qsTr("Max Bandwidth: ")//最大带宽:
228
 
                        font.pixelSize: home.fontSize
229
 
                        color: "#7a7a7a"
230
 
                        width: 150
231
 
                    }
232
 
                    Text {
233
 
                        id: maxText
234
 
                        text: ""
235
 
                        font.pixelSize: home.fontSize
236
 
                        color: "#7a7a7a"
237
 
                    }
238
 
                }
239
 
            }
240
 
            Row {
241
 
                visible: (wmodelText.text != "" && wvendorText.text != "") ? true:false
242
 
                Common.Label {
243
 
                    id: biostitle
244
 
                    text: qsTr("WLan NIC Info")//无线网卡信息
245
 
                    font.bold: true
246
 
                    font.pixelSize: 14
247
 
                    color: "#383838"
248
 
                }
249
 
                Common.Separator {
250
 
                    id: splitbar
251
 
                    anchors.verticalCenter: parent.verticalCenter
252
 
                    width: home.width - biostitle.width - 30 * 2
253
 
                }
254
 
            }
255
 
            Column {
256
 
                anchors.left: parent.left
257
 
                anchors.leftMargin: 20
258
 
                spacing: 10
259
 
                Row {
260
 
                    spacing: 10
261
 
                    visible: wmodelText.text ? true:false
262
 
                    Common.Label {
263
 
                        text: qsTr("WLan NIC Model:")//网卡型号:
264
 
                        font.pixelSize: home.fontSize
265
 
                        color: "#7a7a7a"
266
 
                        width: 150
267
 
                    }
268
 
                    Text {
269
 
                        id: wmodelText
270
 
                        width: 450
271
 
                        wrapMode: Text.WordWrap
272
 
                        text: ""
273
 
                        font.pixelSize: home.fontSize
274
 
                        color: "#7a7a7a"
275
 
                    }
276
 
                }
277
 
                Row {
278
 
                    spacing: 10
279
 
                    visible: wvendorText.text ? true:false
280
 
                    Common.Label {
281
 
                        text: qsTr("Vendor:")//制造商:
282
 
                        font.pixelSize: home.fontSize
283
 
                        color: "#7a7a7a"
284
 
                        width: 150
285
 
                    }
286
 
                    Text {
287
 
                        id: wvendorText
288
 
                        text: ""
289
 
                        font.pixelSize: home.fontSize
290
 
                        color: "#7a7a7a"
291
 
                    }
292
 
                }
293
 
                Row {
294
 
                    spacing: 10
295
 
                    visible: wdriverText.text ? true:false
296
 
                    Common.Label {
297
 
                        text: qsTr("WLan NIC Driver:")//无线网卡驱动:
298
 
                        font.pixelSize: home.fontSize
299
 
                        color: "#7a7a7a"
300
 
                        width: 150
301
 
                    }
302
 
                    Text {
303
 
                        id: wdriverText
304
 
                        text: ""
305
 
                        font.pixelSize: home.fontSize
306
 
                        color: "#7a7a7a"
307
 
                    }
308
 
                }
309
 
                Row {
310
 
                    spacing: 10
311
 
                    visible: wbusText.text ? true:false
312
 
                    Common.Label {
313
 
                        text: qsTr("Bus Address:")//总线地址:
314
 
                        font.pixelSize: home.fontSize
315
 
                        color: "#7a7a7a"
316
 
                        width: 150
317
 
                    }
318
 
                    Text {
319
 
                        id: wbusText
320
 
                        text: ""
321
 
                        font.pixelSize: home.fontSize
322
 
                        color: "#7a7a7a"
323
 
                    }
324
 
                }
325
 
                Row {
326
 
                    spacing: 10
327
 
                    visible: wdeviceText.text ? true:false
328
 
                    Common.Label {
329
 
                        text: qsTr("Device Name:")//设备名称:
330
 
                        font.pixelSize: home.fontSize
331
 
                        color: "#7a7a7a"
332
 
                        width: 150
333
 
                    }
334
 
                    Text {
335
 
                        id: wdeviceText
336
 
                        text: ""
337
 
                        font.pixelSize: home.fontSize
338
 
                        color: "#7a7a7a"
339
 
                    }
340
 
                }
341
 
 
342
 
                Row {
343
 
                    spacing: 10
344
 
                    visible: wipText.text ? true:false
345
 
                    Common.Label {
346
 
                        text: qsTr("IP Address:")//IP地址:
347
 
                        font.pixelSize: home.fontSize
348
 
                        color: "#7a7a7a"
349
 
                        width: 150
350
 
                    }
351
 
                    Text {
352
 
                        id: wipText
353
 
                        text: ""
354
 
                        font.pixelSize: home.fontSize
355
 
                        color: "#7a7a7a"
356
 
                    }
357
 
                }
358
 
                Row {
359
 
                    spacing: 10
360
 
                    height: 40
361
 
                    visible: wmacText.text ? true:false
362
 
                    Common.Label {
363
 
                        text: qsTr("Serial Number: ")//序列号:
364
 
                        font.pixelSize: home.fontSize
365
 
                        color: "#7a7a7a"
366
 
                        width: 150
367
 
                    }
368
 
                    Text {
369
 
                        id: wmacText
370
 
                        text: ""
371
 
                        font.pixelSize: home.fontSize
372
 
                        color: "#7a7a7a"
373
 
                    }
374
 
                }
375
 
            }
376
 
        }
377
 
        //logo
378
 
        Image {
379
 
            id: logo
380
 
            source: ""
381
 
            opacity: 0.5
382
 
            anchors {
383
 
                top: parent.top
384
 
                topMargin: 65
385
 
                left: parent.left
386
 
                leftMargin: 570
387
 
            }
388
 
        }
389
 
        //logo
390
 
        Image {
391
 
            id: wlogo
392
 
            visible: (wmodelText.text != "" && wvendorText.text != "") ? true:false
393
 
            opacity: 0.5
394
 
            source: ""
395
 
            anchors {
396
 
                top: parent.top
397
 
                topMargin: (wmodelText.text != "" && wvendorText.text != "") ? 385 : 0
398
 
                left: parent.left
399
 
                leftMargin: 570
400
 
            }
401
 
        }
402
 
    }
403
 
}