Load settings when secondpage is instantiated to start timers on app start

This commit is contained in:
Mikko Ahlroth 2013-12-15 22:43:49 +02:00
parent fabd1c0c11
commit 75a2a113c4

View file

@ -14,7 +14,7 @@ Dialog {
property alias timerEnable : timerEnable
property alias refreshInterval : intervalSlider
onOpened: {
function getSettings() {
Storage.db = Storage.connect();
var setVal = Storage.readSetting(Storage.db, "interval", 15.0);
if (setVal !== undefined) {
@ -28,6 +28,17 @@ Dialog {
"timerEnable", false)
}
// Load values when app is started to start timers if needed
Component.onCompleted: {
getSettings();
changeTimer(timerEnable.checked);
changeInterval(intervalSlider.value);
}
onOpened: {
getSettings();
}
onAccepted: {
Storage.storeSetting(Storage.db,
"timerEnable",