mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Manual Activity Wizard - Use normalized sport
The user may have other names configured for common sports
This commit is contained in:
@@ -97,7 +97,7 @@ ManualActivityWizard::done
|
|||||||
{
|
{
|
||||||
int finalResult = result;
|
int finalResult = result;
|
||||||
if (result == QDialog::Accepted) {
|
if (result == QDialog::Accepted) {
|
||||||
QString sport = field("sport").toString().trimmed();
|
QString sport = RideFile::sportTag(field("sport").toString().trimmed());
|
||||||
appsettings->setValue(GC_BIKESCOREDAYS, field("estimationDays").toInt());
|
appsettings->setValue(GC_BIKESCOREDAYS, field("estimationDays").toInt());
|
||||||
int eb = field("estimateBy").toInt();
|
int eb = field("estimateBy").toInt();
|
||||||
appsettings->setValue(GC_BIKESCOREMODE, eb == 0 ? "time" : (eb == 1 ? "dist" : "manual"));
|
appsettings->setValue(GC_BIKESCOREMODE, eb == 0 ? "time" : (eb == 1 ? "dist" : "manual"));
|
||||||
@@ -230,8 +230,6 @@ ManualActivityPageBasics::ManualActivityPageBasics
|
|||||||
setSubTitle(tr("Log your activity by entering the basic details of the session. Once finished, you can add your performance metrics on the next page."));
|
setSubTitle(tr("Log your activity by entering the basic details of the session. Once finished, you can add your performance metrics on the next page."));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool useMetricUnits = GlobalContext::context()->useMetricUnits;
|
|
||||||
bool metricSwimPace = appsettings->value(this, GC_SWIMPACE, GlobalContext::context()->useMetricUnits).toBool();
|
|
||||||
QLocale locale;
|
QLocale locale;
|
||||||
|
|
||||||
QDateEdit *dateEdit = new QDateEdit();
|
QDateEdit *dateEdit = new QDateEdit();
|
||||||
@@ -418,7 +416,7 @@ ManualActivityPageBasics::sportsChanged
|
|||||||
()
|
()
|
||||||
{
|
{
|
||||||
QString path(":images/material/summit.svg");
|
QString path(":images/material/summit.svg");
|
||||||
QString sport = field("sport").toString().trimmed();
|
QString sport = RideFile::sportTag(field("sport").toString().trimmed());
|
||||||
if (sport == "Bike") {
|
if (sport == "Bike") {
|
||||||
path = ":images/material/bike.svg";
|
path = ":images/material/bike.svg";
|
||||||
} else if (sport == "Run") {
|
} else if (sport == "Run") {
|
||||||
@@ -976,7 +974,7 @@ ManualActivityPageMetrics::updateVisibility
|
|||||||
()
|
()
|
||||||
{
|
{
|
||||||
bool workoutPlan = plan && field("woType").toInt() == 0;
|
bool workoutPlan = plan && field("woType").toInt() == 0;
|
||||||
QString sport = field("sport").toString().trimmed();
|
QString sport = RideFile::sportTag(field("sport").toString().trimmed());
|
||||||
bool useMetricUnits = GlobalContext::context()->useMetricUnits;
|
bool useMetricUnits = GlobalContext::context()->useMetricUnits;
|
||||||
bool showAveragePower = true;
|
bool showAveragePower = true;
|
||||||
bool showAverageCadence = true;
|
bool showAverageCadence = true;
|
||||||
@@ -1104,7 +1102,7 @@ void
|
|||||||
ManualActivityPageMetrics::updateEstimates
|
ManualActivityPageMetrics::updateEstimates
|
||||||
()
|
()
|
||||||
{
|
{
|
||||||
QString sport = field("sport").toString().trimmed();
|
QString sport = RideFile::sportTag(field("sport").toString().trimmed());
|
||||||
if ( plan
|
if ( plan
|
||||||
&& field("woType").toInt() == 0
|
&& field("woType").toInt() == 0
|
||||||
&& field("woFileType").toString().trimmed() == "erg") { // no estimation if planning a ergmode workout
|
&& field("woFileType").toString().trimmed() == "erg") { // no estimation if planning a ergmode workout
|
||||||
@@ -1262,7 +1260,7 @@ ManualActivityPageMetrics::getDurationDistance
|
|||||||
QTime durationField = field("duration").toTime();
|
QTime durationField = field("duration").toTime();
|
||||||
durationSeconds = durationField.hour() * 3600 + durationField.minute() * 60.0 + durationField.second();
|
durationSeconds = durationField.hour() * 3600 + durationField.minute() * 60.0 + durationField.second();
|
||||||
|
|
||||||
QString sport = field("sport").toString().trimmed();
|
QString sport = RideFile::sportTag(field("sport").toString().trimmed());
|
||||||
bool useMetricUnits = GlobalContext::context()->useMetricUnits;
|
bool useMetricUnits = GlobalContext::context()->useMetricUnits;
|
||||||
if (sport == "Run") {
|
if (sport == "Run") {
|
||||||
useMetricUnits = appsettings->value(this, GC_PACE, GlobalContext::context()->useMetricUnits).toBool();
|
useMetricUnits = appsettings->value(this, GC_PACE, GlobalContext::context()->useMetricUnits).toBool();
|
||||||
@@ -1339,7 +1337,7 @@ void
|
|||||||
ManualActivityPageSummary::initializePage
|
ManualActivityPageSummary::initializePage
|
||||||
()
|
()
|
||||||
{
|
{
|
||||||
QString sport = field("sport").toString().trimmed();
|
QString sport = RideFile::sportTag(field("sport").toString().trimmed());
|
||||||
bool useMetricUnits = true;
|
bool useMetricUnits = true;
|
||||||
double metricFactorKM = 1.0;
|
double metricFactorKM = 1.0;
|
||||||
double metricFactorM = 1.0;
|
double metricFactorM = 1.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user