1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

Move spotify and last.fm accounts from libtomahawk to tomahawk/

This commit is contained in:
Leo Franchi
2012-03-14 19:36:35 -04:00
parent 496871af04
commit 39bf8f9f6e
17 changed files with 252 additions and 20 deletions

View File

@@ -72,6 +72,12 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui}
utils/guihelpers.cpp
accounts/lastfm/LastFmAccount.cpp
accounts/lastfm/LastFmConfig.cpp
accounts/lastfm/lastfmplugin.cpp
accounts/spotify/SpotifyAccount.cpp
tomahawktrayicon.cpp
audiocontrols.cpp
settingsdialog.cpp
@@ -91,6 +97,8 @@ SET( tomahawkUI ${tomahawkUI}
stackedsettingsdialog.ui
proxydialog.ui
accounts/lastfm/LastFmConfig.ui
audiocontrols.ui
LoadXSPFDialog.ui

View File

@@ -7,4 +7,4 @@ IF( QTWEETLIB_FOUND AND BUILD_GUI )
ADD_SUBDIRECTORY( twitter )
ENDIF()
ADD_SUBDIRECTORY( zeroconf )
ADD_SUBDIRECTORY( zeroconf )

View File

@@ -20,7 +20,7 @@
#include "LastFmConfig.h"
#include "infosystem/infosystem.h"
#include "infosystem/infoplugins/generic/lastfmplugin.h"
#include "lastfmplugin.h"
#include "utils/tomahawkutils.h"
#include "resolvers/qtscriptresolver.h"
#include "AtticaManager.h"

View File

@@ -28,7 +28,7 @@
#include "audio/audioengine.h"
#include "utils/tomahawkutils.h"
#include "utils/logger.h"
#include "accounts/LastFmAccount.h"
#include "accounts/lastfm/LastFmAccount.h"
#include <lastfm/ws.h>
#include <lastfm/XmlQuery>

View File

@@ -20,7 +20,7 @@
#include "SpotifyAccount.h"
#include "playlist.h"
#include "utils/tomahawkutils.h"
#include "PlaylistUpdaterInterface.h"
#include "playlist/PlaylistUpdaterInterface.h"
#include "sourcelist.h"
#include <QPixmap>

View File

@@ -23,7 +23,7 @@
#include "playlist.h"
#include "utils/tomahawkutils.h"
#include "sourcelist.h"
#include "ResolverAccount.h"
#include "accounts/ResolverAccount.h"
class QTimer;

View File

@@ -0,0 +1,199 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SpotifyConfig</class>
<widget class="QWidget" name="SpotifyConfig">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>397</width>
<height>487</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="icon">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>spotify-logo.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="titleText">
<property name="font">
<font>
<pointsize>16</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Configure your Spotify credentials</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="usernameLabel">
<property name="text">
<string>Username:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="usernameEdit">
<property name="text">
<string>placeholderUsername</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="passwordLabel">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="passwordEdit">
<property name="text">
<string>placeholderPw</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="streamingCheckbox">
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>High Quality Streaming</string>
</property>
<property name="checked">
<bool>STREAMING_DEFAULT</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="spotifyLogo">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>spotifycore-logo.png</pixmap>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>This product uses SPOTIFY(R) CORE but is not endorsed, certified or otherwise approved in any way by Spotify. Spotify is the registered trade mark of the Spotify Group.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -182,10 +182,6 @@ set( libSources
accounts/AccountModel.cpp
accounts/AccountModelFilterProxy.cpp
accounts/ResolverAccount.cpp
accounts/LastFmAccount.cpp
accounts/LastFmConfig.cpp
accounts/SpotifyAccount.cpp
sip/SipPlugin.cpp
sip/SipHandler.cpp
sip/sipinfo.cpp
@@ -250,7 +246,6 @@ set( libSources
infosystem/infosystemworker.cpp
infosystem/infoplugins/generic/echonestplugin.cpp
infosystem/infoplugins/generic/lastfmplugin.cpp
infosystem/infoplugins/generic/chartsplugin.cpp
infosystem/infoplugins/generic/spotifyPlugin.cpp
infosystem/infoplugins/generic/hypemPlugin.cpp
@@ -311,7 +306,6 @@ set( libUI ${libUI}
playlist/queueview.ui
context/ContextWidget.ui
infobar/infobar.ui
accounts/LastFmConfig.ui
)
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/.. ..

View File

@@ -21,8 +21,6 @@
#include "config.h"
#include "sourcelist.h"
#include "ResolverAccount.h"
#include "LastFmAccount.h"
#include "SpotifyAccount.h"
#include <QtCore/QLibrary>
#include <QtCore/QDir>
@@ -61,13 +59,6 @@ AccountManager::AccountManager( QObject *parent )
ResolverAccountFactory* f = new ResolverAccountFactory();
m_accountFactories[ f->factoryId() ] = f;
registerAccountFactoryForFilesystem( f );
LastFmAccountFactory* l = new LastFmAccountFactory();
m_accountFactories[ l->factoryId() ] = l;
SpotifyAccountFactory* s = new SpotifyAccountFactory;
m_accountFactories[ s->factoryId() ] = s;
registerAccountFactoryForFilesystem( s );
}
@@ -77,6 +68,7 @@ AccountManager::~AccountManager()
disconnectAll();
qDeleteAll( m_accounts );
qDeleteAll( m_accountFactories );
}
@@ -360,6 +352,12 @@ AccountManager::registerAccountFactoryForFilesystem( AccountFactory* factory )
}
void
AccountManager::addAccountFactory( AccountFactory* factory )
{
m_accountFactories[ factory->factoryId() ] = factory;
}
void
AccountManager::hookupAccount( Account* account ) const

View File

@@ -76,6 +76,8 @@ public:
*/
void registerAccountFactoryForFilesystem( AccountFactory* factory );
void addAccountFactory( AccountFactory* factory );
public slots:
void connectAll();
void disconnectAll();

View File

@@ -0,0 +1,21 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
</widget>
<pixmapfunction></pixmapfunction>
<connections/>
</ui>

View File

@@ -59,6 +59,8 @@
#include "utils/jspfloader.h"
#include "utils/logger.h"
#include "utils/tomahawkutilsgui.h"
#include "accounts/lastfm/LastFmAccount.h"
#include "accounts/spotify/SpotifyAccount.h"
#include "config.h"
@@ -224,6 +226,14 @@ TomahawkApp::init()
tDebug() << "Init AccountManager.";
m_accountManager = QWeakPointer< Tomahawk::Accounts::AccountManager >( new Tomahawk::Accounts::AccountManager( this ) );
Tomahawk::Accounts::LastFmAccountFactory* lastfmFactory = new Tomahawk::Accounts::LastFmAccountFactory();
m_accountManager.data()->addAccountFactory( lastfmFactory );
Tomahawk::Accounts::SpotifyAccountFactory* spotifyFactory = new Tomahawk::Accounts::SpotifyAccountFactory;
m_accountManager.data()->addAccountFactory( spotifyFactory );
m_accountManager.data()->registerAccountFactoryForFilesystem( spotifyFactory );
Tomahawk::Accounts::AccountManager::instance()->loadFromConfig();
Echonest::Config::instance()->setNetworkAccessManager( TomahawkUtils::nam() );