mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
Remove ExternalResolverGui
This abstraction step is not explicitly needed anymore and most of its functionality will be changed/removed/replaced in the following commits.
This commit is contained in:
@@ -82,7 +82,6 @@ set( libGuiSources
|
|||||||
playlist/dynamic/widgets/CollapsibleControls.cpp
|
playlist/dynamic/widgets/CollapsibleControls.cpp
|
||||||
playlist/dynamic/widgets/DynamicSetupWidget.cpp
|
playlist/dynamic/widgets/DynamicSetupWidget.cpp
|
||||||
|
|
||||||
resolvers/ExternalResolverGui.cpp
|
|
||||||
resolvers/ScriptResolver.cpp
|
resolvers/ScriptResolver.cpp
|
||||||
resolvers/JSInfoPlugin.cpp
|
resolvers/JSInfoPlugin.cpp
|
||||||
resolvers/JSInfoSystemHelper.cpp
|
resolvers/JSInfoSystemHelper.cpp
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
#include "database/DatabaseCommand_AllTracks.h"
|
#include "database/DatabaseCommand_AllTracks.h"
|
||||||
#include "database/DatabaseCommand_AddFiles.h"
|
#include "database/DatabaseCommand_AddFiles.h"
|
||||||
#include "filemetadata/MetadataEditor.h"
|
#include "filemetadata/MetadataEditor.h"
|
||||||
#include "resolvers/ExternalResolverGui.h"
|
#include "resolvers/ExternalResolver.h"
|
||||||
#include "resolvers/Resolver.h"
|
#include "resolvers/Resolver.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
#include "AtticaManager.h"
|
#include "AtticaManager.h"
|
||||||
#include "ConfigStorage.h"
|
#include "ConfigStorage.h"
|
||||||
#include "resolvers/ExternalResolver.h"
|
#include "resolvers/ExternalResolver.h"
|
||||||
#include "resolvers/ExternalResolverGui.h"
|
|
||||||
#include "utils/Json.h"
|
#include "utils/Json.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
@@ -352,8 +351,7 @@ ResolverAccount::hookupResolver()
|
|||||||
if ( configuration().contains( "scripts" ) )
|
if ( configuration().contains( "scripts" ) )
|
||||||
additionalPaths = configuration().value( "scripts" ).toStringList();
|
additionalPaths = configuration().value( "scripts" ).toStringList();
|
||||||
|
|
||||||
Tomahawk::ExternalResolver* er = Pipeline::instance()->addScriptResolver( accountId(), mainScriptPath, additionalPaths );
|
m_resolver = Pipeline::instance()->addScriptResolver( accountId(), mainScriptPath, additionalPaths );
|
||||||
m_resolver = QPointer< ExternalResolverGui >( qobject_cast< ExternalResolverGui* >( er ) );
|
|
||||||
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
|
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
|
||||||
|
|
||||||
// What resolver do we have here? Should only be types that are 'real' resolvers
|
// What resolver do we have here? Should only be types that are 'real' resolvers
|
||||||
|
@@ -29,7 +29,7 @@ class QDir;
|
|||||||
|
|
||||||
namespace Tomahawk {
|
namespace Tomahawk {
|
||||||
|
|
||||||
class ExternalResolverGui;
|
class ExternalResolver;
|
||||||
|
|
||||||
namespace Accounts {
|
namespace Accounts {
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ protected:
|
|||||||
ResolverAccount( const QString& accountId, const QString& path, const QVariantHash& initialConfiguration = QVariantHash() );
|
ResolverAccount( const QString& accountId, const QString& path, const QVariantHash& initialConfiguration = QVariantHash() );
|
||||||
void hookupResolver();
|
void hookupResolver();
|
||||||
|
|
||||||
QPointer<ExternalResolverGui> m_resolver;
|
QPointer<ExternalResolver> m_resolver;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init( const QString& path );
|
void init( const QString& path );
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "infosystem/InfoSystem.h"
|
#include "infosystem/InfoSystem.h"
|
||||||
#include "LastFmInfoPlugin.h"
|
#include "LastFmInfoPlugin.h"
|
||||||
#include "resolvers/ExternalResolverGui.h"
|
#include "resolvers/ExternalResolver.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "AtticaManager.h"
|
#include "AtticaManager.h"
|
||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
@@ -286,11 +286,7 @@ LastFmAccount::hookupResolver()
|
|||||||
|
|
||||||
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
|
const AtticaManager::Resolver data = AtticaManager::instance()->resolverData( res.id() );
|
||||||
|
|
||||||
m_resolver = QPointer< ExternalResolverGui >(
|
m_resolver = Pipeline::instance()->addScriptResolver( accountId(), data.scriptPath );
|
||||||
qobject_cast< ExternalResolverGui* >(
|
|
||||||
Pipeline::instance()->addScriptResolver( accountId(), data.scriptPath )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
m_resolver.data()->setIcon( icon() );
|
m_resolver.data()->setIcon( icon() );
|
||||||
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
|
connect( m_resolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
class ExternalResolverGui;
|
class ExternalResolver;
|
||||||
|
|
||||||
namespace InfoSystem
|
namespace InfoSystem
|
||||||
{
|
{
|
||||||
@@ -104,7 +104,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
void hookupResolver();
|
void hookupResolver();
|
||||||
|
|
||||||
QPointer<Tomahawk::ExternalResolverGui> m_resolver;
|
QPointer<Tomahawk::ExternalResolver> m_resolver;
|
||||||
QPointer<Tomahawk::InfoSystem::LastFmInfoPlugin> m_infoPlugin;
|
QPointer<Tomahawk::InfoSystem::LastFmInfoPlugin> m_infoPlugin;
|
||||||
QPointer<LastFmConfig> m_configWidget;
|
QPointer<LastFmConfig> m_configWidget;
|
||||||
};
|
};
|
||||||
|
@@ -18,11 +18,120 @@
|
|||||||
|
|
||||||
#include "ExternalResolver.h"
|
#include "ExternalResolver.h"
|
||||||
|
|
||||||
#include "PlaylistEntry.h"
|
#include "accounts/AccountConfigWidget.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "PlaylistEntry.h"
|
||||||
|
|
||||||
|
#include <QBoxLayout>
|
||||||
|
#include <QBuffer>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QMetaProperty>
|
||||||
|
#include <QUiLoader>
|
||||||
|
|
||||||
Tomahawk::ExternalResolver::ErrorState
|
Tomahawk::ExternalResolver::ErrorState
|
||||||
Tomahawk::ExternalResolver::error() const
|
Tomahawk::ExternalResolver::error() const
|
||||||
{
|
{
|
||||||
return NoError;
|
return NoError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QVariant
|
||||||
|
Tomahawk::ExternalResolver::configMsgFromWidget( QWidget* w )
|
||||||
|
{
|
||||||
|
if( !w )
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
|
// generate a qvariantmap of all the widgets in the hierarchy, and for each one include the list of properties and values
|
||||||
|
QVariantMap widgetMap;
|
||||||
|
addChildProperties( w, widgetMap );
|
||||||
|
// qDebug() << "Generated widget variant:" << widgetMap;
|
||||||
|
return widgetMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Tomahawk::ExternalResolver::addChildProperties( QObject* widget, QVariantMap& m )
|
||||||
|
{
|
||||||
|
// recursively add all properties of this widget to the map, then repeat on all children.
|
||||||
|
// bare QWidgets are boring---so skip them! They have no input that the user can set.
|
||||||
|
if( !widget || !widget->isWidgetType() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( qstrcmp( widget->metaObject()->className(), "QWidget" ) != 0 )
|
||||||
|
{
|
||||||
|
// qDebug() << "Adding properties for this:" << widget->metaObject()->className();
|
||||||
|
// add this widget's properties
|
||||||
|
QVariantMap props;
|
||||||
|
for( int i = 0; i < widget->metaObject()->propertyCount(); i++ )
|
||||||
|
{
|
||||||
|
QString prop = widget->metaObject()->property( i ).name();
|
||||||
|
QVariant val = widget->property( prop.toLatin1() );
|
||||||
|
// clean up for QJson....
|
||||||
|
if( val.canConvert< QPixmap >() || val.canConvert< QImage >() || val.canConvert< QIcon >() )
|
||||||
|
continue;
|
||||||
|
props[ prop ] = val.toString();
|
||||||
|
// qDebug() << QString( "%1: %2" ).arg( prop ).arg( props[ prop ].toString() );
|
||||||
|
}
|
||||||
|
m[ widget->objectName() ] = props;
|
||||||
|
}
|
||||||
|
// and recurse
|
||||||
|
foreach( QObject* child, widget->children() )
|
||||||
|
addChildProperties( child, m );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AccountConfigWidget*
|
||||||
|
Tomahawk::ExternalResolver::widgetFromData( QByteArray& data, QWidget* parent )
|
||||||
|
{
|
||||||
|
if( data.isEmpty() )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
AccountConfigWidget* configWidget = new AccountConfigWidget( parent );
|
||||||
|
|
||||||
|
QUiLoader l;
|
||||||
|
QBuffer b( &data );
|
||||||
|
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
|
||||||
|
w->setContentsMargins( 12, 12, 12, 12 );
|
||||||
|
#else
|
||||||
|
w->setContentsMargins( 6, 6, 6, 6 );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return configWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QByteArray
|
||||||
|
Tomahawk::ExternalResolver::fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images )
|
||||||
|
{
|
||||||
|
// with a list of images and image data, write each to a temp file, replace the path in the .ui file with the temp file path
|
||||||
|
QString uiFile = QString::fromUtf8( data );
|
||||||
|
foreach( const QString& filename, images.keys() )
|
||||||
|
{
|
||||||
|
if( !uiFile.contains( filename ) ) // make sure the image is used
|
||||||
|
continue;
|
||||||
|
|
||||||
|
QString fullPath = QDir::tempPath() + "/" + filename;
|
||||||
|
QFile imgF( fullPath );
|
||||||
|
if( !imgF.open( QIODevice::WriteOnly ) )
|
||||||
|
{
|
||||||
|
qWarning() << "Failed to write to temporary image in UI file:" << filename << fullPath;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QByteArray data = images[ filename ].toByteArray();
|
||||||
|
|
||||||
|
// qDebug() << "expanding data:" << data << compressed;
|
||||||
|
data = compressed ? qUncompress( QByteArray::fromBase64( data ) ) : QByteArray::fromBase64( data );
|
||||||
|
imgF.write( data );
|
||||||
|
imgF.close();
|
||||||
|
|
||||||
|
// replace the path to the image with the real path
|
||||||
|
uiFile.replace( filename, fullPath );
|
||||||
|
}
|
||||||
|
return uiFile.toUtf8();
|
||||||
|
}
|
||||||
|
@@ -105,6 +105,8 @@ public:
|
|||||||
virtual void enqueue( const QSharedPointer< ScriptCommand >& req )
|
virtual void enqueue( const QSharedPointer< ScriptCommand >& req )
|
||||||
{ m_commandQueue->enqueue( req ); }
|
{ m_commandQueue->enqueue( req ); }
|
||||||
|
|
||||||
|
virtual AccountConfigWidget* configUI() const = 0;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void start() = 0;
|
virtual void start() = 0;
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
@@ -132,8 +134,15 @@ protected:
|
|||||||
// UrlLookup
|
// UrlLookup
|
||||||
virtual void lookupUrl( const QString& url ) = 0;
|
virtual void lookupUrl( const QString& url ) = 0;
|
||||||
|
|
||||||
|
AccountConfigWidget* widgetFromData( QByteArray& data, QWidget* parent = 0 );
|
||||||
|
QVariant configMsgFromWidget( QWidget* w );
|
||||||
|
QByteArray fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images );
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_filePath;
|
QString m_filePath;
|
||||||
|
|
||||||
|
void addChildProperties( QObject* parent, QVariantMap& m );
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( ExternalResolver::Capabilities )
|
Q_DECLARE_OPERATORS_FOR_FLAGS( ExternalResolver::Capabilities )
|
||||||
|
@@ -1,139 +0,0 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
|
||||||
*
|
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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 "ExternalResolverGui.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include "Source.h"
|
|
||||||
#include "utils/Logger.h"
|
|
||||||
#include "accounts/AccountConfigWidget.h"
|
|
||||||
|
|
||||||
#include <QMetaProperty>
|
|
||||||
#include <QBuffer>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QIcon>
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QUiLoader>
|
|
||||||
#include <QBoxLayout>
|
|
||||||
|
|
||||||
Tomahawk::ExternalResolverGui::ExternalResolverGui(const QString& filePath)
|
|
||||||
: Tomahawk::ExternalResolver(filePath)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QVariant
|
|
||||||
Tomahawk::ExternalResolverGui::configMsgFromWidget( QWidget* w )
|
|
||||||
{
|
|
||||||
if( !w )
|
|
||||||
return QVariant();
|
|
||||||
|
|
||||||
// generate a qvariantmap of all the widgets in the hierarchy, and for each one include the list of properties and values
|
|
||||||
QVariantMap widgetMap;
|
|
||||||
addChildProperties( w, widgetMap );
|
|
||||||
// qDebug() << "Generated widget variant:" << widgetMap;
|
|
||||||
return widgetMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
Tomahawk::ExternalResolverGui::addChildProperties( QObject* widget, QVariantMap& m )
|
|
||||||
{
|
|
||||||
// recursively add all properties of this widget to the map, then repeat on all children.
|
|
||||||
// bare QWidgets are boring---so skip them! They have no input that the user can set.
|
|
||||||
if( !widget || !widget->isWidgetType() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( qstrcmp( widget->metaObject()->className(), "QWidget" ) != 0 )
|
|
||||||
{
|
|
||||||
// qDebug() << "Adding properties for this:" << widget->metaObject()->className();
|
|
||||||
// add this widget's properties
|
|
||||||
QVariantMap props;
|
|
||||||
for( int i = 0; i < widget->metaObject()->propertyCount(); i++ )
|
|
||||||
{
|
|
||||||
QString prop = widget->metaObject()->property( i ).name();
|
|
||||||
QVariant val = widget->property( prop.toLatin1() );
|
|
||||||
// clean up for QJson....
|
|
||||||
if( val.canConvert< QPixmap >() || val.canConvert< QImage >() || val.canConvert< QIcon >() )
|
|
||||||
continue;
|
|
||||||
props[ prop ] = val.toString();
|
|
||||||
// qDebug() << QString( "%1: %2" ).arg( prop ).arg( props[ prop ].toString() );
|
|
||||||
}
|
|
||||||
m[ widget->objectName() ] = props;
|
|
||||||
}
|
|
||||||
// and recurse
|
|
||||||
foreach( QObject* child, widget->children() )
|
|
||||||
addChildProperties( child, m );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AccountConfigWidget*
|
|
||||||
Tomahawk::ExternalResolverGui::widgetFromData( QByteArray& data, QWidget* parent )
|
|
||||||
{
|
|
||||||
if( data.isEmpty() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
AccountConfigWidget* configWidget = new AccountConfigWidget( parent );
|
|
||||||
|
|
||||||
QUiLoader l;
|
|
||||||
QBuffer b( &data );
|
|
||||||
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
|
|
||||||
w->setContentsMargins( 12, 12, 12, 12 );
|
|
||||||
#else
|
|
||||||
w->setContentsMargins( 6, 6, 6, 6 );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return configWidget;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QByteArray
|
|
||||||
Tomahawk::ExternalResolverGui::fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images )
|
|
||||||
{
|
|
||||||
// with a list of images and image data, write each to a temp file, replace the path in the .ui file with the temp file path
|
|
||||||
QString uiFile = QString::fromUtf8( data );
|
|
||||||
foreach( const QString& filename, images.keys() )
|
|
||||||
{
|
|
||||||
if( !uiFile.contains( filename ) ) // make sure the image is used
|
|
||||||
continue;
|
|
||||||
|
|
||||||
QString fullPath = QDir::tempPath() + "/" + filename;
|
|
||||||
QFile imgF( fullPath );
|
|
||||||
if( !imgF.open( QIODevice::WriteOnly ) )
|
|
||||||
{
|
|
||||||
qWarning() << "Failed to write to temporary image in UI file:" << filename << fullPath;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
QByteArray data = images[ filename ].toByteArray();
|
|
||||||
|
|
||||||
// qDebug() << "expanding data:" << data << compressed;
|
|
||||||
data = compressed ? qUncompress( QByteArray::fromBase64( data ) ) : QByteArray::fromBase64( data );
|
|
||||||
imgF.write( data );
|
|
||||||
imgF.close();
|
|
||||||
|
|
||||||
// replace the path to the image with the real path
|
|
||||||
uiFile.replace( filename, fullPath );
|
|
||||||
}
|
|
||||||
return uiFile.toUtf8();
|
|
||||||
}
|
|
@@ -1,58 +0,0 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
|
||||||
*
|
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@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 EXTERNALRESOLVERGUI_H
|
|
||||||
#define EXTERNALRESOLVERGUI_H
|
|
||||||
|
|
||||||
#include "ExternalResolver.h"
|
|
||||||
#include "DllMacro.h"
|
|
||||||
|
|
||||||
#include <QPixmap>
|
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
class AccountConfigWidget;
|
|
||||||
|
|
||||||
namespace Tomahawk
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generic resolver object, used to manage a resolver that Tomahawk knows about
|
|
||||||
*
|
|
||||||
* You *must* start() a resolver after creating an ExternalResolver in order to use it,
|
|
||||||
* otherwise it will not do anything.
|
|
||||||
*/
|
|
||||||
class DLLEXPORT ExternalResolverGui : public ExternalResolver
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
ExternalResolverGui( const QString& filePath );
|
|
||||||
virtual AccountConfigWidget* configUI() const = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
AccountConfigWidget* widgetFromData( QByteArray& data, QWidget* parent = 0 );
|
|
||||||
QVariant configMsgFromWidget( QWidget* w );
|
|
||||||
QByteArray fixDataImagePaths( const QByteArray& data, bool compressed, const QVariantMap& images );
|
|
||||||
|
|
||||||
private:
|
|
||||||
void addChildProperties( QObject* parent, QVariantMap& m );
|
|
||||||
};
|
|
||||||
|
|
||||||
}; //ns
|
|
||||||
|
|
||||||
#endif // RESOLVER_H
|
|
@@ -57,7 +57,7 @@
|
|||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
JSResolver::JSResolver( const QString& accountId, const QString& scriptPath, const QStringList& additionalScriptPaths )
|
JSResolver::JSResolver( const QString& accountId, const QString& scriptPath, const QStringList& additionalScriptPaths )
|
||||||
: Tomahawk::ExternalResolverGui( scriptPath )
|
: Tomahawk::ExternalResolver( scriptPath )
|
||||||
, d_ptr( new JSResolverPrivate( this, accountId, scriptPath, additionalScriptPaths ) )
|
, d_ptr( new JSResolverPrivate( this, accountId, scriptPath, additionalScriptPaths ) )
|
||||||
{
|
{
|
||||||
Q_D( JSResolver );
|
Q_D( JSResolver );
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
#include "ExternalResolverGui.h"
|
#include "ExternalResolver.h"
|
||||||
#include "Typedefs.h"
|
#include "Typedefs.h"
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
@@ -35,7 +35,7 @@ class JSResolverHelper;
|
|||||||
class JSResolverPrivate;
|
class JSResolverPrivate;
|
||||||
class ScriptEngine;
|
class ScriptEngine;
|
||||||
|
|
||||||
class DLLEXPORT JSResolver : public Tomahawk::ExternalResolverGui
|
class DLLEXPORT JSResolver : public Tomahawk::ExternalResolver
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ private:
|
|||||||
QString name;
|
QString name;
|
||||||
QPixmap icon;
|
QPixmap icon;
|
||||||
unsigned int weight, timeout;
|
unsigned int weight, timeout;
|
||||||
Tomahawk::ExternalResolverGui::Capabilities capabilities;
|
Tomahawk::ExternalResolver::Capabilities capabilities;
|
||||||
|
|
||||||
bool ready;
|
bool ready;
|
||||||
bool stopped;
|
bool stopped;
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
#include "ScriptCollection.h"
|
#include "ScriptCollection.h"
|
||||||
|
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
#include "ExternalResolverGui.h"
|
#include "ExternalResolver.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "resolvers/ScriptCommand_AllArtists.h"
|
#include "resolvers/ScriptCommand_AllArtists.h"
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include "ScriptResolver.h"
|
#include "ScriptResolver.h"
|
||||||
|
|
||||||
#include "accounts/AccountConfigWidget.h"
|
#include "accounts/AccountConfigWidget.h"
|
||||||
|
#include "utils/TomahawkUtils.h"
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Json.h"
|
#include "utils/Json.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@@ -47,7 +48,7 @@
|
|||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
ScriptResolver::ScriptResolver( const QString& exe )
|
ScriptResolver::ScriptResolver( const QString& exe )
|
||||||
: Tomahawk::ExternalResolverGui( exe )
|
: Tomahawk::ExternalResolver( exe )
|
||||||
, m_num_restarts( 0 )
|
, m_num_restarts( 0 )
|
||||||
, m_msgsize( 0 )
|
, m_msgsize( 0 )
|
||||||
, m_ready( false )
|
, m_ready( false )
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
#include "Artist.h"
|
#include "Artist.h"
|
||||||
#include "Album.h"
|
#include "Album.h"
|
||||||
#include "collection/Collection.h"
|
#include "collection/Collection.h"
|
||||||
#include "ExternalResolverGui.h"
|
#include "ExternalResolver.h"
|
||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
@@ -35,7 +35,7 @@ class QWidget;
|
|||||||
namespace Tomahawk
|
namespace Tomahawk
|
||||||
{
|
{
|
||||||
|
|
||||||
class DLLEXPORT ScriptResolver : public Tomahawk::ExternalResolverGui
|
class DLLEXPORT ScriptResolver : public Tomahawk::ExternalResolver
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -36,7 +36,6 @@
|
|||||||
#include "accounts/DelegateConfigWrapper.h"
|
#include "accounts/DelegateConfigWrapper.h"
|
||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
#include "resolvers/Resolver.h"
|
#include "resolvers/Resolver.h"
|
||||||
#include "resolvers/ExternalResolverGui.h"
|
|
||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/GuiHelpers.h"
|
#include "utils/GuiHelpers.h"
|
||||||
#include "accounts/AccountDelegate.h"
|
#include "accounts/AccountDelegate.h"
|
||||||
|
Reference in New Issue
Block a user