From e9dd189864d728fdd67646a67dca785da2e37c32 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Wed, 11 May 2016 11:26:45 -0300 Subject: [PATCH 1/2] Fallback to Start with Cycling HR zones for Running When there is no Running HR zones defined to easy transition from current config. Fixes #1958 --- src/Core/Athlete.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Core/Athlete.cpp b/src/Core/Athlete.cpp index 8eadc51f1..b8e19a001 100644 --- a/src/Core/Athlete.cpp +++ b/src/Core/Athlete.cpp @@ -115,6 +115,11 @@ Athlete::Athlete(Context *context, const QDir &homeDir) } else if (! hrzones_[i]->warningString().isEmpty()) { QMessageBox::warning(context->mainWindow, tr("Reading HR Zones File %1").arg(hrzones_[i]->fileName()), hrzones_[i]->warningString()); } + } else if (i == 1) { // No running HR zones + // Start with Cycling HR zones for backward compatibilty + QFile hrzonesFile(home->config().canonicalPath() + "/" + hrzones_[0]->fileName()); + // Load without error/warning report to avoid repetition + if (hrzonesFile.exists()) hrzones_[i]->read(hrzonesFile); } } From 939af6c0efcabb28214b46326fdd5d5a0d971eb2 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Wed, 11 May 2016 11:42:37 -0300 Subject: [PATCH 2/2] Fallback to Start with Cycling Power zones for Running When there is no Running Power zones defined to easy transition from current config. --- src/Core/Athlete.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Core/Athlete.cpp b/src/Core/Athlete.cpp index b8e19a001..8b80dd6c5 100644 --- a/src/Core/Athlete.cpp +++ b/src/Core/Athlete.cpp @@ -102,6 +102,11 @@ Athlete::Athlete(Context *context, const QDir &homeDir) } else if (! zones_[i]->warningString().isEmpty()) { QMessageBox::warning(context->mainWindow, tr("Reading Zones File %1").arg(zones_[i]->fileName()), zones_[i]->warningString()); } + } else if (i == 1) { // No running Power zones + // Start with Cycling Power zones for backward compatibilty + QFile zonesFile(home->config().canonicalPath() + "/" + zones_[0]->fileName()); + // Load without error/warning report to avoid repetition + if (zonesFile.exists()) zones_[i]->read(zonesFile); } }