mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
WIP: headless: compiles and links :)
This commit is contained in:
@@ -211,4 +211,6 @@ ADD_SUBDIRECTORY( src/libtomahawk )
|
|||||||
SET( TOMAHAWK_LIBRARIES tomahawklib )
|
SET( TOMAHAWK_LIBRARIES tomahawklib )
|
||||||
ADD_SUBDIRECTORY( src )
|
ADD_SUBDIRECTORY( src )
|
||||||
ADD_SUBDIRECTORY( admin )
|
ADD_SUBDIRECTORY( admin )
|
||||||
|
IF(BUILD_GUI)
|
||||||
ADD_SUBDIRECTORY( src/breakpad/CrashReporter )
|
ADD_SUBDIRECTORY( src/breakpad/CrashReporter )
|
||||||
|
ENDIF()
|
||||||
|
@@ -97,8 +97,8 @@ IF(LIBLASTFM_FOUND)
|
|||||||
ENDIF(LIBLASTFM_FOUND)
|
ENDIF(LIBLASTFM_FOUND)
|
||||||
|
|
||||||
IF(LIBATTICA_FOUND)
|
IF(LIBATTICA_FOUND)
|
||||||
SET( tomahawkSources ${tomahawkSources} GetNewStuffDialog.cpp GetNewStuffDelegate.cpp GetNewStuffModel.cpp )
|
SET( tomahawkSourcesGui ${tomahawkSourcesGui} GetNewStuffDialog.cpp GetNewStuffDelegate.cpp GetNewStuffModel.cpp )
|
||||||
SET( tomahawkHeaders ${tomahawkHeaders} GetNewStuffDialog.h GetNewStuffDelegate.h GetNewStuffModel.h )
|
SET( tomahawkHeadersGui ${tomahawkHeadersGui} GetNewStuffDialog.h GetNewStuffDelegate.h GetNewStuffModel.h )
|
||||||
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
|
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
|
||||||
ENDIF(LIBATTICA_FOUND)
|
ENDIF(LIBATTICA_FOUND)
|
||||||
|
|
||||||
@@ -200,10 +200,6 @@ IF(QCA2_FOUND)
|
|||||||
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
|
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
|
||||||
ENDIF(QCA2_FOUND)
|
ENDIF(QCA2_FOUND)
|
||||||
|
|
||||||
kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
|
|
||||||
qt4_add_resources( RC_SRCS "../resources.qrc" )
|
|
||||||
qt4_wrap_cpp( tomahawkMoc ${tomahawkHeaders} )
|
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
@@ -211,13 +207,17 @@ include( ${CMAKE_SOURCE_DIR}/lang/translations.cmake )
|
|||||||
|
|
||||||
SET( final_src ${final_src} ${tomahawkMoc} ${tomahawkSources} ${tomahawkHeaders} ${trans_outfile})
|
SET( final_src ${final_src} ${tomahawkMoc} ${tomahawkSources} ${tomahawkHeaders} ${trans_outfile})
|
||||||
|
|
||||||
IF( "${gui}" STREQUAL "no" )
|
IF( BUILD_GUI )
|
||||||
ELSE()
|
LIST(APPEND tomahawkHeaders ${tomahawkHeadersGui})
|
||||||
|
LIST(APPEND tomahawkSources ${tomahawkSourcesGui})
|
||||||
qt4_wrap_ui( tomahawkUI_H ${tomahawkUI} )
|
qt4_wrap_ui( tomahawkUI_H ${tomahawkUI} )
|
||||||
qt4_wrap_cpp( tomahawkMocGui ${tomahawkHeadersGui} )
|
|
||||||
SET( final_src ${final_src} ${tomahawkUI_H} ${tomahawkMocGui} ${tomahawkSourcesGui} ${RC_SRCS} )
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
kde4_add_app_icon( tomahawkSources "${CMAKE_SOURCE_DIR}/data/icons/tomahawk-icon-*.png" )
|
||||||
|
qt4_add_resources( RC_SRCS "../resources.qrc" )
|
||||||
|
qt4_wrap_cpp( tomahawkMoc ${tomahawkHeaders} )
|
||||||
|
SET( final_src ${final_src} ${tomahawkUI_H} ${tomahawkMoc} ${tomahawkSources} ${RC_SRCS} )
|
||||||
|
|
||||||
IF( UNIX AND NOT APPLE )
|
IF( UNIX AND NOT APPLE )
|
||||||
ADD_EXECUTABLE( tomahawk ${final_src} )
|
ADD_EXECUTABLE( tomahawk ${final_src} )
|
||||||
ENDIF( UNIX AND NOT APPLE )
|
ENDIF( UNIX AND NOT APPLE )
|
||||||
|
@@ -35,9 +35,6 @@ set( libGuiSources
|
|||||||
|
|
||||||
infobar/infobar.cpp
|
infobar/infobar.cpp
|
||||||
|
|
||||||
infosystem/infosystemcache.cpp
|
|
||||||
infosystem/infosystem.cpp
|
|
||||||
infosystem/infosystemworker.cpp
|
|
||||||
infosystem/infoplugins/generic/echonestplugin.cpp
|
infosystem/infoplugins/generic/echonestplugin.cpp
|
||||||
infosystem/infoplugins/generic/lastfmplugin.cpp
|
infosystem/infoplugins/generic/lastfmplugin.cpp
|
||||||
infosystem/infoplugins/generic/chartsplugin.cpp
|
infosystem/infoplugins/generic/chartsplugin.cpp
|
||||||
@@ -74,16 +71,10 @@ set( libGuiSources
|
|||||||
playlist/artistview.cpp
|
playlist/artistview.cpp
|
||||||
playlist/customplaylistview.cpp
|
playlist/customplaylistview.cpp
|
||||||
playlist/ViewHeader.cpp
|
playlist/ViewHeader.cpp
|
||||||
playlist/PlaylistUpdaterInterface.cpp
|
|
||||||
playlist/XspfUpdater.cpp
|
|
||||||
|
|
||||||
playlist/dynamic/DynamicPlaylist.cpp
|
playlist/dynamic/DynamicPlaylist.cpp
|
||||||
playlist/dynamic/DynamicControl.cpp
|
|
||||||
playlist/dynamic/GeneratorFactory.cpp
|
|
||||||
playlist/dynamic/GeneratorInterface.cpp
|
|
||||||
playlist/dynamic/DynamicView.cpp
|
playlist/dynamic/DynamicView.cpp
|
||||||
playlist/dynamic/DynamicModel.cpp
|
playlist/dynamic/DynamicModel.cpp
|
||||||
playlist/dynamic/DynamicPlaylistRevision.cpp
|
|
||||||
playlist/dynamic/echonest/EchonestGenerator.cpp
|
playlist/dynamic/echonest/EchonestGenerator.cpp
|
||||||
playlist/dynamic/echonest/EchonestControl.cpp
|
playlist/dynamic/echonest/EchonestControl.cpp
|
||||||
playlist/dynamic/echonest/EchonestSteerer.cpp
|
playlist/dynamic/echonest/EchonestSteerer.cpp
|
||||||
@@ -95,8 +86,6 @@ set( libGuiSources
|
|||||||
playlist/dynamic/widgets/CollapsibleControls.cpp
|
playlist/dynamic/widgets/CollapsibleControls.cpp
|
||||||
playlist/dynamic/widgets/DynamicSetupWidget.cpp
|
playlist/dynamic/widgets/DynamicSetupWidget.cpp
|
||||||
playlist/dynamic/widgets/LoadingSpinner.cpp
|
playlist/dynamic/widgets/LoadingSpinner.cpp
|
||||||
playlist/dynamic/database/DatabaseControl.cpp
|
|
||||||
playlist/dynamic/database/DatabaseGenerator.cpp
|
|
||||||
|
|
||||||
playlist/topbar/topbar.cpp
|
playlist/topbar/topbar.cpp
|
||||||
playlist/topbar/clearbutton.cpp
|
playlist/topbar/clearbutton.cpp
|
||||||
@@ -104,10 +93,12 @@ set( libGuiSources
|
|||||||
playlist/topbar/lineedit.cpp
|
playlist/topbar/lineedit.cpp
|
||||||
playlist/topbar/searchbutton.cpp
|
playlist/topbar/searchbutton.cpp
|
||||||
|
|
||||||
|
resolvers/scriptresolver.cpp
|
||||||
|
resolvers/qtscriptresolver.cpp
|
||||||
|
|
||||||
sip/SipModel.cpp
|
sip/SipModel.cpp
|
||||||
|
|
||||||
utils/widgetdragfilter.cpp
|
utils/widgetdragfilter.cpp
|
||||||
utils/xspfloader.cpp
|
|
||||||
utils/xspfgenerator.cpp
|
utils/xspfgenerator.cpp
|
||||||
utils/jspfloader.cpp
|
utils/jspfloader.cpp
|
||||||
utils/spotifyparser.cpp
|
utils/spotifyparser.cpp
|
||||||
@@ -161,9 +152,6 @@ set( libGuiHeaders
|
|||||||
|
|
||||||
infobar/infobar.h
|
infobar/infobar.h
|
||||||
|
|
||||||
infosystem/infosystem.h
|
|
||||||
infosystem/infosystemworker.h
|
|
||||||
infosystem/infosystemcache.h
|
|
||||||
infosystem/infoplugins/generic/echonestplugin.h
|
infosystem/infoplugins/generic/echonestplugin.h
|
||||||
infosystem/infoplugins/generic/lastfmplugin.h
|
infosystem/infoplugins/generic/lastfmplugin.h
|
||||||
infosystem/infoplugins/generic/chartsplugin.h
|
infosystem/infoplugins/generic/chartsplugin.h
|
||||||
@@ -207,11 +195,8 @@ set( libGuiHeaders
|
|||||||
playlist/artistview.h
|
playlist/artistview.h
|
||||||
playlist/customplaylistview.h
|
playlist/customplaylistview.h
|
||||||
playlist/ViewHeader.h
|
playlist/ViewHeader.h
|
||||||
playlist/PlaylistUpdaterInterface.h
|
|
||||||
playlist/XspfUpdater.h
|
|
||||||
|
|
||||||
playlist/dynamic/DynamicPlaylist.h
|
playlist/dynamic/DynamicPlaylist.h
|
||||||
playlist/dynamic/DynamicControl.h
|
|
||||||
playlist/dynamic/GeneratorInterface.h
|
playlist/dynamic/GeneratorInterface.h
|
||||||
playlist/dynamic/DynamicView.h
|
playlist/dynamic/DynamicView.h
|
||||||
playlist/dynamic/DynamicModel.h
|
playlist/dynamic/DynamicModel.h
|
||||||
@@ -226,19 +211,19 @@ set( libGuiHeaders
|
|||||||
playlist/dynamic/widgets/CollapsibleControls.h
|
playlist/dynamic/widgets/CollapsibleControls.h
|
||||||
playlist/dynamic/widgets/DynamicSetupWidget.h
|
playlist/dynamic/widgets/DynamicSetupWidget.h
|
||||||
playlist/dynamic/widgets/LoadingSpinner.h
|
playlist/dynamic/widgets/LoadingSpinner.h
|
||||||
playlist/dynamic/database/DatabaseControl.h
|
|
||||||
playlist/dynamic/database/DatabaseGenerator.h
|
resolvers/scriptresolver.h
|
||||||
|
resolvers/qtscriptresolver.h
|
||||||
|
|
||||||
sip/SipModel.h
|
sip/SipModel.h
|
||||||
|
|
||||||
utils/widgetdragfilter.h
|
utils/widgetdragfilter.h
|
||||||
utils/xspfloader.h
|
|
||||||
utils/xspfgenerator.h
|
utils/xspfgenerator.h
|
||||||
utils/jspfloader.h
|
utils/jspfloader.h
|
||||||
utils/spotifyparser.h
|
utils/spotifyparser.h
|
||||||
utils/itunesparser.h
|
utils/itunesparser.h
|
||||||
utils/rdioparser.h
|
utils/rdioparser.h
|
||||||
utils/shortenedlinkparser.h
|
utils/shortenedlinkparser.h
|
||||||
utils/qnr_iodevicestream.h
|
|
||||||
utils/dropjobnotifier.h
|
utils/dropjobnotifier.h
|
||||||
|
|
||||||
widgets/checkdirtree.h
|
widgets/checkdirtree.h
|
||||||
@@ -361,8 +346,9 @@ set( libSources
|
|||||||
database/databasecommand_settrackattributes.cpp
|
database/databasecommand_settrackattributes.cpp
|
||||||
database/database.cpp
|
database/database.cpp
|
||||||
|
|
||||||
resolvers/scriptresolver.cpp
|
infosystem/infosystem.cpp
|
||||||
resolvers/qtscriptresolver.cpp
|
infosystem/infosystemcache.cpp
|
||||||
|
infosystem/infosystemworker.cpp
|
||||||
|
|
||||||
network/bufferiodevice.cpp
|
network/bufferiodevice.cpp
|
||||||
network/msgprocessor.cpp
|
network/msgprocessor.cpp
|
||||||
@@ -374,9 +360,20 @@ set( libSources
|
|||||||
network/connection.cpp
|
network/connection.cpp
|
||||||
network/controlconnection.cpp
|
network/controlconnection.cpp
|
||||||
|
|
||||||
|
playlist/PlaylistUpdaterInterface.cpp
|
||||||
|
playlist/dynamic/DynamicPlaylist.cpp
|
||||||
|
playlist/dynamic/GeneratorFactory.cpp
|
||||||
|
playlist/dynamic/GeneratorInterface.cpp
|
||||||
|
playlist/dynamic/DynamicPlaylistRevision.cpp
|
||||||
|
playlist/XspfUpdater.cpp
|
||||||
|
playlist/dynamic/database/DatabaseGenerator.cpp
|
||||||
|
playlist/dynamic/database/DatabaseControl.cpp
|
||||||
|
playlist/dynamic/DynamicControl.cpp
|
||||||
|
|
||||||
utils/tomahawkutils.cpp
|
utils/tomahawkutils.cpp
|
||||||
utils/logger.cpp
|
utils/logger.cpp
|
||||||
utils/qnr_iodevicestream.cpp
|
utils/qnr_iodevicestream.cpp
|
||||||
|
utils/xspfloader.cpp
|
||||||
|
|
||||||
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp
|
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp
|
||||||
thirdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp
|
thirdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp
|
||||||
@@ -463,6 +460,11 @@ set( libHeaders
|
|||||||
database/databasecommand_trackattributes.h
|
database/databasecommand_trackattributes.h
|
||||||
database/databasecommand_settrackattributes.h
|
database/databasecommand_settrackattributes.h
|
||||||
|
|
||||||
|
infosystem/infosystem.h
|
||||||
|
infosystem/infosystem.h
|
||||||
|
infosystem/infosystemworker.h
|
||||||
|
infosystem/infosystemcache.h
|
||||||
|
|
||||||
network/bufferiodevice.h
|
network/bufferiodevice.h
|
||||||
network/msgprocessor.h
|
network/msgprocessor.h
|
||||||
network/remotecollection.h
|
network/remotecollection.h
|
||||||
@@ -473,18 +475,24 @@ set( libHeaders
|
|||||||
network/controlconnection.h
|
network/controlconnection.h
|
||||||
network/portfwdthread.h
|
network/portfwdthread.h
|
||||||
|
|
||||||
resolvers/scriptresolver.h
|
playlist/PlaylistUpdaterInterface.h
|
||||||
resolvers/qtscriptresolver.h
|
playlist/dynamic/DynamicPlaylist.h
|
||||||
|
playlist/dynamic/GeneratorInterface.h
|
||||||
|
playlist/dynamic/GeneratorFactory.h
|
||||||
|
playlist/XspfUpdater.h
|
||||||
|
playlist/dynamic/database/DatabaseGenerator.h
|
||||||
|
playlist/dynamic/database/DatabaseControl.h
|
||||||
|
playlist/dynamic/DynamicControl.h
|
||||||
|
|
||||||
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h
|
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h
|
||||||
|
|
||||||
|
utils/xspfloader.h
|
||||||
|
utils/qnr_iodevicestream.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set( libHeaders_NoMOC
|
set( libHeaders_NoMOC
|
||||||
infosystem/infoplugins/unix/imageconverter.h
|
infosystem/infoplugins/unix/imageconverter.h
|
||||||
|
|
||||||
playlist/dynamic/GeneratorInterface.h
|
|
||||||
playlist/dynamic/GeneratorFactory.h
|
|
||||||
|
|
||||||
utils/tomahawkutils.h
|
utils/tomahawkutils.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -132,6 +132,7 @@ DatabaseCollection::stations()
|
|||||||
void
|
void
|
||||||
DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QVariantList& data )
|
DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QVariantList& data )
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
dynplaylist_ptr p( new DynamicPlaylist( source, //src
|
dynplaylist_ptr p( new DynamicPlaylist( source, //src
|
||||||
data[0].toString(), //current rev
|
data[0].toString(), //current rev
|
||||||
data[1].toString(), //title
|
data[1].toString(), //title
|
||||||
@@ -144,12 +145,14 @@ DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QVarian
|
|||||||
data[8].toInt(), //lastmod
|
data[8].toInt(), //lastmod
|
||||||
data[9].toString() ) ); //GUID
|
data[9].toString() ) ); //GUID
|
||||||
addAutoPlaylist( p );
|
addAutoPlaylist( p );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DatabaseCollection::stationCreated( const source_ptr& source, const QVariantList& data )
|
DatabaseCollection::stationCreated( const source_ptr& source, const QVariantList& data )
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
dynplaylist_ptr p( new DynamicPlaylist( source, //src
|
dynplaylist_ptr p( new DynamicPlaylist( source, //src
|
||||||
data[0].toString(), //current rev
|
data[0].toString(), //current rev
|
||||||
data[1].toString(), //title
|
data[1].toString(), //title
|
||||||
@@ -162,6 +165,7 @@ DatabaseCollection::stationCreated( const source_ptr& source, const QVariantList
|
|||||||
data[8].toInt(), //lastmod
|
data[8].toInt(), //lastmod
|
||||||
data[9].toString() ) ); //GUID
|
data[9].toString() ) ); //GUID
|
||||||
addStation( p );
|
addStation( p );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -87,6 +87,7 @@ DatabaseCommand_SetDynamicPlaylistRevision::controlsV()
|
|||||||
void
|
void
|
||||||
DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
if ( source().isNull() || source()->collection().isNull() )
|
if ( source().isNull() || source()->collection().isNull() )
|
||||||
{
|
{
|
||||||
tDebug() << "Source has gone offline, not emitting to GUI.";
|
tDebug() << "Source has gone offline, not emitting to GUI.";
|
||||||
@@ -172,6 +173,7 @@ DatabaseCommand_SetDynamicPlaylistRevision::postCommitHook()
|
|||||||
|
|
||||||
if ( source()->isLocal() )
|
if ( source()->isLocal() )
|
||||||
Servent::instance()->triggerDBSync();
|
Servent::instance()->triggerDBSync();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -17,11 +17,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QDesktopServices>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QCryptographicHash>
|
#include <QCryptographicHash>
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "infosystemcache.h"
|
#include "infosystemcache.h"
|
||||||
#include "tomahawksettings.h"
|
#include "tomahawksettings.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
@@ -36,7 +40,11 @@ namespace InfoSystem
|
|||||||
|
|
||||||
InfoSystemCache::InfoSystemCache( QObject* parent )
|
InfoSystemCache::InfoSystemCache( QObject* parent )
|
||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
, m_cacheBaseDir( QDesktopServices::storageLocation( QDesktopServices::CacheLocation ) + "/InfoSystemCache/" )
|
, m_cacheBaseDir( QDesktopServices::storageLocation( QDesktopServices::CacheLocation ) + "/InfoSystemCache/" )
|
||||||
|
#else
|
||||||
|
, m_cacheBaseDir( QDir::tempPath() )
|
||||||
|
#endif
|
||||||
, m_cacheVersion( 2 )
|
, m_cacheVersion( 2 )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
@@ -78,7 +78,7 @@ void
|
|||||||
InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
InfoPluginPtr enptr( new EchoNestPlugin() );
|
InfoPluginPtr enptr( new EchoNestPlugin() );
|
||||||
m_plugins.append( enptr );
|
m_plugins.append( enptr );
|
||||||
registerInfoTypes( enptr, enptr.data()->supportedGetTypes(), enptr.data()->supportedPushTypes() );
|
registerInfoTypes( enptr, enptr.data()->supportedGetTypes(), enptr.data()->supportedPushTypes() );
|
||||||
@@ -103,13 +103,14 @@ InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
|||||||
InfoPluginPtr hypeptr( new hypemPlugin() );
|
InfoPluginPtr hypeptr( new hypemPlugin() );
|
||||||
m_plugins.append( hypeptr );
|
m_plugins.append( hypeptr );
|
||||||
registerInfoTypes( hypeptr, hypeptr.data()->supportedGetTypes(), hypeptr.data()->supportedPushTypes() );
|
registerInfoTypes( hypeptr, hypeptr.data()->supportedGetTypes(), hypeptr.data()->supportedPushTypes() );
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
InfoPluginPtr admptr( new AdiumPlugin() );
|
InfoPluginPtr admptr( new AdiumPlugin() );
|
||||||
m_plugins.append( admptr );
|
m_plugins.append( admptr );
|
||||||
registerInfoTypes( admptr, admptr.data()->supportedGetTypes(), admptr.data()->supportedPushTypes() );
|
registerInfoTypes( admptr, admptr.data()->supportedGetTypes(), admptr.data()->supportedPushTypes() );
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
InfoPluginPtr fdonotifyptr( new FdoNotifyPlugin() );
|
InfoPluginPtr fdonotifyptr( new FdoNotifyPlugin() );
|
||||||
m_plugins.append( fdonotifyptr );
|
m_plugins.append( fdonotifyptr );
|
||||||
@@ -118,7 +119,7 @@ InfoSystemWorker::init( Tomahawk::InfoSystem::InfoSystemCache* cache )
|
|||||||
m_plugins.append( mprisptr );
|
m_plugins.append( mprisptr );
|
||||||
registerInfoTypes( mprisptr, mprisptr.data()->supportedGetTypes(), mprisptr.data()->supportedPushTypes() );
|
registerInfoTypes( mprisptr, mprisptr.data()->supportedGetTypes(), mprisptr.data()->supportedPushTypes() );
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
Q_FOREACH( InfoPluginPtr plugin, m_plugins )
|
Q_FOREACH( InfoPluginPtr plugin, m_plugins )
|
||||||
{
|
{
|
||||||
connect(
|
connect(
|
||||||
|
@@ -118,6 +118,7 @@ Tomahawk::ExternalResolver*
|
|||||||
Pipeline::addScriptResolver( const QString& path, bool start )
|
Pipeline::addScriptResolver( const QString& path, bool start )
|
||||||
{
|
{
|
||||||
ExternalResolver* res = 0;
|
ExternalResolver* res = 0;
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
const QFileInfo fi( path );
|
const QFileInfo fi( path );
|
||||||
|
|
||||||
if ( fi.suffix() == "js" || fi.suffix() == "script" )
|
if ( fi.suffix() == "js" || fi.suffix() == "script" )
|
||||||
@@ -128,6 +129,7 @@ Pipeline::addScriptResolver( const QString& path, bool start )
|
|||||||
m_scriptResolvers << res;
|
m_scriptResolvers << res;
|
||||||
if ( start )
|
if ( start )
|
||||||
res->start();
|
res->start();
|
||||||
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
#include "xspfloader.h"
|
#include "xspfloader.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include "headlesscheck.h"
|
||||||
|
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
|
|
||||||
#include "utils/tomahawkutils.h"
|
#include "utils/tomahawkutils.h"
|
||||||
|
@@ -16,12 +16,13 @@
|
|||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "tomahawkapp.h"
|
#include "tomahawkapp.h"
|
||||||
|
|
||||||
#include "thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h"
|
#include "thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.h"
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
|
|
||||||
#include "breakpad/BreakPad.h"
|
|
||||||
#include "ubuntuunityhack.h"
|
#include "ubuntuunityhack.h"
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
@@ -30,6 +31,9 @@
|
|||||||
static pascal OSErr appleEventHandler( const AppleEvent*, AppleEvent*, long );
|
static pascal OSErr appleEventHandler( const AppleEvent*, AppleEvent*, long );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
|
#include "breakpad/BreakPad.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
main( int argc, char *argv[] )
|
main( int argc, char *argv[] )
|
||||||
@@ -54,7 +58,10 @@ main( int argc, char *argv[] )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
TomahawkApp a( argc, argv );
|
TomahawkApp a( argc, argv );
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
new BreakPad( QDir::tempPath() );
|
new BreakPad( QDir::tempPath() );
|
||||||
|
#endif
|
||||||
|
|
||||||
KDSingleApplicationGuard guard( &a, KDSingleApplicationGuard::AutoKillOtherInstances );
|
KDSingleApplicationGuard guard( &a, KDSingleApplicationGuard::AutoKillOtherInstances );
|
||||||
QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) );
|
QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) );
|
||||||
|
@@ -2,7 +2,7 @@ IF( LIBJREEN_FOUND )
|
|||||||
ADD_SUBDIRECTORY( jabber )
|
ADD_SUBDIRECTORY( jabber )
|
||||||
ENDIF( LIBJREEN_FOUND )
|
ENDIF( LIBJREEN_FOUND )
|
||||||
|
|
||||||
IF( QTWEETLIB_FOUND )
|
IF( QTWEETLIB_FOUND AND BUILD_GUI )
|
||||||
ADD_SUBDIRECTORY( twitter )
|
ADD_SUBDIRECTORY( twitter )
|
||||||
ENDIF( QTWEETLIB_FOUND )
|
ENDIF( QTWEETLIB_FOUND )
|
||||||
|
|
||||||
|
@@ -10,12 +10,16 @@ set( jabberSources
|
|||||||
jabber.cpp
|
jabber.cpp
|
||||||
tomahawksipmessage.cpp
|
tomahawksipmessage.cpp
|
||||||
tomahawksipmessagefactory.cpp
|
tomahawksipmessagefactory.cpp
|
||||||
|
)
|
||||||
|
set( jabberSourcesGui
|
||||||
avatarmanager.cpp
|
avatarmanager.cpp
|
||||||
xmlconsole.cpp
|
xmlconsole.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set( jabberHeaders
|
set( jabberHeaders
|
||||||
jabber.h
|
jabber.h
|
||||||
|
)
|
||||||
|
set( jabberHeadersGui
|
||||||
avatarmanager.h
|
avatarmanager.h
|
||||||
xmlconsole.h
|
xmlconsole.h
|
||||||
)
|
)
|
||||||
@@ -25,6 +29,11 @@ set( jabberUI
|
|||||||
xmlconsole.ui
|
xmlconsole.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BUILD_GUI)
|
||||||
|
list(APPEND jabberSources ${jabberSourcesGui})
|
||||||
|
list(APPEND jabberHeaders ${jabberHeadersGui})
|
||||||
|
endif()
|
||||||
|
|
||||||
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
|
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ..
|
||||||
${QT_INCLUDE_DIR}
|
${QT_INCLUDE_DIR}
|
||||||
${LIBJREEN_INCLUDE_DIR}
|
${LIBJREEN_INCLUDE_DIR}
|
||||||
@@ -57,5 +66,6 @@ ENDIF( APPLE )
|
|||||||
|
|
||||||
install( TARGETS tomahawk_sipjabber DESTINATION lib${LIB_SUFFIX} )
|
install( TARGETS tomahawk_sipjabber DESTINATION lib${LIB_SUFFIX} )
|
||||||
|
|
||||||
|
if(BUILD_GUI)
|
||||||
add_subdirectory(googlewrapper)
|
add_subdirectory(googlewrapper)
|
||||||
|
endif()
|
||||||
|
@@ -20,8 +20,6 @@
|
|||||||
#include "jabber.h"
|
#include "jabber.h"
|
||||||
#include "ui_configwidget.h"
|
#include "ui_configwidget.h"
|
||||||
|
|
||||||
#include "xmlconsole.h"
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "tomahawksettings.h"
|
#include "tomahawksettings.h"
|
||||||
@@ -42,11 +40,15 @@
|
|||||||
|
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDateTime>
|
#endif
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
#include <utils/tomahawkutils.h>
|
#include <utils/tomahawkutils.h>
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
@@ -65,8 +67,10 @@ JabberFactory::icon() const
|
|||||||
|
|
||||||
JabberPlugin::JabberPlugin( const QString& pluginId )
|
JabberPlugin::JabberPlugin( const QString& pluginId )
|
||||||
: SipPlugin( pluginId )
|
: SipPlugin( pluginId )
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
, m_menu( 0 )
|
, m_menu( 0 )
|
||||||
, m_xmlConsole( 0 )
|
, m_xmlConsole( 0 )
|
||||||
|
#endif
|
||||||
, m_state( Disconnected )
|
, m_state( Disconnected )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
@@ -100,21 +104,24 @@ JabberPlugin::JabberPlugin( const QString& pluginId )
|
|||||||
m_currentResource = QString::fromAscii( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) );
|
m_currentResource = QString::fromAscii( "tomahawk%1" ).arg( QString::number( qrand() % 10000 ) );
|
||||||
m_client->setResource( m_currentResource );
|
m_client->setResource( m_currentResource );
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
// instantiate XmlConsole
|
// instantiate XmlConsole
|
||||||
if( readXmlConsoleEnabled() )
|
if( readXmlConsoleEnabled() )
|
||||||
{
|
{
|
||||||
m_xmlConsole = new XmlConsole( m_client );
|
m_xmlConsole = new XmlConsole( m_client );
|
||||||
m_xmlConsole->show();
|
m_xmlConsole->show();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// add VCardUpdate extension to own presence
|
// add VCardUpdate extension to own presence
|
||||||
m_client->presence().addExtension( new Jreen::VCardUpdate() );
|
m_client->presence().addExtension( new Jreen::VCardUpdate() );
|
||||||
|
|
||||||
// initaliaze the roster
|
// initaliaze the roster
|
||||||
m_roster = new Jreen::SimpleRoster( m_client );
|
m_roster = new Jreen::SimpleRoster( m_client );
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
// initialize the AvatarManager
|
// initialize the AvatarManager
|
||||||
m_avatarManager = new AvatarManager( m_client );
|
m_avatarManager = new AvatarManager( m_client );
|
||||||
|
#endif
|
||||||
|
|
||||||
// setup disco
|
// setup disco
|
||||||
m_client->disco()->setSoftwareVersion( "Tomahawk Player", TOMAHAWK_VERSION, CMAKE_SYSTEM );
|
m_client->disco()->setSoftwareVersion( "Tomahawk Player", TOMAHAWK_VERSION, CMAKE_SYSTEM );
|
||||||
@@ -149,7 +156,9 @@ JabberPlugin::~JabberPlugin()
|
|||||||
{
|
{
|
||||||
delete m_avatarManager;
|
delete m_avatarManager;
|
||||||
delete m_roster;
|
delete m_roster;
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
delete m_xmlConsole;
|
delete m_xmlConsole;
|
||||||
|
#endif
|
||||||
delete m_client;
|
delete m_client;
|
||||||
delete m_ui;
|
delete m_ui;
|
||||||
}
|
}
|
||||||
@@ -173,6 +182,7 @@ JabberPlugin::accountName() const
|
|||||||
return TomahawkSettings::instance()->value( pluginId() + "/username" ).toString();
|
return TomahawkSettings::instance()->value( pluginId() + "/username" ).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
QMenu*
|
QMenu*
|
||||||
JabberPlugin::menu()
|
JabberPlugin::menu()
|
||||||
{
|
{
|
||||||
@@ -190,7 +200,7 @@ JabberPlugin::icon() const
|
|||||||
{
|
{
|
||||||
return QIcon( ":/jabber-icon.png" );
|
return QIcon( ":/jabber-icon.png" );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool
|
bool
|
||||||
JabberPlugin::connectPlugin( bool startup )
|
JabberPlugin::connectPlugin( bool startup )
|
||||||
@@ -456,6 +466,7 @@ JabberPlugin::addContact(const QString& jid, const QString& msg)
|
|||||||
void
|
void
|
||||||
JabberPlugin::showAddFriendDialog()
|
JabberPlugin::showAddFriendDialog()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
bool ok;
|
bool ok;
|
||||||
QString id = QInputDialog::getText( TomahawkUtils::tomahawkWindow(), tr( "Add Friend" ),
|
QString id = QInputDialog::getText( TomahawkUtils::tomahawkWindow(), tr( "Add Friend" ),
|
||||||
tr( "Enter Jabber ID:" ), QLineEdit::Normal, "", &ok );
|
tr( "Enter Jabber ID:" ), QLineEdit::Normal, "", &ok );
|
||||||
@@ -464,6 +475,7 @@ JabberPlugin::showAddFriendDialog()
|
|||||||
|
|
||||||
qDebug() << "Attempting to add jabber contact to roster:" << id;
|
qDebug() << "Attempting to add jabber contact to roster:" << id;
|
||||||
addContact( id );
|
addContact( id );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
@@ -476,7 +488,9 @@ JabberPlugin::defaultSuffix() const
|
|||||||
void
|
void
|
||||||
JabberPlugin::showXmlConsole()
|
JabberPlugin::showXmlConsole()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
m_xmlConsole->show();
|
m_xmlConsole->show();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -553,6 +567,7 @@ void JabberPlugin::setupClientHelper()
|
|||||||
|
|
||||||
void JabberPlugin::addMenuHelper()
|
void JabberPlugin::addMenuHelper()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
if( !m_menu )
|
if( !m_menu )
|
||||||
{
|
{
|
||||||
m_menu = new QMenu( QString( "%1 (" ).arg( friendlyName() ).append( accountName() ).append(")" ) );
|
m_menu = new QMenu( QString( "%1 (" ).arg( friendlyName() ).append( accountName() ).append(")" ) );
|
||||||
@@ -568,10 +583,12 @@ void JabberPlugin::addMenuHelper()
|
|||||||
|
|
||||||
emit addMenu( m_menu );
|
emit addMenu( m_menu );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void JabberPlugin::removeMenuHelper()
|
void JabberPlugin::removeMenuHelper()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
if( m_menu )
|
if( m_menu )
|
||||||
{
|
{
|
||||||
emit removeMenu( m_menu );
|
emit removeMenu( m_menu );
|
||||||
@@ -579,6 +596,7 @@ void JabberPlugin::removeMenuHelper()
|
|||||||
delete m_menu;
|
delete m_menu;
|
||||||
m_menu = 0;
|
m_menu = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void JabberPlugin::onNewMessage(const Jreen::Message& message)
|
void JabberPlugin::onNewMessage(const Jreen::Message& message)
|
||||||
@@ -699,7 +717,7 @@ void JabberPlugin::onSubscriptionReceived(const Jreen::RosterItem::Ptr& item, co
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
// preparing the confirm box for the user
|
// preparing the confirm box for the user
|
||||||
QMessageBox *confirmBox = new QMessageBox(
|
QMessageBox *confirmBox = new QMessageBox(
|
||||||
QMessageBox::Question,
|
QMessageBox::Question,
|
||||||
@@ -714,11 +732,13 @@ void JabberPlugin::onSubscriptionReceived(const Jreen::RosterItem::Ptr& item, co
|
|||||||
|
|
||||||
// display the box and wait for the answer
|
// display the box and wait for the answer
|
||||||
confirmBox->open( this, SLOT( onSubscriptionRequestConfirmed( int ) ) );
|
confirmBox->open( this, SLOT( onSubscriptionRequestConfirmed( int ) ) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
JabberPlugin::onSubscriptionRequestConfirmed( int result )
|
JabberPlugin::onSubscriptionRequestConfirmed( int result )
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
qDebug() << Q_FUNC_INFO << result;
|
qDebug() << Q_FUNC_INFO << result;
|
||||||
|
|
||||||
QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values();
|
QList< QMessageBox* > confirmBoxes = m_subscriptionConfirmBoxes.values();
|
||||||
@@ -749,6 +769,7 @@ JabberPlugin::onSubscriptionRequestConfirmed( int result )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_roster->allowSubscription( jid, allowSubscription == QMessageBox::Yes );
|
m_roster->allowSubscription( jid, allowSubscription == QMessageBox::Yes );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void JabberPlugin::onNewIq(const Jreen::IQ& iq)
|
void JabberPlugin::onNewIq(const Jreen::IQ& iq)
|
||||||
@@ -876,8 +897,10 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
|
|||||||
|
|
||||||
emit peerOnline( fulljid );
|
emit peerOnline( fulljid );
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
if(!m_avatarManager->avatar(jid.bare()).isNull())
|
if(!m_avatarManager->avatar(jid.bare()).isNull())
|
||||||
onNewAvatar( jid.bare() );
|
onNewAvatar( jid.bare() );
|
||||||
|
#endif
|
||||||
|
|
||||||
// request software version
|
// request software version
|
||||||
Jreen::IQ versionIq( Jreen::IQ::Get, jid );
|
Jreen::IQ versionIq( Jreen::IQ::Get, jid );
|
||||||
@@ -895,6 +918,7 @@ void JabberPlugin::handlePeerStatus(const Jreen::JID& jid, Jreen::Presence::Type
|
|||||||
|
|
||||||
void JabberPlugin::onNewAvatar(const QString& jid)
|
void JabberPlugin::onNewAvatar(const QString& jid)
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
// qDebug() << Q_FUNC_INFO << jid;
|
// qDebug() << Q_FUNC_INFO << jid;
|
||||||
if ( m_state != Connected )
|
if ( m_state != Connected )
|
||||||
return;
|
return;
|
||||||
@@ -917,6 +941,7 @@ void JabberPlugin::onNewAvatar(const QString& jid)
|
|||||||
else
|
else
|
||||||
// someone else's avatar
|
// someone else's avatar
|
||||||
emit avatarReceived ( jid, m_avatarManager->avatar( jid ) );
|
emit avatarReceived ( jid, m_avatarManager->avatar( jid ) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@@ -23,7 +23,10 @@
|
|||||||
#include "sip/SipPlugin.h"
|
#include "sip/SipPlugin.h"
|
||||||
|
|
||||||
#include "avatarmanager.h"
|
#include "avatarmanager.h"
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
#include "xmlconsole.h"
|
#include "xmlconsole.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <jreen/client.h>
|
#include <jreen/client.h>
|
||||||
#include <jreen/disco.h>
|
#include <jreen/disco.h>
|
||||||
@@ -38,7 +41,9 @@
|
|||||||
#include <jreen/connection.h>
|
#include <jreen/connection.h>
|
||||||
#include <jreen/mucroom.h>
|
#include <jreen/mucroom.h>
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MYNAME "SIPJREEN"
|
#define MYNAME "SIPJREEN"
|
||||||
#define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" )
|
#define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" )
|
||||||
@@ -77,9 +82,12 @@ public:
|
|||||||
virtual const QString friendlyName() const;
|
virtual const QString friendlyName() const;
|
||||||
virtual const QString accountName() const;
|
virtual const QString accountName() const;
|
||||||
virtual ConnectionState connectionState() const;
|
virtual ConnectionState connectionState() const;
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
virtual QMenu* menu();
|
virtual QMenu* menu();
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
virtual QWidget* configWidget();
|
virtual QWidget* configWidget();
|
||||||
|
#endif
|
||||||
virtual void saveConfig();
|
virtual void saveConfig();
|
||||||
virtual void deletePlugin();
|
virtual void deletePlugin();
|
||||||
|
|
||||||
@@ -132,8 +140,6 @@ private:
|
|||||||
|
|
||||||
using SipPlugin::errorMessage;
|
using SipPlugin::errorMessage;
|
||||||
|
|
||||||
QMenu* m_menu;
|
|
||||||
XmlConsole* m_xmlConsole;
|
|
||||||
QString m_currentUsername;
|
QString m_currentUsername;
|
||||||
QString m_currentPassword;
|
QString m_currentPassword;
|
||||||
QString m_currentServer;
|
QString m_currentServer;
|
||||||
@@ -150,7 +156,11 @@ private:
|
|||||||
Jreen::MUCRoom *m_room;
|
Jreen::MUCRoom *m_room;
|
||||||
Jreen::SimpleRoster *m_roster;
|
Jreen::SimpleRoster *m_roster;
|
||||||
QHash<Jreen::JID, Jreen::Presence::Type> m_peers;
|
QHash<Jreen::JID, Jreen::Presence::Type> m_peers;
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
QHash<Jreen::JID, QMessageBox*> m_subscriptionConfirmBoxes;
|
QHash<Jreen::JID, QMessageBox*> m_subscriptionConfirmBoxes;
|
||||||
|
QMenu* m_menu;
|
||||||
|
XmlConsole* m_xmlConsole;
|
||||||
|
#endif
|
||||||
enum IqContext { NoContext, RequestDisco, RequestedDisco, SipMessageSent, RequestedVCard, RequestVersion, RequestedVersion };
|
enum IqContext { NoContext, RequestDisco, RequestedDisco, SipMessageSent, RequestedVCard, RequestVersion, RequestedVersion };
|
||||||
AvatarManager *m_avatarManager;
|
AvatarManager *m_avatarManager;
|
||||||
};
|
};
|
||||||
|
@@ -72,12 +72,13 @@ ZeroconfPlugin::connectionState() const
|
|||||||
return m_state;
|
return m_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
QIcon
|
QIcon
|
||||||
ZeroconfFactory::icon() const
|
ZeroconfFactory::icon() const
|
||||||
{
|
{
|
||||||
return QIcon( ":/zeroconf-icon.png" );
|
return QIcon( ":/zeroconf-icon.png" );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ZeroconfPlugin::connectPlugin( bool /*startup*/ )
|
ZeroconfPlugin::connectPlugin( bool /*startup*/ )
|
||||||
@@ -112,11 +113,14 @@ ZeroconfPlugin::disconnectPlugin()
|
|||||||
m_zeroconf = 0;
|
m_zeroconf = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
QIcon
|
QIcon
|
||||||
ZeroconfPlugin::icon() const
|
ZeroconfPlugin::icon() const
|
||||||
{
|
{
|
||||||
return QIcon( ":/zeroconf-icon.png" );
|
return QIcon( ":/zeroconf-icon.png" );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -39,7 +39,9 @@ public:
|
|||||||
virtual QString factoryId() const { return "sipzeroconf"; }
|
virtual QString factoryId() const { return "sipzeroconf"; }
|
||||||
virtual QString prettyName() const { return "Local Network"; }
|
virtual QString prettyName() const { return "Local Network"; }
|
||||||
virtual bool isUnique() const { return true; }
|
virtual bool isUnique() const { return true; }
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
virtual SipPlugin* createPlugin ( const QString& pluginId = QString() );
|
virtual SipPlugin* createPlugin ( const QString& pluginId = QString() );
|
||||||
@@ -60,7 +62,9 @@ public:
|
|||||||
virtual const QString accountName() const;
|
virtual const QString accountName() const;
|
||||||
virtual ConnectionState connectionState() const;
|
virtual ConnectionState connectionState() const;
|
||||||
virtual bool isValid() const { return true; }
|
virtual bool isValid() const { return true; }
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
|
#endif
|
||||||
virtual void checkSettings() {}
|
virtual void checkSettings() {}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@@ -52,12 +52,9 @@
|
|||||||
#include "globalactionmanager.h"
|
#include "globalactionmanager.h"
|
||||||
#include "database/localcollection.h"
|
#include "database/localcollection.h"
|
||||||
#include "musicscanner.h"
|
#include "musicscanner.h"
|
||||||
#include "AtticaManager.h"
|
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
#include "utils/spotifyparser.h"
|
|
||||||
#include "dropjob.h"
|
#include "dropjob.h"
|
||||||
#include "EchonestCatalogSynchronizer.h"
|
#include "EchonestCatalogSynchronizer.h"
|
||||||
#include "widgets/HeaderLabel.h"
|
|
||||||
|
|
||||||
#include "audio/audioengine.h"
|
#include "audio/audioengine.h"
|
||||||
#include "utils/xspfloader.h"
|
#include "utils/xspfloader.h"
|
||||||
@@ -68,10 +65,14 @@
|
|||||||
#include <lastfm/ws.h>
|
#include <lastfm/ws.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
|
#include "utils/spotifyparser.h"
|
||||||
|
#include "AtticaManager.h"
|
||||||
#include "tomahawkwindow.h"
|
#include "tomahawkwindow.h"
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include "widgets/HeaderLabel.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// should go to a plugin actually
|
// should go to a plugin actually
|
||||||
@@ -141,19 +142,19 @@ TomahawkApp::init()
|
|||||||
|
|
||||||
tLog() << "Starting Tomahawk...";
|
tLog() << "Starting Tomahawk...";
|
||||||
|
|
||||||
#ifdef TOMAHAWK_HEADLESS
|
#ifdef ENABLE_HEADLESS
|
||||||
m_headless = true;
|
m_headless = true;
|
||||||
#else
|
#else
|
||||||
m_mainwindow = 0;
|
m_mainwindow = 0;
|
||||||
m_headless = arguments().contains( "--headless" );
|
m_headless = arguments().contains( "--headless" );
|
||||||
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
setWindowIcon( QIcon( RESPATH "icons/tomahawk-icon-128x128.png" ) );
|
||||||
setQuitOnLastWindowClosed( false );
|
setQuitOnLastWindowClosed( false );
|
||||||
#endif
|
|
||||||
|
|
||||||
QFont f = APP->font();
|
QFont f = APP->font();
|
||||||
f.setPixelSize( HeaderLabel::defaultFontSize() );
|
f.setPixelSize( HeaderLabel::defaultFontSize() );
|
||||||
QFontMetrics fm( f );
|
QFontMetrics fm( f );
|
||||||
TomahawkUtils::setHeaderHeight( fm.height() + 8 );
|
TomahawkUtils::setHeaderHeight( fm.height() + 8 );
|
||||||
|
#endif
|
||||||
|
|
||||||
new TomahawkSettings( this );
|
new TomahawkSettings( this );
|
||||||
TomahawkSettings* s = TomahawkSettings::instance();
|
TomahawkSettings* s = TomahawkSettings::instance();
|
||||||
@@ -180,8 +181,10 @@ TomahawkApp::init()
|
|||||||
for ( int i=0; i<length; i++ ) magic[i] = magic[i] ^ wand[i%n2];
|
for ( int i=0; i<length; i++ ) magic[i] = magic[i] ^ wand[i%n2];
|
||||||
Echonest::Config::instance()->setAPIKey( magic );
|
Echonest::Config::instance()->setAPIKey( magic );
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
tDebug() << "Init Echonest Factory.";
|
tDebug() << "Init Echonest Factory.";
|
||||||
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
|
||||||
|
#endif
|
||||||
tDebug() << "Init Database Factory.";
|
tDebug() << "Init Database Factory.";
|
||||||
GeneratorFactory::registerFactory( "database", new DatabaseFactory );
|
GeneratorFactory::registerFactory( "database", new DatabaseFactory );
|
||||||
|
|
||||||
@@ -211,9 +214,10 @@ TomahawkApp::init()
|
|||||||
m_infoSystem = QWeakPointer<Tomahawk::InfoSystem::InfoSystem>( new Tomahawk::InfoSystem::InfoSystem( this ) );
|
m_infoSystem = QWeakPointer<Tomahawk::InfoSystem::InfoSystem>( new Tomahawk::InfoSystem::InfoSystem( this ) );
|
||||||
|
|
||||||
Echonest::Config::instance()->setNetworkAccessManager( TomahawkUtils::nam() );
|
Echonest::Config::instance()->setNetworkAccessManager( TomahawkUtils::nam() );
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
EchonestGenerator::setupCatalogs();
|
EchonestGenerator::setupCatalogs();
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
|
||||||
if ( !m_headless )
|
if ( !m_headless )
|
||||||
{
|
{
|
||||||
tDebug() << "Init MainWindow.";
|
tDebug() << "Init MainWindow.";
|
||||||
@@ -233,8 +237,10 @@ TomahawkApp::init()
|
|||||||
initPipeline();
|
initPipeline();
|
||||||
|
|
||||||
#ifdef LIBATTICA_FOUND
|
#ifdef LIBATTICA_FOUND
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
// load remote list of resolvers able to be installed
|
// load remote list of resolvers able to be installed
|
||||||
AtticaManager::instance();
|
AtticaManager::instance();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( arguments().contains( "--http" ) || TomahawkSettings::instance()->value( "network/http", true ).toBool() )
|
if ( arguments().contains( "--http" ) || TomahawkSettings::instance()->value( "network/http", true ).toBool() )
|
||||||
@@ -242,7 +248,7 @@ TomahawkApp::init()
|
|||||||
initHTTP();
|
initHTTP();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
if ( !s->hasScannerPaths() )
|
if ( !s->hasScannerPaths() )
|
||||||
{
|
{
|
||||||
m_mainwindow->showSettingsDialog();
|
m_mainwindow->showSettingsDialog();
|
||||||
@@ -259,14 +265,17 @@ TomahawkApp::init()
|
|||||||
m_scanManager.data()->runScan( true );
|
m_scanManager.data()->runScan( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set up echonest catalog synchronizer
|
||||||
|
Tomahawk::EchonestCatalogSynchronizer::instance();
|
||||||
|
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
// Make sure to init GAM in the gui thread
|
// Make sure to init GAM in the gui thread
|
||||||
GlobalActionManager::instance();
|
GlobalActionManager::instance();
|
||||||
|
|
||||||
// Set up echonest catalog synchronizer
|
|
||||||
Tomahawk::EchonestCatalogSynchronizer::instance();
|
|
||||||
// check if our spotify playlist api server is up and running, and enable spotify playlist drops if so
|
// check if our spotify playlist api server is up and running, and enable spotify playlist drops if so
|
||||||
QNetworkReply* r = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( SPOTIFY_PLAYLIST_API_URL "/playlist/test" ) ) );
|
QNetworkReply* r = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( SPOTIFY_PLAYLIST_API_URL "/playlist/test" ) ) );
|
||||||
connect( r, SIGNAL( finished() ), this, SLOT( spotifyApiCheckFinished() ) );
|
connect( r, SIGNAL( finished() ), this, SLOT( spotifyApiCheckFinished() ) );
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
// Make sure to do this after main window is inited
|
// Make sure to do this after main window is inited
|
||||||
@@ -301,12 +310,13 @@ TomahawkApp::~TomahawkApp()
|
|||||||
|
|
||||||
delete Pipeline::instance();
|
delete Pipeline::instance();
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
delete m_mainwindow;
|
delete m_mainwindow;
|
||||||
#endif
|
|
||||||
#ifdef LIBATTICA_FOUND
|
#ifdef LIBATTICA_FOUND
|
||||||
delete AtticaManager::instance();
|
delete AtticaManager::instance();
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
tLog() << "Finished shutdown.";
|
tLog() << "Finished shutdown.";
|
||||||
}
|
}
|
||||||
@@ -338,7 +348,7 @@ TomahawkApp::printHelp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
AudioControls*
|
AudioControls*
|
||||||
TomahawkApp::audioControls()
|
TomahawkApp::audioControls()
|
||||||
{
|
{
|
||||||
@@ -517,6 +527,7 @@ TomahawkApp::initSIP()
|
|||||||
void
|
void
|
||||||
TomahawkApp::spotifyApiCheckFinished()
|
TomahawkApp::spotifyApiCheckFinished()
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
|
QNetworkReply* reply = qobject_cast< QNetworkReply* >( sender() );
|
||||||
Q_ASSERT( reply );
|
Q_ASSERT( reply );
|
||||||
|
|
||||||
@@ -524,13 +535,14 @@ TomahawkApp::spotifyApiCheckFinished()
|
|||||||
DropJob::setCanParseSpotifyPlaylists( true );
|
DropJob::setCanParseSpotifyPlaylists( true );
|
||||||
else
|
else
|
||||||
DropJob::setCanParseSpotifyPlaylists( false );
|
DropJob::setCanParseSpotifyPlaylists( false );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TomahawkApp::activate()
|
TomahawkApp::activate()
|
||||||
{
|
{
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
TomahawkUtils::bringToFront();
|
TomahawkUtils::bringToFront();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -539,6 +551,7 @@ TomahawkApp::activate()
|
|||||||
bool
|
bool
|
||||||
TomahawkApp::loadUrl( const QString& url )
|
TomahawkApp::loadUrl( const QString& url )
|
||||||
{
|
{
|
||||||
|
#ifndef ENABLE_HEADLESS
|
||||||
if ( url.startsWith( "tomahawk://" ) )
|
if ( url.startsWith( "tomahawk://" ) )
|
||||||
return GlobalActionManager::instance()->parseTomahawkLink( url );
|
return GlobalActionManager::instance()->parseTomahawkLink( url );
|
||||||
else if ( url.contains( "open.spotify.com" ) || url.contains( "spotify:track" ) )
|
else if ( url.contains( "open.spotify.com" ) || url.contains( "spotify:track" ) )
|
||||||
@@ -566,7 +579,7 @@ TomahawkApp::loadUrl( const QString& url )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ public:
|
|||||||
|
|
||||||
XMPPBot* xmppBot() { return m_xmppBot.data(); }
|
XMPPBot* xmppBot() { return m_xmppBot.data(); }
|
||||||
|
|
||||||
#ifndef TOMAHAWK_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
AudioControls* audioControls();
|
AudioControls* audioControls();
|
||||||
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user