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