Skip to content

Commit

Permalink
alarm info wasn't checked at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Jul 26, 2018
1 parent e43d926 commit 4f17cda
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions gui/noson.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}
}
Expand Down Expand Up @@ -378,7 +383,10 @@ ApplicationWindow {
}

onZoneChanged: {
alarmEnabled = isAlarmEnabled();
// Some tasks are already launched during startup
if (!startup) {
alarmEnabled = isAlarmEnabled();
}
}

////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 4f17cda

Please sign in to comment.