Fix blanking screen and first localization

This commit is contained in:
2019-08-27 13:07:07 +02:00
parent fcd87e366b
commit 23d2f8aa0c
11 changed files with 215 additions and 143 deletions

41
qml/ScreenBlank.qml Normal file
View File

@ -0,0 +1,41 @@
import QtQuick 2.0
import Nemo.DBus 2.0
Item {
property bool enabled: false
function request(){
var method = "req_display"+(enabled?"":"_cancel")+"_blanking_pause";
console.log('screen blank:', enabled, method);
dbif.call(method, [])
}
onEnabledChanged: {
request();
}
DBusInterface {
id: dbif
service: "com.nokia.mce"
path: "/com/nokia/mce/request"
iface: "com.nokia.mce.request"
bus: DBusInterface.SystemBus
}
Timer { //request seems to time out after a while:
running: parent.enabled
interval: 15000 //minimum setting for blank display is 15s
repeat: true
onTriggered: {
if(parent.enabled) {
parent.request()
}
}
}
Component.onDestruction: {
if(enabled){
enabled=false
}
}
}

View File

@ -35,6 +35,10 @@ import Pw.Unitoo.Backend 1.0
import "pages"
ApplicationWindow {
ScreenBlank {
enabled: true
}
BoxingTimer {
id: boxingTimer
}