Load settings when secondpage is instantiated to start timers on app start
This commit is contained in:
parent
fabd1c0c11
commit
75a2a113c4
1 changed files with 12 additions and 1 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue