mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-21 13:21:52 +02:00
Merge branch 'master' into leo-test
Conflicts: src/libtomahawk/playlist/dynamic/DynamicPlaylist.h src/libtomahawk/widgets/welcomeplaylistmodel.cpp
This commit is contained in:
@@ -20,6 +20,12 @@ SET( TOMAHAWK_VERSION_PATCH 0 )
|
|||||||
|
|
||||||
# SET( TOMAHAWK_VERSION_RC 0 )
|
# SET( TOMAHAWK_VERSION_RC 0 )
|
||||||
|
|
||||||
|
|
||||||
|
# build options
|
||||||
|
option(BUILD_GUI "Build Tomahawk with GUI" ON)
|
||||||
|
|
||||||
|
|
||||||
|
# generate version string
|
||||||
IF( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
|
IF( NOT CMAKE_BUILD_TYPE STREQUAL "Release" )
|
||||||
# Use the date as the tweak level.
|
# Use the date as the tweak level.
|
||||||
INCLUDE( ${CMAKE_MODULE_PATH}/CMakeDateStamp.cmake )
|
INCLUDE( ${CMAKE_MODULE_PATH}/CMakeDateStamp.cmake )
|
||||||
@@ -50,30 +56,26 @@ SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
|||||||
# installer creation
|
# installer creation
|
||||||
INCLUDE( CPack.cmake )
|
INCLUDE( CPack.cmake )
|
||||||
|
|
||||||
# Check if we need qtgui:
|
|
||||||
IF( "${gui}" STREQUAL "no" )
|
|
||||||
ADD_DEFINITIONS( -DENABLE_HEADLESS )
|
|
||||||
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} in HEADLESS mode ***" )
|
|
||||||
FIND_PACKAGE( Qt4 4.7.0 COMPONENTS QtCore QtXml QtNetwork REQUIRED )
|
|
||||||
ELSE()
|
|
||||||
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
|
|
||||||
FIND_PACKAGE( Qt4 4.7.0 COMPONENTS QtGui QtCore QtXml QtNetwork REQUIRED )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
#deps
|
#deps
|
||||||
INCLUDE( MacroOptionalFindPackage )
|
INCLUDE( MacroOptionalFindPackage )
|
||||||
INCLUDE( MacroLogFeature )
|
INCLUDE( MacroLogFeature )
|
||||||
|
|
||||||
# required
|
# Check if we need qtgui:
|
||||||
#While we distribute our own liblastfm2, don't need to look for it
|
SET(NEEDED_QT4_COMPONENTS QtCore QtXml QtNetwork )
|
||||||
#macro_optional_find_package(LibLastFm 0.3.3)
|
IF( NOT BUILD_GUI )
|
||||||
#macro_log_feature(LIBLASTFM_FOUND "LastFm" "Qt library for the Last.fm webservices" "https://github.com/mxcl/liblastfm" FALSE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
|
ADD_DEFINITIONS( -DENABLE_HEADLESS )
|
||||||
set(LIBLASTFM_FOUND true)
|
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} in HEADLESS mode ***" )
|
||||||
|
ELSE()
|
||||||
|
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
|
||||||
|
LIST(APPEND NEEDED_QT4_COMPONENTS "QtGui")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
find_package(Phonon REQUIRED)
|
macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
|
||||||
if(PHONON_VERSION STRLESS "4.5.0")
|
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt.nokia.com" TRUE "" "")
|
||||||
message(FATAL_ERROR "Phonon version 4.5.0 or higher is required, you have version ${PHONON_VERSION}")
|
|
||||||
else()
|
macro_optional_find_package(Phonon 4.5.0)
|
||||||
|
macro_log_feature(PHONON_FOUND "Phonon" "The Phonon multimedia library" "http://phonon.kde.org" TRUE "" "")
|
||||||
|
if(PHONON_FOUND)
|
||||||
message(STATUS "Phonon found; ensure that phonon-vlc is at least 0.4")
|
message(STATUS "Phonon found; ensure that phonon-vlc is at least 0.4")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -88,6 +90,15 @@ macro_log_feature(QJSON_FOUND "QJson" "Qt library that maps JSON data to QVarian
|
|||||||
|
|
||||||
macro_optional_find_package(Taglib 1.6.0)
|
macro_optional_find_package(Taglib 1.6.0)
|
||||||
macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://developer.kde.org/~wheeler/taglib.html" TRUE "" "taglib is needed for reading meta data from audio files")
|
macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://developer.kde.org/~wheeler/taglib.html" TRUE "" "taglib is needed for reading meta data from audio files")
|
||||||
|
include( CheckTagLibFileName )
|
||||||
|
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )
|
||||||
|
|
||||||
|
# required
|
||||||
|
#While we distribute our own liblastfm2, don't need to look for it
|
||||||
|
#macro_optional_find_package(LibLastFm 0.3.3)
|
||||||
|
#macro_log_feature(LIBLASTFM_FOUND "LastFm" "Qt library for the Last.fm webservices" "https://github.com/mxcl/liblastfm" FALSE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
|
||||||
|
set(LIBLASTFM_FOUND true)
|
||||||
|
|
||||||
|
|
||||||
# this installs headers and such and should really be handled in a separate package by packagers
|
# this installs headers and such and should really be handled in a separate package by packagers
|
||||||
IF( INTERNAL_JREEN )
|
IF( INTERNAL_JREEN )
|
||||||
@@ -124,20 +135,22 @@ SET( LIBPORTFWD_LIBRARIES ${LIBPORTFWD_LIBRARY} )
|
|||||||
ADD_SUBDIRECTORY( ${THIRDPARTY_DIR}/libportfwd )
|
ADD_SUBDIRECTORY( ${THIRDPARTY_DIR}/libportfwd )
|
||||||
|
|
||||||
# we need pthreads too
|
# we need pthreads too
|
||||||
find_package(Threads)
|
macro_optional_find_package(Threads)
|
||||||
|
macro_log_feature(THREADS_FOUND "Threads" "Threading Library" "" TRUE "" "Platform specific library for threading")
|
||||||
|
|
||||||
find_package(KDE4Installed)
|
macro_optional_find_package(KDE4Installed)
|
||||||
find_package(KDE4)
|
|
||||||
IF(KDE4_FOUND)
|
|
||||||
#KDE4 adds and removes some compiler flags that we don't like
|
|
||||||
STRING( REPLACE "-std=iso9899:1990" "" CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
|
||||||
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
|
|
||||||
ELSE()
|
|
||||||
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
include( CheckTagLibFileName )
|
# this was used before we had FindKDE4Installed, just leaving it here to keep the flags
|
||||||
check_taglib_filename( COMPLEX_TAGLIB_FILENAME )
|
# for future kde integration
|
||||||
|
|
||||||
|
# macro_optional_find_package(KDE4)
|
||||||
|
# IF(KDE4_FOUND)
|
||||||
|
# #KDE4 adds and removes some compiler flags that we don't like
|
||||||
|
# STRING( REPLACE "-std=iso9899:1990" "" CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
||||||
|
# SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
|
||||||
|
# ELSE()
|
||||||
|
# SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
|
||||||
|
# ENDIF()
|
||||||
|
|
||||||
IF( WIN32 )
|
IF( WIN32 )
|
||||||
find_library(QTSPARKLE_LIBRARIES qtsparkle)
|
find_library(QTSPARKLE_LIBRARIES qtsparkle)
|
||||||
|
@@ -12,9 +12,12 @@
|
|||||||
INCLUDE(CheckSymbolExists)
|
INCLUDE(CheckSymbolExists)
|
||||||
INCLUDE(FindLibraryWithDebug)
|
INCLUDE(FindLibraryWithDebug)
|
||||||
|
|
||||||
if(NOT CLUCENE_MIN_VERSION)
|
|
||||||
set(CLUCENE_MIN_VERSION "0.9.23")
|
IF(CLucene_FIND_VERSION)
|
||||||
endif(NOT CLUCENE_MIN_VERSION)
|
SET(CLUCENE_MIN_VERSION ${CLucene_FIND_VERSION})
|
||||||
|
ELSEIF()
|
||||||
|
SET(CLUCENE_MIN_VERSION "0.9.23")
|
||||||
|
ENDIF(CLucene_FIND_VERSION)
|
||||||
|
|
||||||
IF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)
|
IF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)
|
||||||
INCLUDE(${PROJECT_CMAKE}/CLuceneConfig.cmake)
|
INCLUDE(${PROJECT_CMAKE}/CLuceneConfig.cmake)
|
||||||
|
@@ -38,14 +38,14 @@ else(PHONON_FOUND)
|
|||||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
|
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
|
||||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
|
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
|
||||||
|
|
||||||
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
_phonon_find_version()
|
||||||
|
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY AND NOT PHONON_VERSION VERSION_LESS ${Phonon_FIND_VERSION})
|
||||||
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
|
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
|
||||||
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
|
set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
|
||||||
set(PHONON_FOUND TRUE)
|
set(PHONON_FOUND TRUE)
|
||||||
_phonon_find_version()
|
else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY AND NOT PHONON_VERSION VERSION_LESS ${Phonon_FIND_VERSION})
|
||||||
else(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
|
||||||
set(PHONON_FOUND FALSE)
|
set(PHONON_FOUND FALSE)
|
||||||
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY AND NOT PHONON_VERSION VERSION_LESS ${Phonon_FIND_VERSION})
|
||||||
|
|
||||||
if(PHONON_FOUND)
|
if(PHONON_FOUND)
|
||||||
if(NOT PHONON_FIND_QUIETLY)
|
if(NOT PHONON_FIND_QUIETLY)
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 856 B After Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 7.3 KiB |
@@ -5,6 +5,7 @@
|
|||||||
<file>./data/images/back-pressed.png</file>
|
<file>./data/images/back-pressed.png</file>
|
||||||
<file>./data/images/back-rest.png</file>
|
<file>./data/images/back-rest.png</file>
|
||||||
<file>./data/images/cover-shadow.png</file>
|
<file>./data/images/cover-shadow.png</file>
|
||||||
|
<file>./data/images/filter.png</file>
|
||||||
<file>./data/images/loved.png</file>
|
<file>./data/images/loved.png</file>
|
||||||
<file>./data/images/not-loved.png</file>
|
<file>./data/images/not-loved.png</file>
|
||||||
<file>./data/images/no-album-art-placeholder.png</file>
|
<file>./data/images/no-album-art-placeholder.png</file>
|
||||||
|
@@ -66,7 +66,7 @@ PipelineStatusView::PipelineStatusView( AnimatedSplitter* parent )
|
|||||||
void
|
void
|
||||||
PipelineStatusView::onPipelineUpdate( const query_ptr& query )
|
PipelineStatusView::onPipelineUpdate( const query_ptr& query )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO << query.isNull();
|
||||||
|
|
||||||
QTreeWidgetItem* ti = m_tree->invisibleRootItem()->child( 0 );
|
QTreeWidgetItem* ti = m_tree->invisibleRootItem()->child( 0 );
|
||||||
|
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#include "diagnosticsdialog.h"
|
#include "diagnosticsdialog.h"
|
||||||
#include "ui_diagnosticsdialog.h"
|
#include "ui_diagnosticsdialog.h"
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <sip/SipHandler.h>
|
#include <sip/SipHandler.h>
|
||||||
#include <network/servent.h>
|
#include <network/servent.h>
|
||||||
#include <sourcelist.h>
|
#include <sourcelist.h>
|
||||||
@@ -54,6 +56,11 @@ void DiagnosticsDialog::updateLogView()
|
|||||||
.arg( QDateTime::currentDateTime().toString() )
|
.arg( QDateTime::currentDateTime().toString() )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// network
|
||||||
|
log.append(
|
||||||
|
"TOMAHAWK-VERSION: " TOMAHAWK_VERSION "\n\n\n"
|
||||||
|
);
|
||||||
|
|
||||||
// network
|
// network
|
||||||
log.append(
|
log.append(
|
||||||
"NETWORK:\n"
|
"NETWORK:\n"
|
||||||
|
@@ -346,6 +346,10 @@ bool
|
|||||||
GlobalActionManager::doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems )
|
GlobalActionManager::doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems )
|
||||||
{
|
{
|
||||||
if( parts.size() && parts[ 0 ] == "track" ) {
|
if( parts.size() && parts[ 0 ] == "track" ) {
|
||||||
|
|
||||||
|
if( queueSpotify( parts, queryItems ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
QPair< QString, QString > pair;
|
QPair< QString, QString > pair;
|
||||||
|
|
||||||
QString title, artist, album, urlStr;
|
QString title, artist, album, urlStr;
|
||||||
@@ -394,6 +398,28 @@ GlobalActionManager::doQueueAdd( const QStringList& parts, const QList< QPair< Q
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GlobalActionManager::queueSpotify( const QStringList& , const QList< QPair< QString, QString > >& queryItems )
|
||||||
|
{
|
||||||
|
QString url;
|
||||||
|
|
||||||
|
QPair< QString, QString > pair;
|
||||||
|
foreach( pair, queryItems ) {
|
||||||
|
if( pair.first == "spotifyURL" )
|
||||||
|
url = pair.second;
|
||||||
|
else if( pair.first == "spotifyURI" )
|
||||||
|
url = pair.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( url.isEmpty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
openSpotifyLink( url );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
GlobalActionManager::handleSearchCommand( const QUrl& url )
|
GlobalActionManager::handleSearchCommand( const QUrl& url )
|
||||||
{
|
{
|
||||||
@@ -581,6 +607,9 @@ GlobalActionManager::handlePlayCommand( const QUrl& url )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( parts[ 0 ] == "track" ) {
|
if( parts[ 0 ] == "track" ) {
|
||||||
|
if( playSpotify( url ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
QPair< QString, QString > pair;
|
QPair< QString, QString > pair;
|
||||||
QString title, artist, album, urlStr;
|
QString title, artist, album, urlStr;
|
||||||
foreach( pair, url.queryItems() ) {
|
foreach( pair, url.queryItems() ) {
|
||||||
@@ -607,6 +636,29 @@ GlobalActionManager::handlePlayCommand( const QUrl& url )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
GlobalActionManager::playSpotify( const QUrl& url )
|
||||||
|
{
|
||||||
|
if( !url.hasQueryItem( "spotifyURI" ) && !url.hasQueryItem( "spotifyURL" ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
QString spotifyUrl = url.hasQueryItem( "spotifyURI" ) ? url.queryItemValue( "spotifyURI" ) : url.queryItemValue( "spotifyURL" );
|
||||||
|
SpotifyParser* p = new SpotifyParser( spotifyUrl, this );
|
||||||
|
connect( p, SIGNAL( track( Tomahawk::query_ptr ) ), this, SLOT( spotifyToPlay( Tomahawk::query_ptr ) ) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GlobalActionManager::spotifyToPlay( const query_ptr& q )
|
||||||
|
{
|
||||||
|
Pipeline::instance()->resolve( q, true );
|
||||||
|
|
||||||
|
m_waitingToPlay = q;
|
||||||
|
connect( q.data(), SIGNAL( resolvingFinished( bool ) ), this, SLOT( waitingForResolved( bool ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GlobalActionManager::handleBookmarkCommand(const QUrl& url)
|
bool GlobalActionManager::handleBookmarkCommand(const QUrl& url)
|
||||||
{
|
{
|
||||||
QStringList parts = url.path().split( "/" ).mid( 1 ); // get the rest of the command
|
QStringList parts = url.path().split( "/" ).mid( 1 ); // get the rest of the command
|
||||||
|
@@ -77,6 +77,8 @@ private slots:
|
|||||||
|
|
||||||
void xspfCreated( const QByteArray& xspf );
|
void xspfCreated( const QByteArray& xspf );
|
||||||
void expandedUrls( QStringList );
|
void expandedUrls( QStringList );
|
||||||
|
|
||||||
|
void spotifyToPlay( const Tomahawk::query_ptr& );
|
||||||
private:
|
private:
|
||||||
explicit GlobalActionManager( QObject* parent = 0 );
|
explicit GlobalActionManager( QObject* parent = 0 );
|
||||||
void doBookmark( const Tomahawk::playlist_ptr& pl, const Tomahawk::query_ptr& q );
|
void doBookmark( const Tomahawk::playlist_ptr& pl, const Tomahawk::query_ptr& q );
|
||||||
@@ -93,6 +95,9 @@ private:
|
|||||||
bool handleOpenCommand(const QUrl& url );
|
bool handleOpenCommand(const QUrl& url );
|
||||||
bool doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
bool doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
||||||
|
|
||||||
|
bool playSpotify( const QUrl& url );
|
||||||
|
bool queueSpotify( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
||||||
|
|
||||||
/// handle parsing mime data
|
/// handle parsing mime data
|
||||||
void handleTrackUrls( const QString& urls );
|
void handleTrackUrls( const QString& urls );
|
||||||
QList< Tomahawk::query_ptr > tracksFromQueryList( const QMimeData* d );
|
QList< Tomahawk::query_ptr > tracksFromQueryList( const QMimeData* d );
|
||||||
|
@@ -291,10 +291,7 @@ Pipeline::shunt( const query_ptr& q )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "Reached end of pipeline for:" << q->toString();
|
|
||||||
setQIDState( q, 0 );
|
setQIDState( q, 0 );
|
||||||
|
|
||||||
q->onResolvingFinished();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shuntNext();
|
shuntNext();
|
||||||
|
@@ -151,6 +151,20 @@ ArtistView::onItemActivated( const QModelIndex& index )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ArtistView::keyPressEvent( QKeyEvent* event )
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
QTreeView::keyPressEvent( event );
|
||||||
|
|
||||||
|
if ( !model() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return )
|
||||||
|
{
|
||||||
|
onItemActivated( currentIndex() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ArtistView::paintEvent( QPaintEvent* event )
|
ArtistView::paintEvent( QPaintEvent* event )
|
||||||
|
@@ -74,6 +74,7 @@ protected:
|
|||||||
virtual void resizeEvent( QResizeEvent* event );
|
virtual void resizeEvent( QResizeEvent* event );
|
||||||
|
|
||||||
void paintEvent( QPaintEvent* event );
|
void paintEvent( QPaintEvent* event );
|
||||||
|
void keyPressEvent( QKeyEvent* event );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onFilterChanged( const QString& filter );
|
void onFilterChanged( const QString& filter );
|
||||||
|
@@ -137,12 +137,13 @@ DynamicModel::trackResolveFinished( bool success )
|
|||||||
|
|
||||||
Query* q = qobject_cast<Query*>( sender() );
|
Query* q = qobject_cast<Query*>( sender() );
|
||||||
|
|
||||||
qDebug() << "Got resolveFinished in DynamicModel" << q->track() << q->artist();
|
tDebug() << "Got resolveFinished in DynamicModel" << q->track() << q->artist();
|
||||||
if ( !m_waitingFor.contains( q ) )
|
if ( !m_waitingFor.contains( q ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !q->playable() ) {
|
if ( !q->playable() )
|
||||||
qDebug() << "Got not playable or resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
{
|
||||||
|
tDebug() << "Got not playable or resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
||||||
m_currentAttempts++;
|
m_currentAttempts++;
|
||||||
|
|
||||||
int curAttempts = m_startingAfterFailed ? m_currentAttempts - 20 : m_currentAttempts; // if we just failed, m_currentAttempts includes those failures
|
int curAttempts = m_startingAfterFailed ? m_currentAttempts - 20 : m_currentAttempts; // if we just failed, m_currentAttempts includes those failures
|
||||||
@@ -154,7 +155,8 @@ DynamicModel::trackResolveFinished( bool success )
|
|||||||
emit trackGenerationFailure( tr( "Could not find a playable track.\n\nPlease change the filters or try again." ) );
|
emit trackGenerationFailure( tr( "Could not find a playable track.\n\nPlease change the filters or try again." ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
qDebug() << "Got successful resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
qDebug() << "Got successful resolved track:" << q->track() << q->artist() << m_lastResolvedRow << m_currentAttempts;
|
||||||
|
|
||||||
if( m_currentAttempts > 0 ) {
|
if( m_currentAttempts > 0 ) {
|
||||||
|
@@ -91,7 +91,6 @@ class DLLEXPORT DynamicPlaylist : public Playlist
|
|||||||
public:
|
public:
|
||||||
virtual ~DynamicPlaylist();
|
virtual ~DynamicPlaylist();
|
||||||
|
|
||||||
|
|
||||||
static Tomahawk::dynplaylist_ptr load( const QString& guid );
|
static Tomahawk::dynplaylist_ptr load( const QString& guid );
|
||||||
|
|
||||||
/// Generate an empty dynamic playlist with default generator
|
/// Generate an empty dynamic playlist with default generator
|
||||||
|
@@ -63,6 +63,7 @@ public:
|
|||||||
virtual ~DynamicWidget();
|
virtual ~DynamicWidget();
|
||||||
|
|
||||||
void loadDynamicPlaylist( const dynplaylist_ptr& playlist );
|
void loadDynamicPlaylist( const dynplaylist_ptr& playlist );
|
||||||
|
dynplaylist_ptr playlist() { return m_playlist; }
|
||||||
|
|
||||||
virtual PlaylistInterface* playlistInterface() const;
|
virtual PlaylistInterface* playlistInterface() const;
|
||||||
|
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#include "topbar.h"
|
#include "topbar.h"
|
||||||
#include "ui_topbar.h"
|
#include "ui_topbar.h"
|
||||||
|
|
||||||
|
#include "searchbutton.h"
|
||||||
|
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@@ -48,10 +50,12 @@ TopBar::TopBar( QWidget* parent )
|
|||||||
connect( ui->filterEdit, SIGNAL( textChanged( QString ) ), SIGNAL( filterTextChanged( QString ) ) );
|
connect( ui->filterEdit, SIGNAL( textChanged( QString ) ), SIGNAL( filterTextChanged( QString ) ) );
|
||||||
|
|
||||||
ui->filterEdit->setStyleSheet( "QLineEdit { border: 1px solid gray; border-radius: 6px; margin-right: 2px; }" );
|
ui->filterEdit->setStyleSheet( "QLineEdit { border: 1px solid gray; border-radius: 6px; margin-right: 2px; }" );
|
||||||
|
ui->filterEdit->setInactiveText( tr( "Filter" ) );
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
ui->filterEdit->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
ui->filterEdit->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
#endif
|
#endif
|
||||||
ui->filterEdit->setInactiveText( tr( "Filter" ) );
|
|
||||||
|
ui->filterEdit->searchButton()->setImage( QImage( RESPATH "images/filter.png" ) );
|
||||||
|
|
||||||
// initialise dudes
|
// initialise dudes
|
||||||
for( int i = 0; i < MAXDUDES; ++i )
|
for( int i = 0; i < MAXDUDES; ++i )
|
||||||
|
@@ -127,8 +127,8 @@ Query::addResults( const QList< Tomahawk::result_ptr >& newresults )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit resultsAdded( newresults );
|
|
||||||
checkResults();
|
checkResults();
|
||||||
|
emit resultsAdded( newresults );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -169,10 +169,13 @@ Query::removeResult( const Tomahawk::result_ptr& result )
|
|||||||
void
|
void
|
||||||
Query::onResolvingFinished()
|
Query::onResolvingFinished()
|
||||||
{
|
{
|
||||||
// qDebug() << Q_FUNC_INFO << "Finished resolving." << toString();
|
tDebug() << "Finished resolving:" << toString();
|
||||||
|
if ( !m_resolveFinished )
|
||||||
|
{
|
||||||
m_resolveFinished = true;
|
m_resolveFinished = true;
|
||||||
emit resolvingFinished( m_solved );
|
emit resolvingFinished( m_solved );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -104,6 +104,11 @@ AnimatedSplitter::onSizeChanged( const QSize& size )
|
|||||||
if ( i == m_greedyIndex )
|
if ( i == m_greedyIndex )
|
||||||
{
|
{
|
||||||
j = height() - size.height();
|
j = height() - size.height();
|
||||||
|
for ( int x = 0; x < count(); x++ )
|
||||||
|
{
|
||||||
|
if ( x != i && x != wi )
|
||||||
|
j -= widget( x )->height();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( i == wi )
|
else if ( i == wi )
|
||||||
{
|
{
|
||||||
@@ -145,7 +150,7 @@ AnimatedWidget::AnimatedWidget( AnimatedSplitter* parent )
|
|||||||
, m_isHidden( false )
|
, m_isHidden( false )
|
||||||
{
|
{
|
||||||
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
|
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
|
||||||
m_timeLine->setUpdateInterval( 5 );
|
m_timeLine->setUpdateInterval( 20 );
|
||||||
m_timeLine->setEasingCurve( QEasingCurve::OutBack );
|
m_timeLine->setEasingCurve( QEasingCurve::OutBack );
|
||||||
|
|
||||||
connect( m_timeLine, SIGNAL( frameChanged( int ) ), SLOT( onAnimationStep( int ) ) );
|
connect( m_timeLine, SIGNAL( frameChanged( int ) ), SLOT( onAnimationStep( int ) ) );
|
||||||
|
@@ -621,6 +621,8 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_stack->setCurrentWidget( page->widget() );
|
m_stack->setCurrentWidget( page->widget() );
|
||||||
|
page->widget()->setFocus();
|
||||||
|
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,11 +31,7 @@ HeaderLabel::HeaderLabel( QWidget* parent )
|
|||||||
{
|
{
|
||||||
QFont f( font() );
|
QFont f( font() );
|
||||||
f.setBold( true );
|
f.setBold( true );
|
||||||
f.setPointSize( 11 );
|
f.setPixelSize( 12 );
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
|
||||||
f.setPointSize( f.pointSize() - 2 );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
setFont( f );
|
setFont( f );
|
||||||
setFixedHeight( sizeHint().height() + 8 );
|
setFixedHeight( sizeHint().height() + 8 );
|
||||||
|
@@ -56,6 +56,8 @@ NewPlaylistWidget::NewPlaylistWidget( QWidget* parent )
|
|||||||
ui->suggestionsView->overlay()->setEnabled( false );
|
ui->suggestionsView->overlay()->setEnabled( false );
|
||||||
|
|
||||||
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( updateSuggestions() ) );
|
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( updateSuggestions() ) );
|
||||||
|
|
||||||
|
ui->titleEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -34,9 +34,6 @@
|
|||||||
<height>26</height>
|
<height>26</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::StrongFocus</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@@ -48,7 +48,7 @@ public:
|
|||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
||||||
virtual bool isTemporaryPage() const { return true; }
|
virtual bool isTemporaryPage() const { return true; }
|
||||||
|
|
||||||
virtual QString title() const { return tr( "Search" ); }
|
virtual QString title() const { return QString( tr( "Search: %1" ) ).arg( m_search ); }
|
||||||
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
|
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
|
||||||
|
|
||||||
virtual bool showStatsBar() const { return false; }
|
virtual bool showStatsBar() const { return false; }
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
|
|
||||||
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
@@ -20,11 +19,11 @@
|
|||||||
|
|
||||||
#include "welcomeplaylistmodel.h"
|
#include "welcomeplaylistmodel.h"
|
||||||
|
|
||||||
#include <tomahawksettings.h>
|
#include "tomahawksettings.h"
|
||||||
#include <audio/audioengine.h>
|
#include "audio/audioengine.h"
|
||||||
#include <sourcelist.h>
|
#include "sourcelist.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include <dynamic/DynamicPlaylist.h>
|
#include "dynamic/DynamicPlaylist.h"
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
|
@@ -159,6 +159,10 @@ SettingsDialog::SettingsDialog( QWidget *parent )
|
|||||||
ui->lineEditLastfmPassword->setText(s->lastFmPassword() );
|
ui->lineEditLastfmPassword->setText(s->lastFmPassword() );
|
||||||
connect( ui->pushButtonTestLastfmLogin, SIGNAL( clicked( bool) ), this, SLOT( testLastFmLogin() ) );
|
connect( ui->pushButtonTestLastfmLogin, SIGNAL( clicked( bool) ), this, SLOT( testLastFmLogin() ) );
|
||||||
|
|
||||||
|
#ifdef Q_WS_MAC // FIXME
|
||||||
|
ui->pushButtonTestLastfmLogin->setVisible( false );
|
||||||
|
#endif
|
||||||
|
|
||||||
// SCRIPT RESOLVER
|
// SCRIPT RESOLVER
|
||||||
ui->removeScript->setEnabled( false );
|
ui->removeScript->setEnabled( false );
|
||||||
ResolverConfigDelegate* del = new ResolverConfigDelegate( this );
|
ResolverConfigDelegate* del = new ResolverConfigDelegate( this );
|
||||||
|
@@ -180,6 +180,20 @@ PlaylistItem::setData( const QVariant& v, bool role )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
PlaylistItem::activateCurrent()
|
||||||
|
{
|
||||||
|
if( ViewManager::instance()->pageForPlaylist( m_playlist ) == ViewManager::instance()->currentPage() )
|
||||||
|
{
|
||||||
|
model()->linkSourceItemToPage( this, ViewManager::instance()->currentPage() );
|
||||||
|
emit selectRequest( this );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DynamicPlaylistItem::DynamicPlaylistItem( SourcesModel* mdl, SourceTreeItem* parent, const dynplaylist_ptr& pl, int index )
|
DynamicPlaylistItem::DynamicPlaylistItem( SourcesModel* mdl, SourceTreeItem* parent, const dynplaylist_ptr& pl, int index )
|
||||||
: PlaylistItem( mdl, parent, pl.staticCast< Playlist >(), index )
|
: PlaylistItem( mdl, parent, pl.staticCast< Playlist >(), index )
|
||||||
@@ -312,3 +326,18 @@ DynamicPlaylistItem::icon() const
|
|||||||
return QIcon( RESPATH "images/automatic-playlist.png" );
|
return QIcon( RESPATH "images/automatic-playlist.png" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
DynamicPlaylistItem::activateCurrent()
|
||||||
|
{
|
||||||
|
if( ViewManager::instance()->pageForDynPlaylist( m_dynplaylist ) == ViewManager::instance()->currentPage() )
|
||||||
|
{
|
||||||
|
model()->linkSourceItemToPage( this, ViewManager::instance()->currentPage() );
|
||||||
|
emit selectRequest( this );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -37,6 +37,8 @@ public:
|
|||||||
virtual bool setData(const QVariant& v, bool role);
|
virtual bool setData(const QVariant& v, bool role);
|
||||||
virtual int peerSortValue() const;
|
virtual int peerSortValue() const;
|
||||||
|
|
||||||
|
virtual bool activateCurrent();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setLoaded( bool loaded );
|
void setLoaded( bool loaded );
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ public:
|
|||||||
virtual int peerSortValue() const;
|
virtual int peerSortValue() const;
|
||||||
virtual QIcon icon() const;
|
virtual QIcon icon() const;
|
||||||
|
|
||||||
|
virtual bool activateCurrent();
|
||||||
private slots:
|
private slots:
|
||||||
void onDynamicPlaylistLoaded( Tomahawk::DynamicPlaylistRevision revision );
|
void onDynamicPlaylistLoaded( Tomahawk::DynamicPlaylistRevision revision );
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include "globalactionmanager.h"
|
#include "globalactionmanager.h"
|
||||||
|
#include "items/playlistitems.h"
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -281,10 +282,37 @@ SourcesModel::viewPageActivated( Tomahawk::ViewPage* page )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// HACK
|
||||||
|
// try to find it if it is a playlist. not pretty at all.... but this happens when ViewManager loads a playlist or dynplaylist NOT from the sidebar but from somewhere else
|
||||||
|
// we don't know which sourcetreeitem is related to it, so we have to find it. we also don't know if this page is a playlist or dynplaylist or not, but we can't check as we can't
|
||||||
|
// include DynamicWidget.h here (so can't dynamic_cast).
|
||||||
|
// this could also be fixed by keeping a master list of playlists/sourcetreeitems... but that's even uglier i think. this is only called the first time a certain viewpage is clicked from external
|
||||||
|
// sources.
|
||||||
|
if( activatePlaylistPage( page, m_rootItem ) )
|
||||||
m_viewPageDelayedCacheItem = page;
|
m_viewPageDelayedCacheItem = page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SourcesModel::activatePlaylistPage( ViewPage* p, SourceTreeItem* i )
|
||||||
|
{
|
||||||
|
if( !i )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( qobject_cast< PlaylistItem* >( i ) &&
|
||||||
|
qobject_cast< PlaylistItem* >( i )->activateCurrent() )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
bool ret = false;
|
||||||
|
for( int k = 0; k < i->children().size(); k++ )
|
||||||
|
{
|
||||||
|
if( activatePlaylistPage( p, i->children().at( k ) ) )
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SourcesModel::loadSources()
|
SourcesModel::loadSources()
|
||||||
@@ -328,6 +356,7 @@ SourcesModel::itemUpdated()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QModelIndex idx = indexFromItem( item );
|
QModelIndex idx = indexFromItem( item );
|
||||||
|
if( idx.isValid() )
|
||||||
emit dataChanged( idx, idx );
|
emit dataChanged( idx, idx );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,7 +458,11 @@ SourcesModel::indexFromItem( SourceTreeItem* item ) const
|
|||||||
QList< int > childIndexList;
|
QList< int > childIndexList;
|
||||||
SourceTreeItem* curItem = item;
|
SourceTreeItem* curItem = item;
|
||||||
while( curItem != m_rootItem ) {
|
while( curItem != m_rootItem ) {
|
||||||
childIndexList << rowForItem( curItem );
|
int row = rowForItem( curItem );
|
||||||
|
if( row < 0 ) // something went wrong, bail
|
||||||
|
return QModelIndex();
|
||||||
|
|
||||||
|
childIndexList << row;
|
||||||
|
|
||||||
curItem = curItem->parent();
|
curItem = curItem->parent();
|
||||||
}
|
}
|
||||||
@@ -448,6 +481,9 @@ SourcesModel::indexFromItem( SourceTreeItem* item ) const
|
|||||||
int
|
int
|
||||||
SourcesModel::rowForItem( SourceTreeItem* item ) const
|
SourcesModel::rowForItem( SourceTreeItem* item ) const
|
||||||
{
|
{
|
||||||
|
if( !item || !item->parent() || !item->parent()->children().contains( item ) )
|
||||||
|
return -1;
|
||||||
|
|
||||||
return item->parent()->children().indexOf( item );
|
return item->parent()->children().indexOf( item );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -113,6 +113,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
|
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
|
||||||
int rowForItem( SourceTreeItem* item ) const;
|
int rowForItem( SourceTreeItem* item ) const;
|
||||||
|
bool activatePlaylistPage( Tomahawk::ViewPage* p, SourceTreeItem* i );
|
||||||
|
|
||||||
SourceTreeItem* m_rootItem;
|
SourceTreeItem* m_rootItem;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user