Compare commits

...

7 Commits

Author SHA1 Message Date
Alejandro Martinez
a4e5157d40 Revert "Add ANT+ product info (#3307)" (#3309)
This reverts commit d7fce1565c.
2020-01-24 18:09:56 -03:00
thebaron06
d7fce1565c Add ANT+ product info (#3307)
Add the identification of Garmins HRM-Tri and their Powermeter Vector 3.
2020-01-24 18:03:55 -03:00
Mark Liversedge
525fcb0a66 3.5 BUILD INCREMENT
.. re-issue of 3.5 binaries with Strava API guideline compliance, as
   part of the 'rate limit' requirements.
2020-01-17 20:16:54 +00:00
Mark Liversedge
dc3ce7e365 Connect with Strava
.. the authorise button on the add cloud wizard now
   shows a 'Connect with Strava' icon

.. all other services continue to have a button that
   is labelled 'Authorise'

.. this is needed to comply with the Strava API application
   guidelines.
2020-01-17 17:42:40 +00:00
Mark Liversedge
3133cdab3b Compatible with Strava
.. logo added to the about box, only tested on hi-dpi display
   (may need scaling applied for lower resolution displays).
2020-01-17 17:42:23 +00:00
Mark Liversedge
cc91520e76 View on Strava
.. when data is downloaded from strava we now set the metadata
   tag "StravaID" to the id of the activity on Strava.

.. On RideSummary a link is added at the bottom to view the activity
   on Strava if the "StravaID" is set.

.. if the user clicks on the link the summary is replaced with the
   strava page for the ride:
      e.g. https://www.strava.com/activities/962515512

.. this is part of a couple of updates to comply with the Strava
   guidelines for consumption of the Strava v3 API, see:
      https://developers.strava.com/guidelines/
2020-01-17 17:42:12 +00:00
Mark Liversedge
372dd5c144 SEGV on Overview Chart
.. when no rides available on new user.

Fixes #3295
2020-01-13 20:24:44 +00:00
11 changed files with 44 additions and 3 deletions

View File

@@ -558,6 +558,8 @@ static const QStringList timeInZonesWBAL = QStringList()
void
Card::setData(RideItem *item)
{
if (item == NULL || item->ride() == NULL) return;
// use ride colors in painting?
ridecolor = item->color;

View File

@@ -1517,6 +1517,12 @@ RideSummaryWindow::htmlSummary()
summary += " <li>" + i.next();
summary += "</ul>";
}
// add link to view on Strava if was downloaded from there (StravaID will be set)
if (ridesummary && rideItem && rideItem->ride() && rideItem->ride()->getTag("StravaID","") != "") {
summary += "<a href=\"https://www.strava.com/activities/" + rideItem->ride()->getTag("StravaID","") + "\">View on Strava</a>";
}
summary += "<br></center>";
return summary;

View File

@@ -27,6 +27,7 @@
#include "OAuthDialog.h"
#include <QMessageBox>
#include <QPixmap>
#include <QRegExp>
// WIZARD FLOW
@@ -271,13 +272,15 @@ AddAuth::AddAuth(AddCloudWizard *parent) : QWizardPage(parent), wizard(parent)
pass = new QLineEdit(this);
pass->setEchoMode(QLineEdit::Password);
pass->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
auth = new QPushButton(tr("Authorise"), this);
auth->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
token = new QLabel(this);
token->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
message = new QLabel(this);
message->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
// is there an icon for the authorise button?
auth = new QPushButton(tr("Authorise"), this);
auth->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
// labels
comboLabel = new QLabel("");
urlLabel = new QLabel(tr("URL"));
@@ -367,6 +370,24 @@ AddAuth::initializePage()
// clone to do next few steps!
setSubTitle(QString(tr("%1 Credentials and authorisation")).arg(wizard->cloudService->uiName()));
// icon on the authorize button
if (wizard->cloudService && wizard->cloudService->authiconpath() != "") {
// scaling icon hack (193x48 is strava icon size)
QPixmap pix(wizard->cloudService->authiconpath());
QIcon authicon(pix.scaled(193*dpiXFactor, 48*dpiXFactor));
auth->setIconSize(QSize(193*dpiXFactor, 48*dpiYFactor));
// set the pushbutton
auth->setText("");
auth->setIcon(authicon);
} else {
// standard pushbutton (reset after used by strava)
auth->setText(tr("Authorise"));
auth->setIcon(QIcon());
}
// show all the widgets relevant for this service and update the value from the
// settings we have collected (which will have been defaulted).
QString cname;

View File

@@ -95,6 +95,9 @@ class CloudService : public QObject {
// need a logo, we may resize but will keep aspect ratio
virtual QImage logo() const = 0;
// an icon to put on the authorize button (mandated by strava guidelines)
virtual QString authiconpath() const { return QString(""); }
// register with capabilities of the service - emerging standard
// is a service that allows oauth, query and upload as well as download
enum { OAuth=0x01, UserPass=0x02, Upload=0x04, Download=0x08, Query=0x10} capa_;

View File

@@ -859,6 +859,9 @@ Strava::prepareResponse(QByteArray* data)
// 1s samples with start time
RideFile *ride = new RideFile(starttime.toUTC(), 1.0f);
// set strava id in metadata (to show where we got it from - to add View on Strava link in Summary view
if (!each["id"].isNull()) ride->setTag("StravaID", QString("%1").arg(each["id"].toVariant().toULongLong()));
// what sport?
if (!each["type"].isNull()) {
QString stype = each["type"].toString();

View File

@@ -45,6 +45,8 @@ class Strava : public CloudService {
//virtual int capabilities() const { return OAuth | Upload | Download | Query ; } // Default
QString authiconpath() const { return QString(":images/services/strava_connect.png"); }
// write a file
bool writeFile(QByteArray &data, QString remotename, RideFile *ride);

View File

@@ -98,6 +98,7 @@
// 3981 - V3.5 RC2
// 3982 - V3.5 RC2X
// 3990 - V3.5 RELEASE (January 2020)
// 3991 - V3.5 RELEASE RE-ISSUE STRAVA RATE LIMIT (January 2020)
#define VERSION3_BUILD 3010 // released
@@ -114,7 +115,7 @@
#define VERSION31_BUILD VERSION31_UPG
// the next two will with each build/release
#define VERSION_LATEST 3990
#define VERSION_LATEST 3991
#define VERSION_STRING "V3.5"
// default config for this release cycle

View File

@@ -75,6 +75,7 @@ AboutPage::AboutPage(Context *context) : context(context)
"<br>The core body temperature module was developed by the <br>"
"<a href=\"http://www.usariem.army.mil/\">U.S. Army Research Institute of Environmental Medicine</a>"
"<br> and is patent pending<br>"
"<br><img src=\":images/services/strava_compatible.png\"/><br>"
"</center>"
)
.arg(QString(QUrl::fromLocalFile(context->athlete->home->root().absolutePath()).toEncoded()))

View File

@@ -166,6 +166,8 @@
<file>images/configure.png</file>
<file>web/googlemap/dark.css</file>
<file>images/toolbar/cloud.png</file>
<file>images/services/strava_compatible.png</file>
<file>images/services/strava_connect.png</file>
<file>images/services/cyclinganalytics.png</file>
<file>images/services/dropbox.png</file>
<file>images/services/googledrive.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB