import com.nokia.extras 1.1
import QtCamera 1.0
import CameraPlus 1.0
-import QtMobility.systeminfo 1.2
+import QtMobility.systeminfo 1.2 as Qtm
import QtMobility.location 1.2
// TODO: flash not ready (battery low or flash not ready message)
camera: cam
}
- DeviceInfo {
+ Qtm.DeviceInfo {
id: deviceInfo
}
path: fileNaming.path
}
+ BatteryInfo {
+ id: batteryMonitor
+ active: cam.running
+
+ function check() {
+ if (!checkBattery()) {
+ pageStack.currentPage.batteryLow();
+ }
+ }
+
+ onChargingChanged: {
+ batteryMonitor.check();
+ }
+
+ onCriticalChanged: {
+ batteryMonitor.check();
+ }
+ }
+
function replacePage(file) {
pageStack.replace(Qt.resolvedUrl(file), {cam: cam, dimmer: root.dimmer}, true);
}
pageStack.push(Qt.resolvedUrl(file), {cam: cam, dimmer: root.dimmer}, true);
}
+ function checkBattery() {
+ // We are fine if we are connected to the charger:
+ if (batteryMonitor.charging) {
+ return true;
+ }
+
+ // If we have enough battery then we are fine:
+ if (!batteryMonitor.critical) {
+ return true;
+ }
+
+ return false;
+ }
+
platformStyle: PageStackWindowStyle {
cornersVisible: false
background: ""