This repository has been archived by the owner on Jan 28, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
System.qml
executable file
·158 lines (138 loc) · 4.63 KB
/
System.qml
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
import QtQuick 2.11
import QtQuick.Controls 2.5
import Launcher 1.0
import "qrc:/basic_ui" as BasicUI
Item {
width: parent.width
height: header.height + section.height + 20
Launcher {
id: settingsLauncher
}
Timer {
id: timer
running: false
repeat: true
interval: 10000
triggeredOnStart: true
onTriggered: {
uptimeValue.text = settingsLauncher.launch("/usr/bin/yio-remote/uptime.sh").trim();
temperatureValue.text = parseInt(settingsLauncher.launch("cat /sys/class/thermal/thermal_zone0/temp"))/1000 + "ºC";
}
}
Component.onCompleted: timer.start()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SYSTEM
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Text {
id: header
color: colorText
text: qsTr("System") + translateHandler.emptyString
anchors.left: parent.left
font.family: "Open Sans"
font.weight: Font.Normal
font.pixelSize: 27
lineHeight: 1
}
Rectangle {
id: section
width: parent.width
height: childrenRect.height + 40
radius: cornerRadius
color: colorDark
anchors.top: header.bottom
anchors.topMargin: 20
Text {
id: uptimeText
color: colorText
text: qsTr("Uptime") + translateHandler.emptyString
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 20
font.family: "Open Sans"
font.weight: Font.Normal
font.pixelSize: 27
lineHeight: 1
}
Text {
id: uptimeValue
color: colorText
text: "0h"
horizontalAlignment: Text.AlignRight
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: uptimeText.verticalCenter
font.family: "Open Sans"
font.weight: Font.Normal
font.pixelSize: 27
lineHeight: 1
}
Rectangle {
id: line7
width: parent.width
height: 2
color: colorBackground
anchors.top: uptimeText.bottom
anchors.topMargin: 20
}
Text {
id: temperatureText
color: colorText
text: qsTr("CPU temperature") + translateHandler.emptyString
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: line7.bottom
anchors.topMargin: 20
font.family: "Open Sans"
font.weight: Font.Normal
font.pixelSize: 27
lineHeight: 1
}
Text {
id: temperatureValue
color: colorText
text: "36ºC"
horizontalAlignment: Text.AlignRight
anchors.right: parent.right
anchors.rightMargin: 20
anchors.verticalCenter: temperatureText.verticalCenter
font.family: "Open Sans"
font.weight: Font.Normal
font.pixelSize: 27
lineHeight: 1
}
Rectangle {
id: line8
width: parent.width
height: 2
color: colorBackground
anchors.top: temperatureText.bottom
anchors.topMargin: 20
}
BasicUI.CustomButton {
id: buttonReboot
buttonText: qsTr("Reboot") + translateHandler.emptyString
anchors.top: line8.bottom
anchors.topMargin: 30
anchors.left: parent.left
anchors.leftMargin: (parent.width - (buttonReboot.width + buttonShutdown.width + 40))/2
mouseArea.onClicked: {
settingsLauncher.launch("fbv -d 1 /bye.png")
console.debug("now reboot")
settingsLauncher.launch("reboot");
}
}
BasicUI.CustomButton {
id: buttonShutdown
buttonText: qsTr("Shutdown") + translateHandler.emptyString
anchors.top: line8.bottom
anchors.topMargin: 30
anchors.left: buttonReboot.right
anchors.leftMargin: 40
mouseArea.onClicked: {
loadingScreen.source = "qrc:/basic_ui/ClosingScreen.qml";
loadingScreen.active = true;
}
}
}
}