diff --git a/src/radio/magnatuneconfig.cpp b/src/radio/magnatuneconfig.cpp index 8085963a4..b776b2708 100644 --- a/src/radio/magnatuneconfig.cpp +++ b/src/radio/magnatuneconfig.cpp @@ -16,25 +16,95 @@ */ #include "magnatuneconfig.h" + +#include "core/network.h" #include "magnatuneservice.h" #include "radiomodel.h" #include "ui_magnatuneconfig.h" +#include <QMessageBox> +#include <QNetworkReply> +#include <QNetworkRequest> #include <QSettings> +#include <QtDebug> MagnatuneConfig::MagnatuneConfig(QWidget *parent) : QWidget(parent), + credentials_changed_(false), + network_(new NetworkAccessManager(this)), ui_(new Ui_MagnatuneConfig) { ui_->setupUi(this); + ui_->busy->hide(); connect(ui_->membership, SIGNAL(currentIndexChanged(int)), SLOT(MembershipChanged(int))); + + connect(network_, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), + SLOT(AuthenticationRequired(QNetworkReply*, QAuthenticator*))); + connect(ui_->username, SIGNAL(textEdited(const QString&)), + SLOT(CredentialsChanged())); + connect(ui_->password, SIGNAL(textEdited(const QString&)), + SLOT(CredentialsChanged())); } MagnatuneConfig::~MagnatuneConfig() { delete ui_; } +bool MagnatuneConfig::NeedsValidation() const { + return credentials_changed_; +} + +const char* kMagnatuneDownloadValidateUrl = "http://download.magnatune.com/"; +const char* kMagnatuneStreamingValidateUrl = "http://streaming.magnatune.com/"; + +void MagnatuneConfig::Validate() { + ui_->busy->show(); + + MagnatuneService::MembershipType type = (MagnatuneService::MembershipType)(ui_->membership->currentIndex()); + + QUrl url(type == MagnatuneService::Membership_Streaming ? kMagnatuneStreamingValidateUrl : kMagnatuneDownloadValidateUrl, QUrl::StrictMode); + + url.setUserName(ui_->username->text()); + // NOTE: Magnatune actually only checks the first 8 characters. + url.setPassword(ui_->password->text()); + + QNetworkRequest req(url); + // Disable keep-alives and gzip compression as it's broken on magnatune. + req.setRawHeader("Connection", "Close"); + req.setRawHeader("Accept-Encoding", "identity"); + // Disable caching. + req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, + QNetworkRequest::AlwaysNetwork); + + QNetworkReply* reply = network_->head(req); + connect(reply, SIGNAL(finished()), SLOT(ValidationFinished())); +} + +void MagnatuneConfig::ValidationFinished() { + QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender()); + Q_ASSERT(reply); + reply->deleteLater(); + + ui_->busy->hide(); + + const bool success = + reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 200; + credentials_changed_ = !success; + if (!success) { + QMessageBox::warning( + this, tr("Authentication failed"), tr("Your Magnatune credentials were incorrect")); + } + emit ValidationComplete(success); +} + +void MagnatuneConfig::AuthenticationRequired( + QNetworkReply* reply, QAuthenticator*) { + // We send the authentication with the first request so this means we got + // a 401 Authentication Required, ie. the credentials are incorrect. + reply->abort(); +} + void MagnatuneConfig::Load() { QSettings s; s.beginGroup(MagnatuneService::kSettingsGroup); @@ -43,6 +113,8 @@ void MagnatuneConfig::Load() { ui_->username->setText(s.value("username").toString()); ui_->password->setText(s.value("password").toString()); ui_->format->setCurrentIndex(s.value("format", MagnatuneService::Format_Ogg).toInt()); + + credentials_changed_ = false; } void MagnatuneConfig::Save() { @@ -63,3 +135,7 @@ void MagnatuneConfig::MembershipChanged(int value) { ui_->login_container->setEnabled(enabled); ui_->preferences_group->setEnabled(enabled); } + +void MagnatuneConfig::CredentialsChanged() { + credentials_changed_ = true; +} diff --git a/src/radio/magnatuneconfig.h b/src/radio/magnatuneconfig.h index 89cb5d7a7..80820236b 100644 --- a/src/radio/magnatuneconfig.h +++ b/src/radio/magnatuneconfig.h @@ -20,6 +20,10 @@ #include <QWidget> +class QAuthenticator; +class QNetworkReply; + +class NetworkAccessManager; class Ui_MagnatuneConfig; class MagnatuneConfig : public QWidget { @@ -28,14 +32,25 @@ public: MagnatuneConfig(QWidget* parent = 0); ~MagnatuneConfig(); + bool NeedsValidation() const; + void Validate(); + public slots: void Load(); void Save(); +signals: + void ValidationComplete(bool); + private slots: void MembershipChanged(int value); + void ValidationFinished(); + void AuthenticationRequired(QNetworkReply* reply, QAuthenticator* auth); + void CredentialsChanged(); private: + bool credentials_changed_; + NetworkAccessManager* network_; Ui_MagnatuneConfig* ui_; }; diff --git a/src/radio/magnatuneconfig.ui b/src/radio/magnatuneconfig.ui index eb6d63213..dce6a6bfb 100644 --- a/src/radio/magnatuneconfig.ui +++ b/src/radio/magnatuneconfig.ui @@ -105,7 +105,7 @@ </property> <layout class="QFormLayout" name="formLayout_2"> <item row="0" column="0"> - <widget class="QLabel" name="label_5"> + <widget class="QLabel" name="audio_format_label"> <property name="text"> <string>Preferred audio format</string> </property> @@ -156,8 +156,44 @@ </property> </spacer> </item> + <item> + <widget class="QWidget" name="busy" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Authenticating...</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + </widget> + </item> + <item> + <widget class="BusyIndicator" name="label_6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> + <customwidgets> + <customwidget> + <class>BusyIndicator</class> + <extends>QLabel</extends> + <header>widgets/busyindicator.h</header> + </customwidget> + </customwidgets> <resources/> <connections/> </ui> diff --git a/src/translations/ar.po b/src/translations/ar.po index 493e3fcac..b87bdbb99 100644 --- a/src/translations/ar.po +++ b/src/translations/ar.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/be.po b/src/translations/be.po index 871411c22..a374eaff3 100644 --- a/src/translations/be.po +++ b/src/translations/be.po @@ -2733,6 +2733,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/bg.po b/src/translations/bg.po index 7b8bacece..1ad1d87a5 100644 --- a/src/translations/bg.po +++ b/src/translations/bg.po @@ -2797,6 +2797,9 @@ msgstr "Данните ви за вход в Google бяха грешни" msgid "Your Last.fm credentials were incorrect" msgstr "Вашите Last.fm данни са грешни" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/br.po b/src/translations/br.po index 29719eaae..5d6bc629b 100644 --- a/src/translations/br.po +++ b/src/translations/br.po @@ -2743,6 +2743,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/ca.po b/src/translations/ca.po index 072b8d182..cc59f98c8 100644 --- a/src/translations/ca.po +++ b/src/translations/ca.po @@ -2772,6 +2772,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Les teves credencials de Last.fm son incorrectes" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/cs.po b/src/translations/cs.po index 3bc426998..aa0fbf305 100644 --- a/src/translations/cs.po +++ b/src/translations/cs.po @@ -2788,6 +2788,9 @@ msgstr "Vaše osobní doklady u Google byly nesprávné" msgid "Your Last.fm credentials were incorrect" msgstr "Vaše přihlašovací údaje k Last.fm byly nesprávné" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/cy.po b/src/translations/cy.po index 4c47739e4..6ae53f248 100644 --- a/src/translations/cy.po +++ b/src/translations/cy.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/da.po b/src/translations/da.po index 1ad5698ce..c383b9b2e 100644 --- a/src/translations/da.po +++ b/src/translations/da.po @@ -2724,6 +2724,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Dine Last.fm login-oplysninger var forkerte" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/de.po b/src/translations/de.po index 0a13a99a3..28bc4d0be 100644 --- a/src/translations/de.po +++ b/src/translations/de.po @@ -2799,6 +2799,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Ihre Last.fm Daten sind falsch" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/el.po b/src/translations/el.po index 1ca164ead..6f1f9c1c8 100644 --- a/src/translations/el.po +++ b/src/translations/el.po @@ -2821,6 +2821,9 @@ msgstr "Τα διαπιστευτήρια του Google δεν ήταν σωστ msgid "Your Last.fm credentials were incorrect" msgstr "Τα στοιχεία σας στο Last.fm ήταν εσφαλμένα" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/en.po b/src/translations/en.po index 4cdf1eadc..20ec8bc56 100644 --- a/src/translations/en.po +++ b/src/translations/en.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/en_CA.po b/src/translations/en_CA.po index 0098aea91..7d6b2aa74 100644 --- a/src/translations/en_CA.po +++ b/src/translations/en_CA.po @@ -2723,6 +2723,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Your Last.fm credentials were incorrect" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/en_GB.po b/src/translations/en_GB.po index 219cf2959..3da61f2d0 100644 --- a/src/translations/en_GB.po +++ b/src/translations/en_GB.po @@ -2720,6 +2720,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Your Last.fm credentials were incorrect" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/eo.po b/src/translations/eo.po index cfa0f95db..c5b240a2f 100644 --- a/src/translations/eo.po +++ b/src/translations/eo.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/es.po b/src/translations/es.po index e12d10c04..a7d30987b 100644 --- a/src/translations/es.po +++ b/src/translations/es.po @@ -2812,6 +2812,9 @@ msgstr "Sus credenciales de Google son incorrectos." msgid "Your Last.fm credentials were incorrect" msgstr "Sus credenciales de Last.fm fueron incorrectas" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/et.po b/src/translations/et.po index 0cb77a171..0da203430 100644 --- a/src/translations/et.po +++ b/src/translations/et.po @@ -2720,6 +2720,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/eu.po b/src/translations/eu.po index e7eb7916a..6d40582f9 100644 --- a/src/translations/eu.po +++ b/src/translations/eu.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/fi.po b/src/translations/fi.po index 94c7aab96..dde1afd80 100644 --- a/src/translations/fi.po +++ b/src/translations/fi.po @@ -2744,6 +2744,9 @@ msgstr "Google-tilisi tiedot olivat virheelliset" msgid "Your Last.fm credentials were incorrect" msgstr "Last.fm-tunnustietosi eivät olleet oikein" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/fr.po b/src/translations/fr.po index ec0227d0a..0921f7466 100644 --- a/src/translations/fr.po +++ b/src/translations/fr.po @@ -2821,6 +2821,9 @@ msgstr "Vos identifiants Google sont incorrect" msgid "Your Last.fm credentials were incorrect" msgstr "Vos identifiants Last.fm sont incorrects" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/gl.po b/src/translations/gl.po index fa8edf172..b0be2beaf 100644 --- a/src/translations/gl.po +++ b/src/translations/gl.po @@ -2728,6 +2728,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "A suas credenciais da Last.fm son incorrectas" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/he.po b/src/translations/he.po index 2f2a9b47d..6fbfc29d0 100644 --- a/src/translations/he.po +++ b/src/translations/he.po @@ -2756,6 +2756,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "הפרטים שהוקשו עבור Last.fm אינם נכונים" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/hi.po b/src/translations/hi.po index 356e4dd2a..34ab23d62 100644 --- a/src/translations/hi.po +++ b/src/translations/hi.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/hr.po b/src/translations/hr.po index 530bf16fb..7a00b8d1c 100644 --- a/src/translations/hr.po +++ b/src/translations/hr.po @@ -2788,6 +2788,9 @@ msgstr "Vaša Google akreditacija je pogrešna" msgid "Your Last.fm credentials were incorrect" msgstr "Vaša Last.fm akreditacija je netočna" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/hu.po b/src/translations/hu.po index 732a1cdbd..dce7bbe8f 100644 --- a/src/translations/hu.po +++ b/src/translations/hu.po @@ -2793,6 +2793,9 @@ msgstr "A Google fiókadataid hibásan lettek megadva" msgid "Your Last.fm credentials were incorrect" msgstr "A Last.fm előfizetési adatai hibásak" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/is.po b/src/translations/is.po index 01a27dbd2..b11b1bcd5 100644 --- a/src/translations/is.po +++ b/src/translations/is.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/it.po b/src/translations/it.po index 558694cd9..fcf733a14 100644 --- a/src/translations/it.po +++ b/src/translations/it.po @@ -2811,6 +2811,9 @@ msgstr "Le credenziali di Google non erano corrette" msgid "Your Last.fm credentials were incorrect" msgstr "Le credenziali Last.fm non sono corrette" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/ja.po b/src/translations/ja.po index b95fbd3f8..acca29899 100644 --- a/src/translations/ja.po +++ b/src/translations/ja.po @@ -2770,6 +2770,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Last.fm の資格情報が正しくありません" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/kk.po b/src/translations/kk.po index 06c60a2c0..36228d38f 100644 --- a/src/translations/kk.po +++ b/src/translations/kk.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/lt.po b/src/translations/lt.po index 5ec4e8c2d..6b6315eb2 100644 --- a/src/translations/lt.po +++ b/src/translations/lt.po @@ -2783,6 +2783,9 @@ msgstr "Jūsų Google duomenys buvo neteisingi" msgid "Your Last.fm credentials were incorrect" msgstr "Jūsų Last.fm duomenys buvo neteisingi" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/lv.po b/src/translations/lv.po index a6d5751cc..90b560cec 100644 --- a/src/translations/lv.po +++ b/src/translations/lv.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/nb.po b/src/translations/nb.po index 8654fb7d5..e09ffac20 100644 --- a/src/translations/nb.po +++ b/src/translations/nb.po @@ -2732,6 +2732,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Din last.fm brukerinformasjon var ikke korrekt" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/nl.po b/src/translations/nl.po index 8b2dcbd0d..cdf574721 100644 --- a/src/translations/nl.po +++ b/src/translations/nl.po @@ -2808,6 +2808,9 @@ msgstr "Uw Google inloggegevens zijn onjuist" msgid "Your Last.fm credentials were incorrect" msgstr "Uw Last.fm gegevens zijn incorrect" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/oc.po b/src/translations/oc.po index 720998268..c213d061d 100644 --- a/src/translations/oc.po +++ b/src/translations/oc.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/pa.po b/src/translations/pa.po index f2c4ea12e..3118e5133 100644 --- a/src/translations/pa.po +++ b/src/translations/pa.po @@ -2719,6 +2719,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/pl.po b/src/translations/pl.po index 498206126..9193c1083 100644 --- a/src/translations/pl.po +++ b/src/translations/pl.po @@ -2795,6 +2795,9 @@ msgstr "Niepoprawne dane konta Google" msgid "Your Last.fm credentials were incorrect" msgstr "Twoje dane Last.fm są niepoprawne" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/pt.po b/src/translations/pt.po index fc1d5cc98..1039a8386 100644 --- a/src/translations/pt.po +++ b/src/translations/pt.po @@ -2802,6 +2802,9 @@ msgstr "Os seus dados Google são inválidos" msgid "Your Last.fm credentials were incorrect" msgstr "A suas credenciais last.fm estão incorretas" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/pt_BR.po b/src/translations/pt_BR.po index 2e781f435..7e5b4b97e 100644 --- a/src/translations/pt_BR.po +++ b/src/translations/pt_BR.po @@ -2789,6 +2789,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Suas credencias do Last.fm estavam incorretas" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/ro.po b/src/translations/ro.po index 4a0041cd4..3e5bbc8d9 100644 --- a/src/translations/ro.po +++ b/src/translations/ro.po @@ -2723,6 +2723,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/ru.po b/src/translations/ru.po index 1dc1694f5..130d394eb 100644 --- a/src/translations/ru.po +++ b/src/translations/ru.po @@ -2783,6 +2783,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Ваши данные Last.fm некорректны" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/sk.po b/src/translations/sk.po index 9c6aafa43..15d387f44 100644 --- a/src/translations/sk.po +++ b/src/translations/sk.po @@ -2785,6 +2785,9 @@ msgstr "Vaše Google údaje sú neplatné" msgid "Your Last.fm credentials were incorrect" msgstr "Vaše Last.fm poverenie bolo nekorektné" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/sl.po b/src/translations/sl.po index 040ba1c32..eb4c7310d 100644 --- a/src/translations/sl.po +++ b/src/translations/sl.po @@ -2788,6 +2788,9 @@ msgstr "Vaša Google poverila so bila napačna" msgid "Your Last.fm credentials were incorrect" msgstr "Vaši podatki Last.fm so bili napačni" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/sr.po b/src/translations/sr.po index ac0acabb7..d006beacd 100644 --- a/src/translations/sr.po +++ b/src/translations/sr.po @@ -2725,6 +2725,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "Акредитиви за ЛастФМ које сте унели су нетачни" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/sv.po b/src/translations/sv.po index 42d8cde33..0c49a8c07 100644 --- a/src/translations/sv.po +++ b/src/translations/sv.po @@ -2786,6 +2786,9 @@ msgstr "Dina Google-uppgifter var felaktiga" msgid "Your Last.fm credentials were incorrect" msgstr "Dina Last.fm-uppgifter var felaktiga" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/tr.po b/src/translations/tr.po index 7035fcb41..2f2de16ff 100644 --- a/src/translations/tr.po +++ b/src/translations/tr.po @@ -2779,6 +2779,9 @@ msgstr "Google hesap bilgileriniz doğru değil" msgid "Your Last.fm credentials were incorrect" msgstr "Last.fm giriş bilgileriniz doğru değil" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/translations.pot b/src/translations/translations.pot index 8db48591d..d5f7781f6 100644 --- a/src/translations/translations.pot +++ b/src/translations/translations.pot @@ -2709,6 +2709,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/uk.po b/src/translations/uk.po index 061ec24f3..c7f339074 100644 --- a/src/translations/uk.po +++ b/src/translations/uk.po @@ -2780,6 +2780,9 @@ msgstr "Вказані дані рахунку Google помилкові" msgid "Your Last.fm credentials were incorrect" msgstr "Ваші облікові дані Last.fm неправильні" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/vi.po b/src/translations/vi.po index bb7d6c811..37b17fb80 100644 --- a/src/translations/vi.po +++ b/src/translations/vi.po @@ -2786,6 +2786,9 @@ msgstr "Thông tin tài khoản Google của bạn không đúng" msgid "Your Last.fm credentials were incorrect" msgstr "Chứng thư Last.fm của bạn không đúng" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/zh_CN.po b/src/translations/zh_CN.po index 04502356d..c2a011249 100644 --- a/src/translations/zh_CN.po +++ b/src/translations/zh_CN.po @@ -2721,6 +2721,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/translations/zh_TW.po b/src/translations/zh_TW.po index 744943117..ec02ddeab 100644 --- a/src/translations/zh_TW.po +++ b/src/translations/zh_TW.po @@ -2725,6 +2725,9 @@ msgstr "" msgid "Your Last.fm credentials were incorrect" msgstr "" +msgid "Your Magnatune credentials were incorrect" +msgstr "" + msgid "" "Your gstreamer installation is missing the 'ofa' plugin. This is required " "for automatic tag fetching. Try installing the 'gstreamer-plugins-bad' " diff --git a/src/ui/settingsdialog.cpp b/src/ui/settingsdialog.cpp index 50e60cfa5..80830ca30 100644 --- a/src/ui/settingsdialog.cpp +++ b/src/ui/settingsdialog.cpp @@ -135,6 +135,8 @@ SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent) connect(remote_config_, SIGNAL(ValidationComplete(bool)), SLOT(ValidationComplete(bool))); #endif + connect(ui_->magnatune, SIGNAL(ValidationComplete(bool)), SLOT(ValidationComplete(bool))); + // Icons ui_->list->item(Page_Playback)->setIcon(IconLoader::Load("media-playback-start")); ui_->list->item(Page_SongInformation)->setIcon(IconLoader::Load("view-media-lyrics")); @@ -309,6 +311,14 @@ void SettingsDialog::accept() { } #endif + if (ui_->magnatune->NeedsValidation()) { + ui_->magnatune->Validate(); + ui_->buttonBox->setEnabled(false); + return; + } else { + ui_->magnatune->Save(); + } + QSettings s; // Behaviour