Merge pull request #2997 from Joern-R/WithingsAgain

Re-Introduce connection to Withings
This commit is contained in:
Joern
2019-01-13 19:49:11 +01:00
committed by GitHub
5 changed files with 7 additions and 7 deletions

View File

@@ -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;

View File

@@ -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();

View File

@@ -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"); }

View File

@@ -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());

View File

@@ -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: