mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 07:07:05 +02:00
Introduce AccountConfigWidget type for handling errors later on
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
#include "XmppConfigWidget.h"
|
#include "XmppConfigWidget.h"
|
||||||
#include "sip/SipPlugin.h"
|
#include "sip/SipPlugin.h"
|
||||||
#include "XmppInfoPlugin.h"
|
#include "XmppInfoPlugin.h"
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
|
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ XmppAccount::XmppAccount( const QString &accountId )
|
|||||||
setAccountServiceName( "Jabber (XMPP)" );
|
setAccountServiceName( "Jabber (XMPP)" );
|
||||||
setTypes( SipType );
|
setTypes( SipType );
|
||||||
|
|
||||||
m_configWidget = QPointer< QWidget >( new XmppConfigWidget( this, 0 ) );
|
m_configWidget = QPointer< AccountConfigWidget >( new XmppConfigWidget( this, 0 ) );
|
||||||
|
|
||||||
m_onlinePixmap = QPixmap( ":/xmpp-icon.png" );
|
m_onlinePixmap = QPixmap( ":/xmpp-icon.png" );
|
||||||
m_offlinePixmap = QPixmap( ":/xmpp-offline-icon.png" );
|
m_offlinePixmap = QPixmap( ":/xmpp-offline-icon.png" );
|
||||||
|
@@ -73,14 +73,14 @@ public:
|
|||||||
|
|
||||||
SipPlugin* sipPlugin();
|
SipPlugin* sipPlugin();
|
||||||
|
|
||||||
QWidget* configurationWidget() { return m_configWidget.data(); }
|
AccountConfigWidget* configurationWidget() { return m_configWidget.data(); }
|
||||||
QWidget* aclWidget() { return 0; }
|
QWidget* aclWidget() { return 0; }
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
|
|
||||||
virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const;
|
virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QPointer< QWidget > m_configWidget; // so the google wrapper can change the config dialog a bit
|
QPointer< AccountConfigWidget > m_configWidget; // so the google wrapper can change the config dialog a bit
|
||||||
QPointer< XmppSipPlugin > m_xmppSipPlugin;
|
QPointer< XmppSipPlugin > m_xmppSipPlugin;
|
||||||
QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin;
|
QPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin;
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ namespace Accounts
|
|||||||
{
|
{
|
||||||
|
|
||||||
XmppConfigWidget::XmppConfigWidget( XmppAccount* account, QWidget *parent ) :
|
XmppConfigWidget::XmppConfigWidget( XmppAccount* account, QWidget *parent ) :
|
||||||
QWidget( parent ),
|
AccountConfigWidget( parent ),
|
||||||
m_ui( new Ui::XmppConfigWidget ),
|
m_ui( new Ui::XmppConfigWidget ),
|
||||||
m_account( account )
|
m_account( account )
|
||||||
{
|
{
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#define JABBERACCOUNTCONFIGWIDGET_H
|
#define JABBERACCOUNTCONFIGWIDGET_H
|
||||||
|
|
||||||
#include "accounts/AccountDllMacro.h"
|
#include "accounts/AccountDllMacro.h"
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
@@ -39,7 +39,7 @@ class XmppAccount;
|
|||||||
class GoogleWrapper;
|
class GoogleWrapper;
|
||||||
|
|
||||||
|
|
||||||
class ACCOUNTDLLEXPORT XmppConfigWidget : public QWidget
|
class ACCOUNTDLLEXPORT XmppConfigWidget : public AccountConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -68,7 +68,7 @@ public:
|
|||||||
virtual Tomahawk::InfoSystem::InfoPluginPtr infoPlugin() { return Tomahawk::InfoSystem::InfoPluginPtr(); }
|
virtual Tomahawk::InfoSystem::InfoPluginPtr infoPlugin() { return Tomahawk::InfoSystem::InfoPluginPtr(); }
|
||||||
SipPlugin* sipPlugin();
|
SipPlugin* sipPlugin();
|
||||||
|
|
||||||
QWidget* configurationWidget() { return 0; }
|
AccountConfigWidget* configurationWidget() { return 0; }
|
||||||
QWidget* aclWidget() { return 0; }
|
QWidget* aclWidget() { return 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -201,6 +201,7 @@ list(APPEND libSources
|
|||||||
accounts/DelegateConfigWrapper.cpp
|
accounts/DelegateConfigWrapper.cpp
|
||||||
accounts/AccountFactoryWrapper.cpp
|
accounts/AccountFactoryWrapper.cpp
|
||||||
accounts/AccountFactoryWrapperDelegate.cpp
|
accounts/AccountFactoryWrapperDelegate.cpp
|
||||||
|
accounts/AccountConfigWidget.cpp
|
||||||
|
|
||||||
accounts/spotify/SpotifyAccount.cpp
|
accounts/spotify/SpotifyAccount.cpp
|
||||||
accounts/spotify/SpotifyAccountConfig.cpp
|
accounts/spotify/SpotifyAccountConfig.cpp
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
|
|
||||||
#include <QMetaProperty>
|
#include <QMetaProperty>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QUiLoader>
|
#include <QUiLoader>
|
||||||
|
#include <QBoxLayout>
|
||||||
|
|
||||||
Tomahawk::ExternalResolverGui::ExternalResolverGui(const QString& filePath)
|
Tomahawk::ExternalResolverGui::ExternalResolverGui(const QString& filePath)
|
||||||
: Tomahawk::ExternalResolver(filePath)
|
: Tomahawk::ExternalResolver(filePath)
|
||||||
@@ -80,22 +82,29 @@ Tomahawk::ExternalResolverGui::addChildProperties( QObject* widget, QVariantMap&
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
Tomahawk::ExternalResolverGui::widgetFromData( QByteArray& data, QWidget* parent )
|
Tomahawk::ExternalResolverGui::widgetFromData( QByteArray& data, QWidget* parent )
|
||||||
{
|
{
|
||||||
if( data.isEmpty() )
|
if( data.isEmpty() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
AccountConfigWidget* configWidget = new AccountConfigWidget( parent );
|
||||||
|
|
||||||
QUiLoader l;
|
QUiLoader l;
|
||||||
QBuffer b( &data );
|
QBuffer b( &data );
|
||||||
QWidget* w = l.load( &b, parent );
|
QWidget* w = l.load( &b, configWidget );
|
||||||
|
|
||||||
|
// HACK: proper way would be to create a designer plugin for this widget type
|
||||||
|
configWidget->setLayout( new QBoxLayout( QBoxLayout::TopToBottom ) );
|
||||||
|
configWidget->layout()->addWidget( w );
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
w->setContentsMargins( 12, 12, 12, 12 );
|
w->setContentsMargins( 12, 12, 12, 12 );
|
||||||
#else
|
#else
|
||||||
w->setContentsMargins( 6, 6, 6, 6 );
|
w->setContentsMargins( 6, 6, 6, 6 );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return w;
|
return configWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
class AccountConfigWidget;
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
@@ -41,13 +42,13 @@ Q_OBJECT
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ExternalResolverGui( const QString& filePath );
|
ExternalResolverGui( const QString& filePath );
|
||||||
virtual QWidget* configUI() const = 0;
|
virtual AccountConfigWidget* configUI() const = 0;
|
||||||
|
|
||||||
virtual QPixmap icon() const { return QPixmap(); }
|
virtual QPixmap icon() const { return QPixmap(); }
|
||||||
virtual void setIcon( const QPixmap& ) {}
|
virtual void setIcon( const QPixmap& ) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWidget* widgetFromData( QByteArray& data, QWidget* parent = 0 );
|
AccountConfigWidget* widgetFromData( QByteArray& data, QWidget* parent = 0 );
|
||||||
QVariant configMsgFromWidget( QWidget* w );
|
QVariant configMsgFromWidget( QWidget* w );
|
||||||
QByteArray fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images );
|
QByteArray fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images );
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ Account::~Account()
|
|||||||
|
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
Account::configurationWidget()
|
Account::configurationWidget()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class SipPlugin;
|
class SipPlugin;
|
||||||
|
class AccountConfigWidget;
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
@@ -82,7 +83,7 @@ public:
|
|||||||
* Configuration widgets can have a "dataError( bool )" signal to enable/disable the OK button in their wrapper dialogs.
|
* Configuration widgets can have a "dataError( bool )" signal to enable/disable the OK button in their wrapper dialogs.
|
||||||
*/
|
*/
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
virtual QWidget* configurationWidget() = 0;
|
virtual AccountConfigWidget* configurationWidget() = 0;
|
||||||
virtual QWidget* aboutWidget() { return 0; }
|
virtual QWidget* aboutWidget() { return 0; }
|
||||||
virtual QWidget* aclWidget() = 0;
|
virtual QWidget* aclWidget() = 0;
|
||||||
virtual QPixmap icon() const = 0;
|
virtual QPixmap icon() const = 0;
|
||||||
|
24
src/libtomahawk/accounts/AccountConfigWidget.cpp
Normal file
24
src/libtomahawk/accounts/AccountConfigWidget.cpp
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
|
*
|
||||||
|
* Copyright 2013, Dominik Schmidt <domme@tomahawk-player.org>
|
||||||
|
*
|
||||||
|
* Tomahawk 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 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AccountConfigWidget.h"
|
||||||
|
|
||||||
|
AccountConfigWidget::AccountConfigWidget(QWidget *parent) :
|
||||||
|
QWidget(parent)
|
||||||
|
{
|
||||||
|
}
|
33
src/libtomahawk/accounts/AccountConfigWidget.h
Normal file
33
src/libtomahawk/accounts/AccountConfigWidget.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
|
*
|
||||||
|
* Copyright 2013, Dominik Schmidt <domme@tomahawk-player.org>
|
||||||
|
*
|
||||||
|
* Tomahawk 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 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ACCOUNTCONFIGWIDGET_H
|
||||||
|
#define ACCOUNTCONFIGWIDGET_H
|
||||||
|
|
||||||
|
#include "DllMacro.h"
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class DLLEXPORT AccountConfigWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit AccountConfigWidget(QWidget *parent = 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ACCOUNTCONFIGWIDGET_H
|
@@ -16,10 +16,12 @@
|
|||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "DelegateConfigWrapper.h"
|
#include "DelegateConfigWrapper.h"
|
||||||
|
#include "AccountConfigWidget.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
|
||||||
DelegateConfigWrapper::DelegateConfigWrapper( QWidget* conf, QWidget* aboutWidget, const QString& title, QWidget* parent, Qt::WindowFlags flags )
|
DelegateConfigWrapper::DelegateConfigWrapper( AccountConfigWidget* conf, QWidget* aboutWidget, const QString& title, QWidget* parent, Qt::WindowFlags flags )
|
||||||
: QDialog( parent, flags )
|
: QDialog( parent, flags )
|
||||||
, m_widget( conf )
|
, m_widget( conf )
|
||||||
, m_aboutW( aboutWidget )
|
, m_aboutW( aboutWidget )
|
||||||
|
@@ -24,11 +24,13 @@
|
|||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
class AccountConfigWidget;
|
||||||
|
|
||||||
class DelegateConfigWrapper : public QDialog
|
class DelegateConfigWrapper : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
DelegateConfigWrapper( QWidget* conf, QWidget* aboutWidget, const QString& title, QWidget* parent, Qt::WindowFlags flags = 0 );
|
DelegateConfigWrapper( AccountConfigWidget* conf, QWidget* aboutWidget, const QString& title, QWidget* parent, Qt::WindowFlags flags = 0 );
|
||||||
|
|
||||||
~DelegateConfigWrapper() {}
|
~DelegateConfigWrapper() {}
|
||||||
|
|
||||||
@@ -53,7 +55,8 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QDialogButtonBox* m_buttons;
|
QDialogButtonBox* m_buttons;
|
||||||
QWidget* m_widget, *m_aboutW;
|
AccountConfigWidget* m_widget;
|
||||||
|
QWidget* m_aboutW;
|
||||||
QPushButton *m_okButton, *m_deleteButton;
|
QPushButton *m_okButton, *m_deleteButton;
|
||||||
bool m_deleted;
|
bool m_deleted;
|
||||||
};
|
};
|
||||||
|
@@ -181,7 +181,7 @@ ResolverAccount::connectionState() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
ResolverAccount::configurationWidget()
|
ResolverAccount::configurationWidget()
|
||||||
{
|
{
|
||||||
if ( m_resolver.isNull() )
|
if ( m_resolver.isNull() )
|
||||||
|
@@ -71,7 +71,7 @@ public:
|
|||||||
virtual bool isAuthenticated() const;
|
virtual bool isAuthenticated() const;
|
||||||
virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const;
|
virtual Tomahawk::Accounts::Account::ConnectionState connectionState() const;
|
||||||
|
|
||||||
virtual QWidget* configurationWidget();
|
virtual AccountConfigWidget* configurationWidget();
|
||||||
virtual QString errorMessage() const;
|
virtual QString errorMessage() const;
|
||||||
|
|
||||||
virtual void saveConfig();
|
virtual void saveConfig();
|
||||||
|
@@ -137,7 +137,7 @@ LastFmAccount::deauthenticate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
LastFmAccount::configurationWidget()
|
LastFmAccount::configurationWidget()
|
||||||
{
|
{
|
||||||
if ( m_configWidget.isNull() )
|
if ( m_configWidget.isNull() )
|
||||||
|
@@ -81,7 +81,7 @@ public:
|
|||||||
virtual ConnectionState connectionState() const;
|
virtual ConnectionState connectionState() const;
|
||||||
virtual QPixmap icon() const;
|
virtual QPixmap icon() const;
|
||||||
virtual QWidget* aclWidget() { return 0; }
|
virtual QWidget* aclWidget() { return 0; }
|
||||||
virtual QWidget* configurationWidget();
|
virtual AccountConfigWidget* configurationWidget();
|
||||||
virtual void saveConfig();
|
virtual void saveConfig();
|
||||||
|
|
||||||
QString username() const;
|
QString username() const;
|
||||||
|
@@ -39,7 +39,7 @@ using namespace Tomahawk::Accounts;
|
|||||||
|
|
||||||
|
|
||||||
LastFmConfig::LastFmConfig( LastFmAccount* account )
|
LastFmConfig::LastFmConfig( LastFmAccount* account )
|
||||||
: QWidget( 0 )
|
: AccountConfigWidget( 0 )
|
||||||
, m_account( account )
|
, m_account( account )
|
||||||
, m_page( 1 )
|
, m_page( 1 )
|
||||||
, m_lastTimeStamp( 0 )
|
, m_lastTimeStamp( 0 )
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#define LASTFMCONFIG_H
|
#define LASTFMCONFIG_H
|
||||||
|
|
||||||
#include "Query.h"
|
#include "Query.h"
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
#include "database/DatabaseCommand_LoadSocialActions.h"
|
#include "database/DatabaseCommand_LoadSocialActions.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
@@ -34,7 +35,7 @@ namespace Accounts {
|
|||||||
|
|
||||||
class LastFmAccount;
|
class LastFmAccount;
|
||||||
|
|
||||||
class LastFmConfig : public QWidget
|
class LastFmConfig : public AccountConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@@ -1110,7 +1110,7 @@ SpotifyAccount::icon() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
SpotifyAccount::configurationWidget()
|
SpotifyAccount::configurationWidget()
|
||||||
{
|
{
|
||||||
if ( m_configWidget.isNull() )
|
if ( m_configWidget.isNull() )
|
||||||
@@ -1124,7 +1124,7 @@ SpotifyAccount::configurationWidget()
|
|||||||
if ( m_spotifyResolver.isNull() || !m_spotifyResolver.data()->running() )
|
if ( m_spotifyResolver.isNull() || !m_spotifyResolver.data()->running() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return static_cast< QWidget* >( m_configWidget.data() );
|
return static_cast< AccountConfigWidget* >( m_configWidget.data() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ public:
|
|||||||
virtual ~SpotifyAccount();
|
virtual ~SpotifyAccount();
|
||||||
static SpotifyAccount* instance();
|
static SpotifyAccount* instance();
|
||||||
virtual QPixmap icon() const;
|
virtual QPixmap icon() const;
|
||||||
virtual QWidget* configurationWidget();
|
virtual AccountConfigWidget* configurationWidget();
|
||||||
virtual QWidget* aboutWidget();
|
virtual QWidget* aboutWidget();
|
||||||
virtual void saveConfig();
|
virtual void saveConfig();
|
||||||
virtual Attica::Content atticaContent() const;
|
virtual Attica::Content atticaContent() const;
|
||||||
|
@@ -36,7 +36,7 @@ bool InfoSorter( const SpotifyPlaylistInfo* left, const SpotifyPlaylistInfo* rig
|
|||||||
}
|
}
|
||||||
|
|
||||||
SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account )
|
SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account )
|
||||||
: QWidget( 0 )
|
: AccountConfigWidget( 0 )
|
||||||
, m_ui( new Ui::SpotifyConfig )
|
, m_ui( new Ui::SpotifyConfig )
|
||||||
, m_loggedInUser( 0 )
|
, m_loggedInUser( 0 )
|
||||||
, m_account( account )
|
, m_account( account )
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#ifndef SPOTIFYACCOUNTCONFIG_H
|
#ifndef SPOTIFYACCOUNTCONFIG_H
|
||||||
#define SPOTIFYACCOUNTCONFIG_H
|
#define SPOTIFYACCOUNTCONFIG_H
|
||||||
|
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@@ -40,7 +42,7 @@ namespace Accounts
|
|||||||
class SpotifyAccount;
|
class SpotifyAccount;
|
||||||
struct SpotifyPlaylistInfo;
|
struct SpotifyPlaylistInfo;
|
||||||
|
|
||||||
class SpotifyAccountConfig : public QWidget
|
class SpotifyAccountConfig : public AccountConfigWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@@ -25,6 +25,8 @@
|
|||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
|
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
|
|
||||||
#include "network/Servent.h"
|
#include "network/Servent.h"
|
||||||
|
|
||||||
#include "jobview/JobStatusView.h"
|
#include "jobview/JobStatusView.h"
|
||||||
@@ -527,13 +529,13 @@ QtScriptResolver::loadUi()
|
|||||||
if( m.contains( "images" ) )
|
if( m.contains( "images" ) )
|
||||||
uiData = fixDataImagePaths( uiData, compressed, images );
|
uiData = fixDataImagePaths( uiData, compressed, images );
|
||||||
|
|
||||||
m_configWidget = QPointer< QWidget >( widgetFromData( uiData, 0 ) );
|
m_configWidget = QPointer< AccountConfigWidget >( widgetFromData( uiData, 0 ) );
|
||||||
|
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
QtScriptResolver::configUI() const
|
QtScriptResolver::configUI() const
|
||||||
{
|
{
|
||||||
if( m_configWidget.isNull() )
|
if( m_configWidget.isNull() )
|
||||||
|
@@ -134,7 +134,7 @@ public:
|
|||||||
virtual unsigned int weight() const { return m_weight; }
|
virtual unsigned int weight() const { return m_weight; }
|
||||||
virtual unsigned int timeout() const { return m_timeout; }
|
virtual unsigned int timeout() const { return m_timeout; }
|
||||||
|
|
||||||
virtual QWidget* configUI() const;
|
virtual AccountConfigWidget* configUI() const;
|
||||||
virtual void saveConfig();
|
virtual void saveConfig();
|
||||||
|
|
||||||
virtual ExternalResolver::ErrorState error() const;
|
virtual ExternalResolver::ErrorState error() const;
|
||||||
@@ -176,7 +176,7 @@ private:
|
|||||||
ExternalResolver::ErrorState m_error;
|
ExternalResolver::ErrorState m_error;
|
||||||
|
|
||||||
QtScriptResolverHelper* m_resolverHelper;
|
QtScriptResolverHelper* m_resolverHelper;
|
||||||
QPointer< QWidget > m_configWidget;
|
QPointer< AccountConfigWidget > m_configWidget;
|
||||||
QList< QVariant > m_dataWidgets;
|
QList< QVariant > m_dataWidgets;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
#include "SourceList.h"
|
#include "SourceList.h"
|
||||||
|
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
@@ -427,7 +428,7 @@ ScriptResolver::setupConfWidget( const QVariantMap& m )
|
|||||||
|
|
||||||
if ( m.contains( "images" ) )
|
if ( m.contains( "images" ) )
|
||||||
uiData = fixDataImagePaths( uiData, compressed, m[ "images" ].toMap() );
|
uiData = fixDataImagePaths( uiData, compressed, m[ "images" ].toMap() );
|
||||||
m_configWidget = QPointer< QWidget >( widgetFromData( uiData, 0 ) );
|
m_configWidget = QPointer< AccountConfigWidget >( widgetFromData( uiData, 0 ) );
|
||||||
|
|
||||||
emit changed();
|
emit changed();
|
||||||
}
|
}
|
||||||
@@ -514,7 +515,7 @@ ScriptResolver::setIcon( const QPixmap& icon )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWidget*
|
AccountConfigWidget*
|
||||||
ScriptResolver::configUI() const
|
ScriptResolver::configUI() const
|
||||||
{
|
{
|
||||||
if ( m_configWidget.isNull() )
|
if ( m_configWidget.isNull() )
|
||||||
|
@@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
virtual void setIcon( const QPixmap& icon );
|
virtual void setIcon( const QPixmap& icon );
|
||||||
|
|
||||||
virtual QWidget* configUI() const;
|
virtual AccountConfigWidget* configUI() const;
|
||||||
virtual void saveConfig();
|
virtual void saveConfig();
|
||||||
|
|
||||||
virtual ExternalResolver::ErrorState error() const;
|
virtual ExternalResolver::ErrorState error() const;
|
||||||
@@ -87,7 +87,7 @@ private:
|
|||||||
QString m_name;
|
QString m_name;
|
||||||
QPixmap m_icon;
|
QPixmap m_icon;
|
||||||
unsigned int m_weight, m_preference, m_timeout, m_num_restarts;
|
unsigned int m_weight, m_preference, m_timeout, m_num_restarts;
|
||||||
QPointer< QWidget > m_configWidget;
|
QPointer< AccountConfigWidget > m_configWidget;
|
||||||
|
|
||||||
quint32 m_msgsize;
|
quint32 m_msgsize;
|
||||||
QByteArray m_msg;
|
QByteArray m_msg;
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "accounts/Account.h"
|
#include "accounts/Account.h"
|
||||||
#include "accounts/AccountManager.h"
|
#include "accounts/AccountManager.h"
|
||||||
#include "accounts/DelegateConfigWrapper.h"
|
#include "accounts/DelegateConfigWrapper.h"
|
||||||
|
#include "accounts/AccountConfigWidget.h"
|
||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
|
|
||||||
namespace TomahawkUtils
|
namespace TomahawkUtils
|
||||||
|
Reference in New Issue
Block a user