mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
Re-Introduce connection to Withings
... remove Nokia from Screens ... access Withings APIs
This commit is contained in:
@@ -37,7 +37,7 @@ BodyMeasuresDownload::BodyMeasuresDownload(Context *context) : context(context)
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||
|
||||
QGroupBox *groupBox1 = new QGroupBox(tr("Choose the download or import source"));
|
||||
downloadWithings = new QRadioButton(tr("Nokia Health (Withings)"));
|
||||
downloadWithings = new QRadioButton(tr("Withings"));
|
||||
downloadTP = new QRadioButton(tr("Today's Plan"));
|
||||
downloadCSV = new QRadioButton(tr("Import CSV file"));
|
||||
QVBoxLayout *vbox1 = new QVBoxLayout;
|
||||
|
||||
@@ -189,7 +189,7 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site, CloudService *service
|
||||
|
||||
} else if (site == WITHINGS) {
|
||||
|
||||
urlstr = QString("https://account.health.nokia.com/oauth2_user/authorize2?");
|
||||
urlstr = QString("https://account.withings.com/oauth2_user/authorize2?");
|
||||
urlstr.append("redirect_uri=http://www.goldencheetah.org&");
|
||||
urlstr.append("scope=user.info,user.metrics&");
|
||||
urlstr.append("response_type=code&");
|
||||
@@ -327,7 +327,7 @@ OAuthDialog::urlChanged(const QUrl &url)
|
||||
authheader = QString("%1:%1").arg("xert_public");
|
||||
} else if (site == WITHINGS) {
|
||||
|
||||
urlstr = QString("https://account.health.nokia.com/oauth2/token?");
|
||||
urlstr = QString("https://account.withings.com/oauth2/token?");
|
||||
params.addQueryItem("client_id", GC_NOKIA_CLIENT_ID);
|
||||
params.addQueryItem("client_secret", GC_NOKIA_CLIENT_SECRET);
|
||||
params.addQueryItem("redirect_uri","http://www.goldencheetah.org");
|
||||
@@ -629,7 +629,7 @@ OAuthDialog::networkRequestFinished(QNetworkReply *reply)
|
||||
|
||||
|
||||
|
||||
QString info = QString(tr("Withings/Nokia authorization was successful."));
|
||||
QString info = QString(tr("Withings authorization was successful."));
|
||||
QMessageBox information(QMessageBox::Information, tr("Information"), info);
|
||||
information.exec();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class Withings : public CloudService {
|
||||
CloudService *clone(Context *context) { return new Withings(context); }
|
||||
|
||||
QString id() const { return "Withings"; }
|
||||
QString uiName() const { return tr("Nokia Health (Withings)"); }
|
||||
QString uiName() const { return tr("Withings"); }
|
||||
QString description() const { return (tr("Download weight, body fat etc from the connected health specialists.")); }
|
||||
QImage logo() const { return QImage(":images/services/withings.png"); }
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ WithingsDownload::getBodyMeasures(QString &error, QDateTime from, QDateTime to,
|
||||
params.addQueryItem("enddate", QString::number(to.toMSecsSinceEpoch()/1000));
|
||||
|
||||
|
||||
QUrl url = QUrl( "https://api.health.nokia.com/measure?" + params.toString() );
|
||||
QUrl url = QUrl( "https://wbsapi.withings.net/measure?" + params.toString() );
|
||||
|
||||
printd("URL: %s\n", url.url().toStdString().c_str());
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Measure::getSourceDescription() const {
|
||||
case Measure::Manual:
|
||||
return tr("Manual entry");
|
||||
case Measure::Withings:
|
||||
return tr("Nokia Health (Withings)");
|
||||
return tr("Withings");
|
||||
case Measure::TodaysPlan:
|
||||
return tr("Today's Plan");
|
||||
case Measure::CSV:
|
||||
|
||||
Reference in New Issue
Block a user