diff options
Diffstat (limited to 'desktop/Prefs.qml')
| -rw-r--r-- | desktop/Prefs.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml index ef2ac72..0861258 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -84,6 +84,15 @@ Singleton { root.write(Object.assign({}, root.doc, { bootlogo: root.bootlogo })); } + // The island bar's settings (modules/island): the length a new event gets, + // and that its end keeps from the start, in minutes. + readonly property var islandDefaults: ({ eventMinutes: 60 }) + property var island: islandDefaults + function setIsland(changes) { + root.island = Object.assign({}, root.island, changes); + root.write(Object.assign({}, root.doc, { island: root.island })); + } + // The whole parsed object, so a write keeps keys this version does not // know about. property var doc: ({}) @@ -154,6 +163,11 @@ Singleton { const bl = parsed.bootlogo && typeof parsed.bootlogo === "object" && !Array.isArray(parsed.bootlogo) ? parsed.bootlogo : {}; root.bootlogo = Object.assign({}, root.bootlogoDefaults, bl); + const isl = parsed.island && typeof parsed.island === "object" ? parsed.island : {}; + root.island = { + eventMinutes: Number.isInteger(isl.eventMinutes) && isl.eventMinutes >= 5 && isl.eventMinutes <= 1440 + ? isl.eventMinutes : 60, + }; } FileView { |
