From 4f17cda0ddd74437cdc93837f70da49bdc0f3294 Mon Sep 17 00:00:00 2001 From: janbar Date: Fri, 27 Jul 2018 00:23:59 +0200 Subject: [PATCH] alarm info wasn't checked at startup --- gui/noson.qml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gui/noson.qml b/gui/noson.qml index eca4b900..459baac6 100644 --- a/gui/noson.qml +++ b/gui/noson.qml @@ -125,6 +125,7 @@ ApplicationWindow { property string appName: "Noson" property int debugLevel: 1 property bool playOnStart: false + property bool startup: true // Property to store the state of an application (active or suspended) property bool applicationState: Qt.application.active @@ -238,12 +239,16 @@ ApplicationWindow { customdebug("Reloading the zone ..."); if (connectZone(currentZone)) { Sonos.runLoader(); - // handle play on startup - if (playOnStart) { - playOnStart = false; - if (player.playStream(inputStreamUrl, "")) { - tabs.pushNowPlaying(); + // Completing startup + if (startup) { + startup = false; + if (playOnStart) { + if (player.playStream(inputStreamUrl, "")) { + tabs.pushNowPlaying(); + } } + // check for enabled alarm + alarmEnabled = isAlarmEnabled(); } } } @@ -378,7 +383,10 @@ ApplicationWindow { } onZoneChanged: { - alarmEnabled = isAlarmEnabled(); + // Some tasks are already launched during startup + if (!startup) { + alarmEnabled = isAlarmEnabled(); + } } ////////////////////////////////////////////////////////////////////////////