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
|
import QtQuick 2.0
import QtSystemInfo 5.0
import Ubuntu.Components 1.1
import "../components"
Tab {
title: i18n.tr("Device Info")
page: Page {
Column {
spacing: units.gu(1)
InfoText { text: "Manufacturer: " + devinfo.manufacturer() }
InfoText { text: "Product name: " + devinfo.productName() }
InfoText { text: "Model: " + devinfo.model() }
InfoText { text: "Unique device ID: " + devinfo.uniqueDeviceID() }
InfoText { text: "OS version: " + devinfo.version(DeviceInfo.Os) }
InfoText { text: "Firmware version: " + devinfo.version(DeviceInfo.Firmware) }
InfoText { text: "IMEI :" + devinfo.imei(0) }
InfoText { text: "Thermal state: " + getThermal(devinfo.thermalState) }
InfoText { text: "Capabilities: " }
InfoText { text: " Bluetooth: " + checkCapability(DeviceInfo.BluetoothFeature) }
InfoText { text: " Camera: " + checkCapability(DeviceInfo.CameraFeature) }
InfoText { text: " Vibration: " + checkCapability(DeviceInfo.VibrationFeature) }
InfoText { text: " SIM: " + checkCapability(DeviceInfo.SimFeature) }
InfoText { text: " GPS: " + checkCapability(DeviceInfo.PositioningFeature) }
InfoText { text: " Haptics: " + checkCapability(DeviceInfo.HapticsFeature) }
InfoText { text: " NFC: " + checkCapability(DeviceInfo.NfcFeature) }
}
}
function checkCapability(feature)
{
if(devinfo.hasFeature(feature))
{
return "yes"
}
return "no"
}
function getThermal(state) {
switch(state)
{
case DeviceInfo.UnknownThermal: return "unknown"
case DeviceInfo.NormalThermal: return "normal"
case DeviceInfo.WarningThermal: return "warning"
case DeviceInfo.AlertThermal: return "alert"
case DeviceInfo.ErrorThermal: return "error"
}
}
DeviceInfo {
id: devinfo;
}
}
|