2013-12-15 21:08:15 +00:00
|
|
|
|
/*
|
2014-01-27 14:24:16 +00:00
|
|
|
|
* © Mikko Ahlroth 2013–2014
|
2013-12-15 21:08:15 +00:00
|
|
|
|
* SailTime is open source software. For licensing information, please check
|
|
|
|
|
* the LICENCE file.
|
|
|
|
|
*/
|
2013-12-12 21:08:36 +00:00
|
|
|
|
|
|
|
|
|
import QtQuick 2.0
|
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
|
import "../pages"
|
|
|
|
|
|
|
|
|
|
CoverBackground {
|
|
|
|
|
id: cover
|
|
|
|
|
property alias cover : cover
|
|
|
|
|
|
|
|
|
|
function updateCover(uptime) {
|
2014-02-11 14:13:57 +00:00
|
|
|
|
var strings = formatUptime(uptime.days, uptime.hours, uptime.minutes);
|
|
|
|
|
|
|
|
|
|
days.text = strings.days;
|
|
|
|
|
time.text = strings.hours + " " + strings.minutes;
|
|
|
|
|
load1.text = uptime.load1.toFixed(2);
|
|
|
|
|
load5.text = uptime.load5.toFixed(2);
|
|
|
|
|
load15.text = uptime.load15.toFixed(2);
|
2013-12-12 21:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
width: cover.width
|
|
|
|
|
spacing: Theme.paddingSmall
|
2014-02-04 13:05:22 +00:00
|
|
|
|
y: Theme.paddingLarge
|
2013-12-12 21:08:36 +00:00
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: days
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
text: "Refreshing..."
|
2014-02-04 13:05:22 +00:00
|
|
|
|
color: Theme.primaryColor
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
2013-12-12 21:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: time
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
text: ""
|
2014-02-04 13:05:22 +00:00
|
|
|
|
color: Theme.primaryColor
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
2013-12-12 21:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
|
x: Theme.paddingLarge
|
|
|
|
|
width: parent.width - Theme.paddingLarge * 2
|
|
|
|
|
horizontalAlignment: Qt.AlignCenter
|
|
|
|
|
color: Theme.highlightColor
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-04 13:05:22 +00:00
|
|
|
|
Row {
|
|
|
|
|
width: parent.width - Theme.paddingLarge * 2
|
2013-12-12 21:08:36 +00:00
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2014-02-04 13:05:22 +00:00
|
|
|
|
spacing: 15
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: "1"
|
|
|
|
|
color: Theme.secondaryColor
|
|
|
|
|
horizontalAlignment: Qt.AlignRight
|
|
|
|
|
width: parent.width / 4
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: load1
|
|
|
|
|
text: ""
|
|
|
|
|
color: Theme.primaryColor
|
|
|
|
|
horizontalAlignment: Qt.AlignLeft
|
|
|
|
|
width: 3 * parent.width / 4
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
|
|
|
|
}
|
2013-12-12 21:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-02-04 13:05:22 +00:00
|
|
|
|
Row {
|
|
|
|
|
width: parent.width - Theme.paddingLarge * 2
|
2013-12-12 21:08:36 +00:00
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2014-02-04 13:05:22 +00:00
|
|
|
|
spacing: 15
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: "5"
|
|
|
|
|
color: Theme.secondaryColor
|
|
|
|
|
horizontalAlignment: Qt.AlignRight
|
|
|
|
|
width: parent.width / 4
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: load5
|
|
|
|
|
text: ""
|
|
|
|
|
color: Theme.primaryColor
|
|
|
|
|
horizontalAlignment: Qt.AlignLeft
|
|
|
|
|
width: 3 * parent.width / 4
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Row {
|
|
|
|
|
width: parent.width - Theme.paddingLarge * 2
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
spacing: 15
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: "15"
|
|
|
|
|
color: Theme.secondaryColor
|
|
|
|
|
horizontalAlignment: Qt.AlignRight
|
|
|
|
|
width: parent.width / 4
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: load15
|
|
|
|
|
text: ""
|
|
|
|
|
color: Theme.primaryColor
|
|
|
|
|
horizontalAlignment: Qt.AlignLeft
|
|
|
|
|
width: 3 * parent.width / 4
|
|
|
|
|
font.family: Theme.fontFamilyHeading
|
|
|
|
|
}
|
2013-12-12 21:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CoverActionList {
|
|
|
|
|
id: coverAction
|
|
|
|
|
|
|
|
|
|
CoverAction {
|
|
|
|
|
iconSource: "image://theme/icon-cover-refresh"
|
|
|
|
|
onTriggered: updateDisplay()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|