|
[-]
[+]
|
Changed |
_service:tar_git:harbour-chargemon-0.5.6.tar.bz2/qml/pages/InfoPage.qml
^
|
@@ -4,12 +4,25 @@
*/
import QtQuick 2.0
import Sailfish.Silica 1.0
+import org.freedesktop.contextkit 1.0
Page
{
id: page
+ ContextProperty {
+ id: timeUntilFull
+ key: "Battery.TimeUntilFull"
+ value: 0
+ }
+
+ ContextProperty {
+ id: timeUntilLow
+ key: "Battery.TimeUntilLow"
+ value: 0
+ }
+
SilicaFlickable
{
anchors.fill: parent
@@ -26,6 +39,45 @@
{
title: "Other info"
}
+
+ Column
+ {
+ width: page.width
+ spacing: Theme.paddingSmall
+
+ SectionHeader
+ {
+ text: "Time until low"
+ }
+
+ Label
+ {
+ x: Theme.paddingLarge
+ text: new Date(timeUntilLow.value * 1000).toISOString().substr(11, 8)
+ color: Theme.primaryColor
+ font.pixelSize: Theme.fontSizeExtraLarge
+ }
+ }
+
+ Column
+ {
+ width: page.width
+ spacing: Theme.paddingSmall
+
+ SectionHeader
+ {
+ text: "Time until full"
+ }
+
+ Label
+ {
+ x: Theme.paddingLarge
+ text: new Date(timeUntilFull.value * 1000).toISOString().substr(11, 8)
+ color: Theme.primaryColor
+ font.pixelSize: Theme.fontSizeExtraLarge
+ }
+ }
+
Repeater
{
model: infolist
@@ -66,8 +118,6 @@
ListModel
{
id: infolist
- ListElement { title: "Time until low"; param: "time_until_low" }
- ListElement { title: "Time until full"; param: "time_until_full" }
ListElement { title: "Status"; param: "status" }
ListElement { title: "Charge type"; param: "charge_type" }
ListElement { title: "USB Connection type"; param: "type" }
|
@@ -33,9 +33,6 @@
emit logFileNameChanged();
- propertyTimeUntilFull.reset(new ContextProperty("Battery.TimeUntilFull", this));
- propertyTimeUntilLow.reset(new ContextProperty("Battery.TimeUntilLow", this));
-
QDBusConnection::sessionBus().connect("", "/com/jolla/lipstick", "com.jolla.lipstick", "coverstatus",
this, SLOT(handleCoverstatus(const QDBusMessage&)));
@@ -524,11 +521,6 @@
m_infoPage.insert("capacity_left", "Unknown");
}
- /* contextproperties */
-
- m_infoPage.insert("time_until_low", QDateTime::fromTime_t(propertyTimeUntilLow->value().toInt()).toUTC().toString("hh:mm:ss"));
- m_infoPage.insert("time_until_full", QDateTime::fromTime_t(propertyTimeUntilFull->value().toInt()).toUTC().toString("hh:mm:ss"));
-
emit infoPageChanged();
}
|