Fix blanking screen and first localization
This commit is contained in:
41
qml/ScreenBlank.qml
Normal file
41
qml/ScreenBlank.qml
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
@ -35,6 +35,10 @@ import Pw.Unitoo.Backend 1.0
|
||||
import "pages"
|
||||
|
||||
ApplicationWindow {
|
||||
ScreenBlank {
|
||||
enabled: true
|
||||
}
|
||||
|
||||
BoxingTimer {
|
||||
id: boxingTimer
|
||||
}
|
||||
|
Reference in New Issue
Block a user