aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-05-29 16:09:08 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-05-29 16:09:08 +0000
commit5891bc44af871c3ab21a5e1c4293f6382f4fe6e1 (patch)
treec5d6bec191c2cf098b0f98a1c7d804485cd61271 /src
parentf0a1d05ed7dc9e5a35ee41e5d15a82702a1ab3c7 (diff)
downloadqmmp-5891bc44af871c3ab21a5e1c4293f6382f4fe6e1.tar.gz
qmmp-5891bc44af871c3ab21a5e1c4293f6382f4fe6e1.tar.bz2
qmmp-5891bc44af871c3ab21a5e1c4293f6382f4fe6e1.zip
improved scrobbler plugin, fixed libre.fm support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@955 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
-rw-r--r--src/plugins/General/scrobbler/CMakeLists.txt2
-rw-r--r--src/plugins/General/scrobbler/scrobbler.cpp68
-rw-r--r--src/plugins/General/scrobbler/scrobbler.h11
-rw-r--r--src/plugins/General/scrobbler/scrobbler.pro60
-rw-r--r--src/plugins/General/scrobbler/scrobblerfactory.cpp6
-rw-r--r--src/plugins/General/scrobbler/scrobblerhandler.cpp48
-rw-r--r--src/plugins/General/scrobbler/scrobblerhandler.h40
-rw-r--r--src/plugins/General/scrobbler/settingsdialog.cpp23
-rw-r--r--src/plugins/General/scrobbler/settingsdialog.ui101
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_cs.ts15
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_de.ts15
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_it.ts15
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_pl.ts15
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_ru.ts17
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_uk_UA.ts21
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_CN.ts15
-rw-r--r--src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_TW.ts15
17 files changed, 333 insertions, 154 deletions
diff --git a/src/plugins/General/scrobbler/CMakeLists.txt b/src/plugins/General/scrobbler/CMakeLists.txt
index 19b06d585..2a10cced2 100644
--- a/src/plugins/General/scrobbler/CMakeLists.txt
+++ b/src/plugins/General/scrobbler/CMakeLists.txt
@@ -31,12 +31,14 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp)
SET(libscrobbler_SRCS
settingsdialog.cpp
scrobbler.cpp
+ scrobblerhandler.cpp
scrobblerfactory.cpp
)
SET(libscrobbler_MOC_HDRS
settingsdialog.h
scrobblerfactory.h
+ scrobblerhandler.h
scrobbler.h
)
diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp
index 38210b8a7..04bbeebde 100644
--- a/src/plugins/General/scrobbler/scrobbler.cpp
+++ b/src/plugins/General/scrobbler/scrobbler.cpp
@@ -25,31 +25,31 @@
#include <QUrl>
#include <QTime>
#include <QDateTime>
-#include <QSettings>
#include <QDir>
#include <qmmp/soundcore.h>
#include <qmmp/qmmp.h>
#include "scrobbler.h"
-//#define SCROBBLER_HS_URL "post.audioscrobbler.com"
#define PROTOCOL_VER "1.2"
#define CLIENT_ID "qmm"
#define CLIENT_VER "0.2"
-Scrobbler::Scrobbler(QObject *parent)
- : General(parent)
+Scrobbler::Scrobbler(const QString &url,
+ const QString &login,
+ const QString &passw,
+ const QString &name,
+ QObject *parent)
+ : QObject(parent)
{
m_http = new QHttp(this);
- m_http->setHost(m_server, 80);
+ m_http->setHost(url, 80);
m_state = Qmmp::Stopped;
- QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
- settings.beginGroup("Scrobbler");
- m_login = settings.value("login").toString();
- m_passw = settings.value("password").toString();
- m_server = settings.value("server", "post.audioscrobbler.com").toString();
- settings.endGroup();
+ m_login = login;
+ m_passw = passw;
+ m_server = url;
+ m_name = name;
//load global proxy settings
if (Qmmp::useProxy())
m_http->setProxy(Qmmp::proxy().host(),
@@ -73,7 +73,7 @@ Scrobbler::Scrobbler(QObject *parent)
m_submitid = 0;
m_notificationid = 0;
- QFile file(QDir::homePath() +"/.qmmp/scrobbler.cache");
+ QFile file(QDir::homePath() +"/.qmmp/scrobbler_" + m_name + ".cache");
if (!m_disabled && file.open(QIODevice::ReadOnly))
{
@@ -122,7 +122,7 @@ Scrobbler::Scrobbler(QObject *parent)
Scrobbler::~Scrobbler()
{
delete m_time;
- QFile file(QDir::homePath() +"/.qmmp/scrobbler.cache");
+ QFile file(QDir::homePath() +"/.qmmp/scrobbler_" + m_name + ".cache");
if (m_songCache.isEmpty())
{
file.remove();
@@ -231,19 +231,23 @@ void Scrobbler::processResponse(int id, bool error)
m_handshakeid = 0;
if (!strlist[0].contains("OK") || strlist.size() < 4)
{
- qWarning("Scrobbler: handshake phase error: %s", qPrintable(strlist[0]));
+ qWarning("Scrobbler[%s]: handshake phase error: %s",qPrintable(m_name), qPrintable(strlist[0]));
//TODO badtime handling
return;
}
if (strlist.size() > 3) //process handshake response
{
- qDebug("Scrobbler: reading handshake response");
- qDebug("Scrobbler: Session ID: %s",qPrintable(strlist[1]));
- qDebug("Scrobbler: Now-Playing URL: %s",qPrintable(strlist[2]));
- qDebug("Scrobbler: Submission URL: %s",qPrintable(strlist[3]));
+ qDebug("Scrobbler[%s]: reading handshake response",qPrintable(m_name));
+ qDebug("Scrobbler[%s]: Session ID: %s",qPrintable(m_name),qPrintable(strlist[1]));
+ qDebug("Scrobbler[%s]: Now-Playing URL: %s",qPrintable(m_name),qPrintable(strlist[2]));
+ qDebug("Scrobbler[%s]: Submission URL: %s",qPrintable(m_name),qPrintable(strlist[3]));
m_submitUrl = strlist[3];
m_nowPlayingUrl = strlist[2];
m_session = strlist[1];
+ /*if(m_submitUrl.endsWith("/"))
+ m_submitUrl.removeLast();
+ if(m_nowPlayingUrl.trnkate("/"))
+ m_nowPlayingUrl.takeLast();*/
updateMetaData(); //send now-playing notification for already playing song
if (!m_songCache.isEmpty()) //submit recent songs
submit();
@@ -255,11 +259,11 @@ void Scrobbler::processResponse(int id, bool error)
m_submitid = 0;
if (!strlist[0].contains("OK"))
{
- qWarning("Scrobbler: submit error: %s", qPrintable(strlist[0]));
+ qWarning("Scrobbler[%s]: submit error: %s",qPrintable(m_name), qPrintable(strlist[0]));
//TODO badsession handling
return;
}
- qWarning("Scrobbler: submited %d song(s)", m_submitedSongs);
+ qWarning("Scrobbler[%s]: submited %d song(s)",qPrintable(m_name), m_submitedSongs);
while (m_submitedSongs)
{
m_submitedSongs--;
@@ -273,11 +277,11 @@ void Scrobbler::processResponse(int id, bool error)
m_notificationid = 0;
if (!strlist[0].contains("OK"))
{
- qWarning("Scrobbler: notification error: %s", qPrintable(strlist[0]));
+ qWarning("Scrobbler[%s]: notification error: %s",qPrintable(m_name), qPrintable(strlist[0]));
//TODO badsession handling
return;
}
- qDebug("Scrobbler: Now-Playing notification done");
+ qDebug("Scrobbler[%s]: Now-Playing notification done", qPrintable(m_name));
}
m_array.clear();
}
@@ -286,7 +290,7 @@ void Scrobbler::readResponse(const QHttpResponseHeader &header)
{
if (header.statusCode () != 200)
{
- qWarning("Scrobbler: error: %s",qPrintable(header.reasonPhrase ()));
+ qWarning("Scrobbler[%s]: error: %s", qPrintable(m_name), qPrintable(header.reasonPhrase ()));
//TODO Failure Handling
return;
}
@@ -295,9 +299,9 @@ void Scrobbler::readResponse(const QHttpResponseHeader &header)
void Scrobbler::handshake()
{
- qDebug("Scrobbler::handshake()");
+ qDebug("Scrobbler[%s] handshake request",qPrintable(m_name));
uint ts = QDateTime::currentDateTime().toTime_t();
- qDebug("Scrobbler: current time stamp %d",ts);
+ qDebug("Scrobbler[%s]: current time stamp %d",qPrintable(m_name),ts);
QString auth_tmp = QString("%1%2").arg(m_passw).arg(ts);
QByteArray auth = QCryptographicHash::hash(auth_tmp.toAscii (), QCryptographicHash::Md5);
auth = auth.toHex();
@@ -311,14 +315,14 @@ void Scrobbler::handshake()
.arg(ts)
.arg(QString(auth));
- qDebug("Scrobbler: request url: %s",qPrintable(url));
+ qDebug("Scrobbler[%s]: request url: %s",qPrintable(m_name),qPrintable(url));
m_http->setHost(m_server, 80);
m_handshakeid = m_http->get(url);
}
void Scrobbler::submit()
{
- qDebug("Scrobbler::submit()");
+ qDebug("Scrobbler[%s]: submit request", qPrintable(m_name));
if (m_songCache.isEmpty())
return;
m_submitedSongs = m_songCache.size();
@@ -339,14 +343,14 @@ void Scrobbler::submit()
}
qDebug("%s",qPrintable(body));
QUrl url(m_submitUrl);
- m_http->setHost(url.host(), url.port());
+ m_http->setHost(url.host(), url.port(80));
QHttpRequestHeader header("POST", url.path());
header.setContentType("application/x-www-form-urlencoded");
header.setValue("User-Agent","iScrobbler/1.5.1qmmp-plugins/" + Qmmp::strVersion());
header.setValue("Host",url.host());
header.setValue("Accept", "*/*");
header.setContentLength(QUrl::toPercentEncoding(body,":/[]&=").size());
- qDebug("Scrobbler: submit request header");
+ qDebug("Scrobbler[%s]: submit request header", qPrintable(m_name));
qDebug("%s",qPrintable(header.toString().trimmed()));
qDebug("*****************************");
m_submitid = m_http->request(header, QUrl::toPercentEncoding(body,":/[]&="));
@@ -354,7 +358,7 @@ void Scrobbler::submit()
void Scrobbler::sendNotification(const SongInfo &info)
{
- qDebug("Scrobbler::sendNotification()");
+ qDebug("Scrobbler[%s] sending notification", qPrintable(m_name));
QString body = QString("s=%1").arg(m_session);
body += QString("&a=%1&t=%2&b=%3&l=%4&n=%5&m=")
.arg(info.metaData(Qmmp::ARTIST))
@@ -363,14 +367,14 @@ void Scrobbler::sendNotification(const SongInfo &info)
.arg(info.length())
.arg(info.metaData(Qmmp::TRACK));
QUrl url(m_nowPlayingUrl);
- m_http->setHost(url.host(), url.port());
+ m_http->setHost(url.host(), url.port(80));
QHttpRequestHeader header("POST", url.path());
header.setContentType("application/x-www-form-urlencoded");
header.setValue("User-Agent","iScrobbler/1.5.1qmmp-plugins/" + Qmmp::strVersion());
header.setValue("Host",url.host());
header.setValue("Accept", "*/*");
header.setContentLength(QUrl::toPercentEncoding(body,":/[]&=").size());
- qDebug("Scrobbler: Now-Playing notification request header");
+ qDebug("Scrobbler[%s]: Now-Playing notification request header", qPrintable(m_name));
qDebug("%s",qPrintable(header.toString().trimmed()));
qDebug("*****************************");
m_notificationid = m_http->request(header, QUrl::toPercentEncoding(body,":/[]&="));
diff --git a/src/plugins/General/scrobbler/scrobbler.h b/src/plugins/General/scrobbler/scrobbler.h
index 6a6158509..b7f25849f 100644
--- a/src/plugins/General/scrobbler/scrobbler.h
+++ b/src/plugins/General/scrobbler/scrobbler.h
@@ -22,7 +22,6 @@
#include <QHttpResponseHeader>
#include <QMap>
-#include <qmmpui/general.h>
#include <qmmp/qmmp.h>
class QHttp;
@@ -63,11 +62,15 @@ private:
};
-class Scrobbler : public General
+class Scrobbler : public QObject
{
Q_OBJECT
public:
- Scrobbler(QObject *parent = 0);
+ Scrobbler(const QString &url,
+ const QString &login,
+ const QString &passw,
+ const QString &name,
+ QObject *parent = 0);
~Scrobbler();
@@ -100,7 +103,7 @@ private:
int m_notificationid;
QByteArray m_array;
bool m_disabled;
- QString m_server;
+ QString m_server, m_name;
};
diff --git a/src/plugins/General/scrobbler/scrobbler.pro b/src/plugins/General/scrobbler/scrobbler.pro
index 708af36ae..5a911e481 100644
--- a/src/plugins/General/scrobbler/scrobbler.pro
+++ b/src/plugins/General/scrobbler/scrobbler.pro
@@ -1,49 +1,39 @@
include(../../plugins.pri)
-
CONFIG += release \
- warn_on \
- plugin
-
+ warn_on \
+ plugin
TEMPLATE = lib
unix:QMAKE_LIBDIR += ../../../../lib
win32:QMAKE_LIBDIR += ../../../../bin
-
-TARGET=$$PLUGINS_PREFIX/General/scrobbler
-unix:QMAKE_CLEAN =$$PLUGINS_PREFIX/General/libscrobbler.so
-
-
+TARGET = $$PLUGINS_PREFIX/General/scrobbler
+unix:QMAKE_CLEAN = $$PLUGINS_PREFIX/General/libscrobbler.so
TRANSLATIONS = translations/scrobbler_plugin_cs.ts \
- translations/scrobbler_plugin_de.ts \
- translations/scrobbler_plugin_zh_CN.ts \
- translations/scrobbler_plugin_zh_TW.ts \
- translations/scrobbler_plugin_ru.ts \
- translations/scrobbler_plugin_pl.ts \
- translations/scrobbler_plugin_uk_UA.ts \
- translations/scrobbler_plugin_it.ts
+ translations/scrobbler_plugin_de.ts \
+ translations/scrobbler_plugin_zh_CN.ts \
+ translations/scrobbler_plugin_zh_TW.ts \
+ translations/scrobbler_plugin_ru.ts \
+ translations/scrobbler_plugin_pl.ts \
+ translations/scrobbler_plugin_uk_UA.ts \
+ translations/scrobbler_plugin_it.ts
RESOURCES = translations/translations.qrc
-
-unix{
-isEmpty(LIB_DIR){
- LIB_DIR = /lib
+unix {
+ isEmpty(LIB_DIR):LIB_DIR = /lib
+ target.path = $$LIB_DIR/qmmp/General
+ INSTALLS += target
}
-target.path = $$LIB_DIR/qmmp/General
-INSTALLS += target
-}
-
HEADERS += scrobblerfactory.h \
- scrobbler.h \
- settingsdialog.h
+ scrobbler.h \
+ settingsdialog.h \
+ scrobblerhandler.h
win32:HEADERS += ../../../../src/qmmpui/general.h
SOURCES += scrobblerfactory.cpp \
- scrobbler.cpp \
- settingsdialog.cpp
+ scrobbler.cpp \
+ settingsdialog.cpp \
+ scrobblerhandler.cpp
QT += network
-
-
INCLUDEPATH += ../../../
-
-unix:LIBS += -lqmmpui -lqmmp
-win32:LIBS += -lqmmpui0 -lqmmp0
-
+unix:LIBS += -lqmmpui \
+ -lqmmp
+win32:LIBS += -lqmmpui0 \
+ -lqmmp0
FORMS += settingsdialog.ui
-
diff --git a/src/plugins/General/scrobbler/scrobblerfactory.cpp b/src/plugins/General/scrobbler/scrobblerfactory.cpp
index 6491b8b98..7a9896375 100644
--- a/src/plugins/General/scrobbler/scrobblerfactory.cpp
+++ b/src/plugins/General/scrobbler/scrobblerfactory.cpp
@@ -20,7 +20,7 @@
#include <QtGui>
-#include "scrobbler.h"
+#include "scrobblerhandler.h"
#include "settingsdialog.h"
#include "scrobblerfactory.h"
@@ -37,7 +37,7 @@ const GeneralProperties ScrobblerFactory::properties() const
General *ScrobblerFactory::create(QObject *parent)
{
- return new Scrobbler(parent);
+ return new ScrobblerHandler(parent);
}
QDialog *ScrobblerFactory::createConfigDialog(QWidget *parent)
@@ -55,7 +55,7 @@ void ScrobblerFactory::showAbout(QWidget *parent)
QTranslator *ScrobblerFactory::createTranslator(QObject *parent)
{
QTranslator *translator = new QTranslator(parent);
- QString locale = Qmmp::systemLanguageID();
+ QString locale = QLocale::system().name();
translator->load(QString(":/scrobbler_plugin_") + locale);
return translator;
}
diff --git a/src/plugins/General/scrobbler/scrobblerhandler.cpp b/src/plugins/General/scrobbler/scrobblerhandler.cpp
new file mode 100644
index 000000000..1bb627d62
--- /dev/null
+++ b/src/plugins/General/scrobbler/scrobblerhandler.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * Copyright (C) 2009 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#define SCROBBLER_LASTFM_URL "post.audioscrobbler.com"
+#define SCROBBLER_LIBREFM_URL "turtle.libre.fm"
+
+#include <QSettings>
+#include "scrobbler.h"
+#include "scrobblerhandler.h"
+
+ScrobblerHandler::ScrobblerHandler(QObject *parent) : General(parent)
+{
+ QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
+ settings.beginGroup("Scrobbler");
+ if(settings.value("use_lastfm", FALSE).toBool())
+ {
+ new Scrobbler(SCROBBLER_LASTFM_URL, settings.value("lastfm_login").toString(),
+ settings.value("lastfm_password").toString(), "lastfm", this);
+
+ }
+ if(settings.value("use_librefm", FALSE).toBool())
+ {
+ new Scrobbler(SCROBBLER_LIBREFM_URL, settings.value("librefm_login").toString(),
+ settings.value("librefm_password").toString(), "librefm", this);
+
+ }
+ settings.endGroup();
+}
+
+ScrobblerHandler::~ScrobblerHandler()
+{}
diff --git a/src/plugins/General/scrobbler/scrobblerhandler.h b/src/plugins/General/scrobbler/scrobblerhandler.h
new file mode 100644
index 000000000..22020e3f7
--- /dev/null
+++ b/src/plugins/General/scrobbler/scrobblerhandler.h
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * Copyright (C) 2008 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef SCROBBLERHANDLER_H
+#define SCROBBLERHANDLER_H
+
+#include <QObject>
+#include <qmmpui/general.h>
+
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
+
+class ScrobblerHandler : public General
+{
+Q_OBJECT
+
+public:
+ ScrobblerHandler(QObject *parent = 0);
+ ~ScrobblerHandler();
+};
+
+#endif // SCROBBLERHANDLER_H
diff --git a/src/plugins/General/scrobbler/settingsdialog.cpp b/src/plugins/General/scrobbler/settingsdialog.cpp
index f1f934e58..bfe20a260 100644
--- a/src/plugins/General/scrobbler/settingsdialog.cpp
+++ b/src/plugins/General/scrobbler/settingsdialog.cpp
@@ -29,15 +29,13 @@ SettingsDialog::SettingsDialog(QWidget *parent)
ui.setupUi(this);
QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
settings.beginGroup("Scrobbler");
- ui.userLineEdit->setText(settings.value("login").toString());
- ui.passwordLineEdit->setText(settings.value("password").toString());
- ui.serviceComboBox->addItem ("last.fm", "post.audioscrobbler.com");
- ui.serviceComboBox->addItem ("libre.fm", "turtle.libre.fm");
- int i = ui.serviceComboBox->findData(settings.value("server", "post.audioscrobbler.com").toString());
- if(i >= 0)
- ui.serviceComboBox->setCurrentIndex (i);
+ ui.lastfmGroupBox->setChecked(settings.value("use_lastfm", FALSE).toBool());
+ ui.userLineEdit->setText(settings.value("lastfm_login").toString());
+ ui.passwordLineEdit->setText(settings.value("lastfm_password").toString());
+ ui.librefmGroupBox->setChecked(settings.value("use_librefm", FALSE).toBool());
+ ui.userLineEdit_libre->setText(settings.value("librefm_login").toString());
+ ui.passwordLineEdit_libre->setText(settings.value("librefm_password").toString());
settings.endGroup();
-
}
@@ -48,9 +46,12 @@ void SettingsDialog::accept()
{
QSettings settings(Qmmp::configFile(), QSettings::IniFormat);
settings.beginGroup("Scrobbler");
- settings.setValue("login",ui.userLineEdit->text());
- settings.setValue("password",ui.passwordLineEdit->text());
- settings.setValue("server", ui.serviceComboBox->itemData(ui.serviceComboBox->currentIndex()));
+ settings.setValue("use_lastfm", ui.lastfmGroupBox->isChecked());
+ settings.setValue("lastfm_login",ui.userLineEdit->text());
+ settings.setValue("lastfm_password", ui.passwordLineEdit->text());
+ settings.setValue("use_librefm", ui.librefmGroupBox->isChecked());
+ settings.setValue("librefm_login",ui.userLineEdit_libre->text());
+ settings.setValue("librefm_password", ui.passwordLineEdit_libre->text());
settings.endGroup();
QDialog::accept();
}
diff --git a/src/plugins/General/scrobbler/settingsdialog.ui b/src/plugins/General/scrobbler/settingsdialog.ui
index 6b751b952..d6c1ed936 100644
--- a/src/plugins/General/scrobbler/settingsdialog.ui
+++ b/src/plugins/General/scrobbler/settingsdialog.ui
@@ -6,14 +6,14 @@
<rect>
<x>0</x>
<y>0</y>
- <width>265</width>
- <height>121</height>
+ <width>292</width>
+ <height>219</height>
</rect>
</property>
<property name="windowTitle">
<string>Scrobbler Plugin Settings</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>6</number>
</property>
@@ -26,44 +26,79 @@
<property name="bottomMargin">
<number>6</number>
</property>
- <property name="horizontalSpacing">
- <number>6</number>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Service:</string>
+ <item>
+ <widget class="QGroupBox" name="lastfmGroupBox">
+ <property name="title">
+ <string>last.fm</string>
</property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="serviceComboBox"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>User name:</string>
+ <property name="checkable">
+ <bool>true</bool>
</property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>User name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="userLineEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="passwordLineEdit">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="userLineEdit"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Password:</string>
+ <item>
+ <widget class="QGroupBox" name="librefmGroupBox">
+ <property name="title">
+ <string>libre.fm</string>
</property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="passwordLineEdit">
- <property name="echoMode">
- <enum>QLineEdit::Password</enum>
+ <property name="checkable">
+ <bool>true</bool>
</property>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>User name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="userLineEdit_libre"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="passwordLineEdit_libre">
+ <property name="echoMode">
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
- <item row="3" column="0" colspan="2">
+ <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_cs.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_cs.ts
index f94d96943..6ff5ffc64 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_cs.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_cs.ts
@@ -32,19 +32,26 @@
<translation>Nastavení modulu Scrobbler</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>Uživatelské jméno:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>Heslo:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_de.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_de.ts
index a0e848be0..c5a39c2b1 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_de.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_de.ts
@@ -32,19 +32,26 @@
<translation>Einstellungen des Scrobbler-Plugins</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>Benutzername:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>Passwort:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_it.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_it.ts
index e9bbb4b84..d7886cf54 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_it.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_it.ts
@@ -32,19 +32,26 @@
<translation>Impostazioni del modulo Scrobbler</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>Utente:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>Passowrd:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_pl.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_pl.ts
index 288d68ba0..2c8111d4e 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_pl.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_pl.ts
@@ -32,19 +32,26 @@
<translation>Ustawienia wtyczki Scrobbler</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>Nazwa użytkownika:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>Hasło:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_ru.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_ru.ts
index 2d49d9c15..bb40f6162 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_ru.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_ru.ts
@@ -32,19 +32,26 @@
<translation>Настройки модуля scrobbler</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
- <translation>Сервис:</translation>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>Имя пользователя:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>Пароль:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_uk_UA.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_uk_UA.ts
index 464c0eff1..4fed5c45d 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_uk_UA.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_uk_UA.ts
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS><TS version="1.1" language="uk">
-<defaultcodec></defaultcodec>
+<!DOCTYPE TS>
+<TS version="2.0" language="uk">
<context>
<name>ScrobblerFactory</name>
<message>
@@ -32,19 +32,26 @@
<translation>Налаштування модуля scrobbler</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
- <translation>Сервіс:</translation>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
+ <translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>Ім&apos;я користувача:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>Пароль:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_CN.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_CN.ts
index a79a971f8..632faa88d 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_CN.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_CN.ts
@@ -32,19 +32,26 @@
<translation>Scrobbler 插件设置</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>用户名:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>密码:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
diff --git a/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_TW.ts b/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_TW.ts
index ed102a957..7a54824cb 100644
--- a/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_TW.ts
+++ b/src/plugins/General/scrobbler/translations/scrobbler_plugin_zh_TW.ts
@@ -32,19 +32,26 @@
<translation>Scrobbler 插件設定</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="35"/>
- <source>Service:</source>
+ <location filename="../settingsdialog.ui" line="32"/>
+ <source>last.fm</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="45"/>
+ <location filename="../settingsdialog.ui" line="41"/>
+ <location filename="../settingsdialog.ui" line="77"/>
<source>User name:</source>
<translation>用戶名:</translation>
</message>
<message>
- <location filename="../settingsdialog.ui" line="55"/>
+ <location filename="../settingsdialog.ui" line="51"/>
+ <location filename="../settingsdialog.ui" line="87"/>
<source>Password:</source>
<translation>密碼:</translation>
</message>
+ <message>
+ <location filename="../settingsdialog.ui" line="68"/>
+ <source>libre.fm</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>