123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- From dc3ce7e365dcfbf8089b643e1fa4e4cd88dc9d6d Mon Sep 17 00:00:00 2001
- From: Mark Liversedge <liversedge@gmail.com>
- Date: Fri, 17 Jan 2020 16:04:27 +0000
- Subject: 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.
- diff --git a/src/Cloud/AddCloudWizard.cpp b/src/Cloud/AddCloudWizard.cpp
- index db1aea7f1..6deb107bd 100644
- --- a/src/Cloud/AddCloudWizard.cpp
- +++ b/src/Cloud/AddCloudWizard.cpp
- @@ -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;
- diff --git a/src/Cloud/CloudService.h b/src/Cloud/CloudService.h
- index b9c14c90c..95ebcc5ec 100644
- --- a/src/Cloud/CloudService.h
- +++ b/src/Cloud/CloudService.h
- @@ -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_;
- diff --git a/src/Cloud/Strava.h b/src/Cloud/Strava.h
- index 1c51a5da4..45ee2f57c 100644
- --- a/src/Cloud/Strava.h
- +++ b/src/Cloud/Strava.h
- @@ -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);
-
- diff --git a/src/Resources/application.qrc b/src/Resources/application.qrc
- index 3fae9b8da..86fbdf032 100644
- --- a/src/Resources/application.qrc
- +++ b/src/Resources/application.qrc
- @@ -167,6 +167,7 @@
- <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>
- diff --git a/src/Resources/images/services/strava_connect.png b/src/Resources/images/services/strava_connect.png
- new file mode 100644
- index 000000000..868c433da
- --- /dev/null
- +++ b/src/Resources/images/services/strava_connect.png
- @@ -0,0 +1,15 @@
- +‰PNG
- +
- +
IHDR Á 0 ¨Œ sRGB ®Îé
IDATxí\w�UÕÿ�G]H‘ªK�’¡
- +d�" # %H� þa21[âÄh2š0ÎDM4ÑŒè$CÆ1F:„DIè½÷Þé½/{O¾ß÷ö\î»»”Çîf²/ç›y{O»çžóÝï÷µ{ïž<<<<<<<þ¯9`b»g=ú‹uûªç@‰æ€•ÕGº™Ò±-™}ûö
¨S§ÎïJ•*U'Öç«ž%š¹¹¹_ =•��=Q6B0(Å-A™œœœ½¥K—®íø£ç@&qàÊ•+Ë”)SOö”ãöA–µö¼ëôGÏ�Lä€1¦‚ìë‚Û[ÂòŽqPĺ}Õs #8�"çqdÄý&<Òá€A:Üòc3’y[ý¦Òá€A:Üòc3’y[ý¦Òá€A:Üòc3’y[ý¦Òá€A:Üòc3’y[ý¦Òá€A:Üòc3’ñ·H3r“ÿK›:}ú4.^¼ˆš5k^sYAàèÑ£¨X±"*Tàk.7I;VÁîÝ œ:Ô¨S§1�Ý(Søjppç�'ʪdUŽ•lù¯5ëÕïÈßçZä<»b&̃�É€=²G;!sËüŽdŸXó…«µ\óª «Mî»ÚWŒ¥bÁñãDZxñb9ròV*êÕ«‡öíÛ£\9¹!%ˆ>ŒòåË£råÊE²ê•+WbëÖxâ‰'�H$pùòe�WÕªUCÙ²eõçÎ�äI“СC´nÝúÆ×=²Á[�Á®™�o¬©VfèËÀá=þúZ¾þxƒ©×¦Q[ÿú0ÞÖÍÝí‘øÞ»@£{Â6W°Ÿ½»àS˜FjSðjØœKZNy føÏÝPØ9!xstX/õ«
- +‚à/¯*/O ûŠ³P,îÐÁƒ1qâDÕfwÝujÕª…Í›7cúôé –+I4cƬ_¿¾È–ܼystïÞ]ÀI©ñ§L™‚cÇŽÝÚ5‚\¯
. œÐR3¿ÿ4ì�m·6gÙK<'Z}÷ÚÔÞ“‡aÿþìÑ/a?ÿ#PnÒ"ä�²SßÎ�JÖ¬…ýdlx¾iÓhÖQ,ÃlØMa—MIJý7¨X@0þ|ÈG98p :w={¢mÛ¶z÷oßîKÞíÆÆ�±`Á4Ö�?^ûNž<‰
6è˜è¹·k×.ìÞ½‡R«³|ùrP‹FI^
W .\¸k×®UW$ÚÏòÎ�;Áþ+VàìÙ³ÚíÖFÐRSs�<ÆI>ÒÀ¦M›Âæ3gÎèØè:ØOÅ@â|Ôþ$ÎÇõ“xä5¢<àÚ·mÛ¦{g_�
- +„.�¥#“Ý qEL‹N0rHfôX˜lÑðbyôgR^¢„¼ZöIÁMM¹,˜²åÃ:öJ‚�‘Ú6ñ
ØKÉ7”-Nî˜A?†)]FÇY€�çÏ› ûå–ðüÄЗ´|,V �‚ ©ó»ö¢>–.ê O�:¥7·eË–êÓºù›6m
- +ö9wˆ‚@“O™¾/…Â>`À Ãv‚‰ãå‹ P ØÏ9Úµk§ÓR¨Oœ8¡‚#JàÒ¥K*ðƒVׂB3mÚ4Ð¥©R¥Š
- +øºuëпÿpm³gÏÁÅ5xœ“k ´dÉ�›L·Žî Ý–(Q“/Z´õë×Wÿ�kä.\ÐuróæÍC—.]P»vm½÷Ú¢E/-$‰mÆ
h�Ö¬Y£×g;ÁqàÀU(á )ØC»¢Uu#Ìýƒ`šwNˆ˜û1L¿ê˜ÐÐä>+š<�Ì£?R ¸º}c”+ê11n«jul_�àùN
- + íر�§�ÁÎø}xž÷ËÎþ“ZÓã;°³Þ×>;ù-]��ðËp¬iÙ
hq?°~.¬üBZ<Y´Ã: AË°©8
- +ùa_È«PHIU«VM™‰BF7€ÂB¢o̱}ûöÅ�!CЯ_?P‹²=J·ß~;F�…áÇ«�mÙrU{P8¦>}ú`ôèÑjm(Èò‰¨Ná40-Ñ Aƒô:òåh1H{÷îU¡d¬2lØ0í'ØVZ…¬¬,Œ3FÝ–fÍši™‚'ºz$‚„D«R©R%µR¬ÓJ‘ä“U=FÿÐ5êÑ£‡6=üðÃz�h Lž�9#FŒP—’s;+âæ¡%»irÖÁÐj^T‘õ]IZžpœðíºtþš
€ÒɸEÏ/›Nc'½ {1f…i
Ä]3ßzA¬RRßÚ³'¼ÒWø�ṡˆi~Þ‹¸µ O*ÂB‘ƒ€'Q@¯GÔj 'DÌ–PS²=J�7ÖÀšš¹nݺª£ý·Ýv[(`Œ?H‰s1('¸è×SãS@é¸~®³U«VZ§ÐõîÝ;´4Úxƒ?)]?‚€ƒnP×®]ÕÒ
- +°�€â:Ó¥†
ªEcÀÜ ÏBФ�dk#^IibÅÒzn[Žà�ï"x¡Ð|'\§�ÁmðlG�ÕOts_ŸäY"Øvú;ùf°’‘bð‹Z
$P@æ‘Ý0ßÕm-ÁæE°«#™"7báßD[]Œk.Êc‘ƒ€BF¢ D‰iAÆÌŒ�X§`G‰u¶G‰æˆ.Oœ¢ýø(Ñ="1v å�sPØI¼ëÌÒ8"ÓXž[½zuç'Pù£%äui 8çPA{sJ&:Ÿùö‹`f%ÑeS‹1²[–hÀk¾éªÝ¾RâŽe¡¿Ï݆Áù©ÎAÇž?£e#éXs÷}Zæ;A‚_QŒfðOÂ%ì”3F$ÍiIh�F0U“<ã~£®SÞ�"=\½ûE4-ˆ&�]4Ècà·ÿþ0peÊ1h2C’N*² �ˆnƒs1.x衇ÔÝ¢ËÕ©S'<òÈ#:Œýt/h)1SÃXÄ…<º×=ÒšÑ�5Ò.jqž1KA®�;ßYLºi·JvÞ'¢‰ßU¿>ñÑ”z{%}ŸJ�nÇêÔúõjyÖÜ
q�mX¯‘
óôø¤ktþt첟Ï�¿î†Âîߪq (Ø]††í:¶iàž�m°•³Â>ÌÀçº�ÿ ó9¨½¸2ËB�bà·zõjÍÞÐ- Mâ‘ÖbÎœ9êÃÏ�;Wc×_Іo$ôñsèsófŸè1Ã2yòdõù9¶I“&ê.18Þ³g�fˆè¾¸|=ÇвÀ†³,l�A@«Â~ç’ ¯=Kà@¿lÙ2
¨£óÞTy×Ø·Gðï?#x²Y2p¥fþ2p‡sÔmoXˆ¹²‰vÀ´ìžf幄�ük3Ûì‰`a6ˆA®»ÚJk A°ðA…;buÃX ’e2òÀÌt ÓëI˜*5u+Š,šNÍ›¶ÈE®ŒÂÇÔ(5,…{éÒ¥ê‚ôêÕKýcŽ¡¯ï½÷ªÅ˜9s¦jM¦Q)˜×"§5]¼îÚݱF�èÖ›‚lêÔ©a§M›6:„ÎÀ”ú¬Y³4n`àî²OÔ±cGuÛd_îé¯ü?›@t‘(àË×"f¸Æ1´žéRð‡çÅOOÆ@6ç2èú_Œ‡]õÏp*S¡L×T-vÞLA@‘xj\JšÔ~(à$[d'ý&œÁô-Oª³µîœ»o,}û;›ÂÜ?XûMãv@»^ú,À.�¦müà q�™–ýæ3a»Æ|ê]�^+ˆæJ
ñyQj{úêѬGtJ¦?
- +dÔŽŽ)l™Ú˜ë`,pkXZ«EðZѤvÖ8س'ó-ÝÔm’|ºÛºûÕ>q?rŸéÖ¢½ù,Á‘•§¸Ñ'Æ¥ÆïÓ©ýô5ã_tÃ`ä5
- +—bö'ñžXŸZ
Ãþà…®pA°‘4gâ·â’I�|¿/~tè‡`죰‹&é9F ”'Š ﹃ùàñ†°’~%%óƒ´\˜?¢<åý$5‡Š…Y¬?7
ÈÃ+l_ËܽdkP©:] �Ezb_üxˆÅɽ³ã8GôÝ!ºBL�Jº“Ot¤
- +•úøQ:²ˆ<Ã×e-òÐ�îƒy¥ÕŸ««¤eZ‘;“îr8
Ÿœ8˜¬Ì$’<
- +É@zÉç@1Qò7èwà9�.<Ò嘟qð ȸ[ê7”.<Ò嘟qð ȸ[ê7”.<Ò嘟qð ȸ[ê7”.<Ò嘟qð ȸ[ê7”.<Ò嘟qˆƒÀÊ—KG3n—~CžyÈ“ïäç�ymqò¾ýX/3™Èʵüsù¸)ÿ÷'þ)¿eäËïwÈ�ß>Æû¥É“ç@‰ä µÿEùí—ßÍ–Wb“rÖi†x_òÿ×s är€@ ðÓ¤¸D%wK~åžžžž…çÀ X¡cä IEND®B`‚
- \ No newline at end of file
|