Merge branch 'master' into atticafixes-waiting-on-attica-release
@ -25,6 +25,7 @@ option(BUILD_GUI "Build Tomahawk with GUI" ON)
|
||||
option(BUILD_RELEASE "Generate TOMAHAWK_VERSION without GIT info" OFF)
|
||||
option(WITH_BREAKPAD "Build with breakpad integration" ON)
|
||||
option(WITH_CRASHREPORTER "Build with CrashReporter" ON)
|
||||
option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers automatically" ON)
|
||||
option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF)
|
||||
|
||||
IF( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" )
|
||||
@ -68,7 +69,7 @@ SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
||||
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" )
|
||||
|
||||
# make predefined install dirs available everywhere
|
||||
INCLUDE(GNUInstallDirs)
|
||||
INCLUDE( GNUInstallDirs )
|
||||
|
||||
# installer creation
|
||||
INCLUDE( TomahawkCPack.cmake )
|
||||
@ -132,11 +133,8 @@ macro_log_feature(JREEN_FOUND "Jreen" "Qt XMPP Library" "http://qutim.org/jreen
|
||||
macro_optional_find_package(QTweetLib)
|
||||
macro_log_feature(QTWEETLIB_FOUND "QTweetLib" "Qt Twitter Library" "https://github.com/minimoog/QTweetLib" FALSE "" "QTweetLib is needed for the Twitter SIP plugin.\n")
|
||||
|
||||
# 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)
|
||||
macro_optional_find_package(LibLastFm 1.0.0)
|
||||
macro_log_feature(LIBLASTFM_FOUND "liblastfm" "Qt library for the Last.fm webservices" "https://github.com/eartle/liblastfm" TRUE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
|
||||
|
||||
#### submodules start
|
||||
# automatically init submodules here, don't delete this code we may add submodules again
|
||||
|
@ -1,23 +0,0 @@
|
||||
# - Try to find GLOOX
|
||||
# Find GLOOX headers, libraries and the answer to all questions.
|
||||
#
|
||||
# GLOOX_FOUND True if gloox got found
|
||||
# GLOOX_INCLUDE_DIR Location of gloox headers
|
||||
# GLOOX_LIBRARIES List of libaries to use gloox
|
||||
#
|
||||
# Copyright (c) 2009 Nigmatullin Ruslan <euroelessar@gmail.com>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
FIND_PATH( GLOOX_INCLUDE_DIR "gloox/gloox.h" )
|
||||
FIND_LIBRARY( GLOOX_LIBRARIES gloox )
|
||||
|
||||
if( GLOOX_LIBRARIES AND GLOOX_INCLUDE_DIR )
|
||||
message( STATUS "Found gloox: ${GLOOX_LIBRARIES}" )
|
||||
set( GLOOX_FOUND 1 )
|
||||
else( GLOOX_LIBRARIES AND GLOOX_INCLUDE_DIR )
|
||||
message( STATUS "Could NOT find gloox" )
|
||||
endif( GLOOX_LIBRARIES AND GLOOX_INCLUDE_DIR )
|
@ -30,7 +30,6 @@ ENDIF()
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Jreen
|
||||
REQUIRED_VARS JREEN_LIBRARIES JREEN_INCLUDE_DIR
|
||||
VERSION_VAR PC_JREEN_VERSION)
|
||||
REQUIRED_VARS JREEN_LIBRARIES JREEN_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(JREEN_INCLUDE_DIR JREEN_LIBRARIES)
|
||||
|
@ -1,42 +1,34 @@
|
||||
# - Find LibLastFM
|
||||
# Find the liblastfm includes and the liblastfm libraries
|
||||
# This module defines
|
||||
# LIBLASTFM_INCLUDE_DIR, root lastfm include dir
|
||||
# LIBLASTFM_LIBRARY, the path to liblastfm
|
||||
# LIBLASTFM_FOUND, whether liblastfm was found
|
||||
# - Try to find LibLastFm
|
||||
#
|
||||
# LIBLASTFM_FOUND - system has liblastfm
|
||||
# LIBLASTFM_INCLUDE_DIRS - the liblastfm include directories
|
||||
# LIBLASTFM_LIBRARIES - link these to use liblastfm
|
||||
#
|
||||
# (c) Dominik Schmidt <dev@dominik-schmidt.de>
|
||||
#
|
||||
|
||||
# Dependencies
|
||||
if(NOT QT4_FOUND)
|
||||
find_package(Qt4 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_path(LIBLASTFM_INCLUDE_DIR NAMES Audioscrobbler
|
||||
HINTS
|
||||
~/usr/include
|
||||
/opt/local/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/opt/kde4/include
|
||||
${KDE4_INCLUDE_DIR}
|
||||
PATH_SUFFIXES lastfm
|
||||
# Include dir
|
||||
find_path(LIBLASTFM_INCLUDE_DIR
|
||||
# Track.h doesn't exist in liblastfm-0.3.1, was called Track back then
|
||||
NAMES lastfm/Track.h
|
||||
PATHS ${KDE4_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
find_library( LIBLASTFM_LIBRARY NAMES lastfm
|
||||
PATHS
|
||||
~/usr/lib
|
||||
/opt/local/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/kde4/lib
|
||||
${KDE4_LIB_DIR}
|
||||
# Finally the library itself
|
||||
find_library(LIBLASTFM_LIBRARY
|
||||
NAMES lastfm
|
||||
PATHS ${KDE4_LIB_DIR}
|
||||
)
|
||||
|
||||
set(LIBLASTFM_LIBRARIES ${LIBLASTFM_LIBRARY})
|
||||
set(LIBLASTFM_INCLUDE_DIRS ${LIBLASTFM_INCLUDE_DIR})
|
||||
|
||||
if(LIBLASTFM_INCLUDE_DIR AND LIBLASTFM_LIBRARY)
|
||||
set(LIBLASTFM_FOUND TRUE)
|
||||
message(STATUS "Found liblastfm: ${LIBLASTFM_INCLUDE_DIR}, ${LIBLASTFM_LIBRARY}")
|
||||
else(LIBLASTFM_INCLUDE_DIR AND LIBLASTFM_LIBRARY)
|
||||
set(LIBLASTFM_FOUND FALSE)
|
||||
if (LIBLASTFM_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find required package LibLastFm")
|
||||
endif(LIBLASTFM_FIND_REQUIRED)
|
||||
endif(LIBLASTFM_INCLUDE_DIR AND LIBLASTFM_LIBRARY)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibLastFm DEFAULT_MSG LIBLASTFM_LIBRARIES LIBLASTFM_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(LIBLASTFM_INCLUDE_DIR LIBLASTFM_LIBRARY)
|
||||
mark_as_advanced(LIBLASTFM_LIBRARIES LIBLASTFM_INCLUDE_DIRS)
|
||||
|
@ -278,7 +278,6 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
|
||||
|
||||
File "${INSTALL_PATH}\bin\libqxtweb-standalone.dll"
|
||||
File "${INSTALL_PATH}\bin\libtomahawk_portfwd.dll"
|
||||
File "${INSTALL_PATH}\bin\libtomahawk_lastfm2.dll"
|
||||
File "${INSTALL_PATH}\bin\libtomahawklib.dll"
|
||||
; plugins
|
||||
File "${INSTALL_PATH}\lib\libtomahawk_*_*.dll"
|
||||
@ -293,7 +292,6 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
|
||||
File "${BUILD_PATH}\libtomahawklib.dll"
|
||||
File "${BUILD_PATH}\libqxtweb-standalone.dll"
|
||||
File "${BUILD_PATH}\libtomahawk_portfwd.dll"
|
||||
File "${BUILD_PATH}\libtomahawk_lastfm2.dll"
|
||||
; plugins
|
||||
File "${BUILD_PATH}\libtomahawk_*_*.dll"
|
||||
!endif
|
||||
@ -351,6 +349,7 @@ Section "Tomahawk Player" SEC_TOMAHAWK_PLAYER
|
||||
File "${MING_BIN}\zlib1.dll"
|
||||
|
||||
File "${MING_BIN}\libechonest.dll"
|
||||
File "${MING_BIN}\liblastfm.dll"
|
||||
File "${MING_BIN}\libQTweetLib.dll"
|
||||
File "${MING_BIN}\libquazip.dll"
|
||||
|
||||
|
34
ChangeLog
@ -1,12 +1,32 @@
|
||||
Version 0.5.0:
|
||||
* Added "Stop playback after this track" context menu items.
|
||||
* You can now import your entire Last.fm playback history into Tomahawk.
|
||||
* Support for multimedia keys (Play, Pause, Next etc.) on Windows & Linux.
|
||||
* When listening privately scrobbling to Last.fm is now disabled.
|
||||
* Added a toolbar with page back / forward buttons and the global search.
|
||||
* New grid view with direct playback controls.
|
||||
* Added a track page showing a song's lyrics and other similar tracks.
|
||||
* Priortize resolution of a track on double-click
|
||||
* New Tomahawk logo and icon
|
||||
* Spotify Resolver shipped with Tomahawk and installable via new Preferences interface
|
||||
* Sync select playlists (and updates) with Spotify
|
||||
* Support .aiff (AIFF mimetype) files
|
||||
* Cleaned up Diagnostics window
|
||||
* Don't show non-resolved tracks as Recently Played
|
||||
* Added "Stop playback after this track" context menu items
|
||||
* Double-clicking on a playlist name (in the sidebar) will play the playlist
|
||||
* You can now import your entire Last.fm playback history into Tomahawk
|
||||
* Related Artists now sorted by relatedness
|
||||
* Support for multimedia keys (Play, Pause, Next etc.) on Windows & Linux
|
||||
* When listening privately scrobbling to Last.fm and Adium is now disabled
|
||||
* Added a toolbar with page back / forward buttons and the global search
|
||||
* New grid view with direct playback controls (Charts, Album Page, Artist Page, Track Page)
|
||||
* New Releases (by Genre) pages added
|
||||
* Add social sharing widget in Now Playing Controls
|
||||
* Added a track page showing a song's lyrics and other similar tracks
|
||||
* Selecting Track name in Now Playing now brings you to Track page
|
||||
* Separate Loved Tracks and Recently Played views per source.
|
||||
* Added animated spinner where needed
|
||||
* Some new sidebar icons
|
||||
* Support Transifex for localization and add translations for Arabic, French, Bulgarian, Catalan, Spanish (Castillian), and more.
|
||||
* New Context Menu items (Love, Add to Queue, etc.)
|
||||
* Fading album art
|
||||
* New Account and Plug-in Preferences/Management Interface
|
||||
* Fix XSPF auto-updating
|
||||
|
||||
|
||||
Version 0.4.2:
|
||||
* Fix ZeroConf protocol showing IP addresses instead of host names.
|
||||
|
@ -29,159 +29,159 @@ LIBRARY_SEARCH_PATH=['/usr/local/lib', '/usr/local/Cellar/gettext/0.18.1.1/lib',
|
||||
|
||||
|
||||
VLC_PLUGINS=[
|
||||
'access/libaccess_attachment_plugin.dylib',
|
||||
#'access/libaccess_avio_plugin.dylib',
|
||||
'access/libaccess_fake_plugin.dylib',
|
||||
'access/libaccess_ftp_plugin.dylib',
|
||||
'access/libaccess_http_plugin.dylib',
|
||||
'access/libaccess_imem_plugin.dylib',
|
||||
'access/libaccess_mmap_plugin.dylib',
|
||||
'access/libaccess_mms_plugin.dylib',
|
||||
'access/libaccess_realrtsp_plugin.dylib',
|
||||
'access/libaccess_tcp_plugin.dylib',
|
||||
'access/libaccess_udp_plugin.dylib',
|
||||
'access/libcdda_plugin.dylib',
|
||||
'access/libfilesystem_plugin.dylib',
|
||||
'access/libqtcapture_plugin.dylib',
|
||||
'access/librtp_plugin.dylib',
|
||||
'access/libzip_plugin.dylib',
|
||||
'access_output/libaccess_output_dummy_plugin.dylib',
|
||||
'access_output/libaccess_output_file_plugin.dylib',
|
||||
'access_output/libaccess_output_http_plugin.dylib',
|
||||
'access_output/libaccess_output_shout_plugin.dylib',
|
||||
'access_output/libaccess_output_udp_plugin.dylib',
|
||||
'audio_filter/liba52tofloat32_plugin.dylib',
|
||||
'audio_filter/liba52tospdif_plugin.dylib',
|
||||
'audio_filter/libaudio_format_plugin.dylib',
|
||||
'audio_filter/libaudiobargraph_a_plugin.dylib',
|
||||
'audio_filter/libchorus_flanger_plugin.dylib',
|
||||
'audio_filter/libconverter_fixed_plugin.dylib',
|
||||
'audio_filter/libdolby_surround_decoder_plugin.dylib',
|
||||
'audio_filter/libdtstofloat32_plugin.dylib',
|
||||
'audio_filter/libdtstospdif_plugin.dylib',
|
||||
'audio_filter/libequalizer_plugin.dylib',
|
||||
'audio_filter/libheadphone_channel_mixer_plugin.dylib',
|
||||
'audio_filter/libmono_plugin.dylib',
|
||||
'audio_filter/libmpgatofixed32_plugin.dylib',
|
||||
'audio_filter/libnormvol_plugin.dylib',
|
||||
'audio_filter/libparam_eq_plugin.dylib',
|
||||
'audio_filter/libscaletempo_plugin.dylib',
|
||||
'audio_filter/libsimple_channel_mixer_plugin.dylib',
|
||||
'audio_filter/libspatializer_plugin.dylib',
|
||||
'audio_filter/libtrivial_channel_mixer_plugin.dylib',
|
||||
'audio_filter/libugly_resampler_plugin.dylib',
|
||||
'audio_mixer/libfloat32_mixer_plugin.dylib',
|
||||
'audio_mixer/libspdif_mixer_plugin.dylib',
|
||||
'audio_mixer/libtrivial_mixer_plugin.dylib',
|
||||
'audio_output/libaout_file_plugin.dylib',
|
||||
'audio_output/libauhal_plugin.dylib',
|
||||
'codec/liba52_plugin.dylib',
|
||||
'codec/libadpcm_plugin.dylib',
|
||||
'codec/libaes3_plugin.dylib',
|
||||
'codec/libaraw_plugin.dylib',
|
||||
'codec/libavcodec_plugin.dylib',
|
||||
'codec/libcc_plugin.dylib',
|
||||
'codec/libcdg_plugin.dylib',
|
||||
'codec/libdts_plugin.dylib',
|
||||
'codec/libfaad_plugin.dylib',
|
||||
'codec/libfake_plugin.dylib',
|
||||
'codec/libflac_plugin.dylib',
|
||||
'codec/libfluidsynth_plugin.dylib',
|
||||
'codec/libinvmem_plugin.dylib',
|
||||
'codec/liblpcm_plugin.dylib',
|
||||
'codec/libmpeg_audio_plugin.dylib',
|
||||
'codec/libpng_plugin.dylib',
|
||||
'codec/librawvideo_plugin.dylib',
|
||||
'codec/libspeex_plugin.dylib',
|
||||
'codec/libspudec_plugin.dylib',
|
||||
'codec/libtheora_plugin.dylib',
|
||||
'codec/libtwolame_plugin.dylib',
|
||||
'codec/libvorbis_plugin.dylib',
|
||||
'control/libgestures_plugin.dylib',
|
||||
'control/libhotkeys_plugin.dylib',
|
||||
'control/libmotion_plugin.dylib',
|
||||
'control/libnetsync_plugin.dylib',
|
||||
'control/libsignals_plugin.dylib',
|
||||
'demux/libaiff_plugin.dylib',
|
||||
'demux/libasf_plugin.dylib',
|
||||
'demux/libau_plugin.dylib',
|
||||
#'demux/libavformat_plugin.dylib',
|
||||
'demux/libavi_plugin.dylib',
|
||||
'demux/libdemux_cdg_plugin.dylib',
|
||||
'demux/libdemuxdump_plugin.dylib',
|
||||
'demux/libdirac_plugin.dylib',
|
||||
'demux/libes_plugin.dylib',
|
||||
'demux/libflacsys_plugin.dylib',
|
||||
'demux/liblive555_plugin.dylib',
|
||||
'demux/libmkv_plugin.dylib',
|
||||
'demux/libmod_plugin.dylib',
|
||||
'demux/libmp4_plugin.dylib',
|
||||
'demux/libmpc_plugin.dylib',
|
||||
'demux/libmpgv_plugin.dylib',
|
||||
'demux/libnsc_plugin.dylib',
|
||||
'demux/libnsv_plugin.dylib',
|
||||
'demux/libnuv_plugin.dylib',
|
||||
'demux/libogg_plugin.dylib',
|
||||
'demux/libplaylist_plugin.dylib',
|
||||
'demux/libps_plugin.dylib',
|
||||
'demux/libpva_plugin.dylib',
|
||||
'demux/librawaud_plugin.dylib',
|
||||
'demux/librawdv_plugin.dylib',
|
||||
'demux/librawvid_plugin.dylib',
|
||||
'demux/libreal_plugin.dylib',
|
||||
'demux/libsmf_plugin.dylib',
|
||||
'demux/libts_plugin.dylib',
|
||||
'demux/libtta_plugin.dylib',
|
||||
'demux/libty_plugin.dylib',
|
||||
'demux/libvc1_plugin.dylib',
|
||||
'demux/libvoc_plugin.dylib',
|
||||
'demux/libwav_plugin.dylib',
|
||||
'demux/libxa_plugin.dylib',
|
||||
'meta_engine/libfolder_plugin.dylib',
|
||||
'meta_engine/libtaglib_plugin.dylib',
|
||||
'misc/libaudioscrobbler_plugin.dylib',
|
||||
'misc/libdummy_plugin.dylib',
|
||||
'misc/libexport_plugin.dylib',
|
||||
'misc/libfreetype_plugin.dylib',
|
||||
'misc/libgnutls_plugin.dylib',
|
||||
'misc/liblogger_plugin.dylib',
|
||||
'misc/liblua_plugin.dylib',
|
||||
'misc/libosd_parser_plugin.dylib',
|
||||
'misc/libquartztext_plugin.dylib',
|
||||
'misc/libstats_plugin.dylib',
|
||||
'misc/libvod_rtsp_plugin.dylib',
|
||||
'misc/libxml_plugin.dylib',
|
||||
'misc/libxtag_plugin.dylib',
|
||||
'mmx/libi420_rgb_mmx_plugin.dylib',
|
||||
'mmx/libi420_yuy2_mmx_plugin.dylib',
|
||||
'mmx/libi422_yuy2_mmx_plugin.dylib',
|
||||
'mmx/libmemcpymmx_plugin.dylib',
|
||||
'mmxext/libmemcpymmxext_plugin.dylib',
|
||||
'mux/libmux_asf_plugin.dylib',
|
||||
'mux/libmux_avi_plugin.dylib',
|
||||
'mux/libmux_dummy_plugin.dylib',
|
||||
'mux/libmux_mp4_plugin.dylib',
|
||||
'mux/libmux_mpjpeg_plugin.dylib',
|
||||
'mux/libmux_ogg_plugin.dylib',
|
||||
'mux/libmux_ps_plugin.dylib',
|
||||
'mux/libmux_ts_plugin.dylib',
|
||||
'mux/libmux_wav_plugin.dylib',
|
||||
'packetizer/libpacketizer_copy_plugin.dylib',
|
||||
'packetizer/libpacketizer_dirac_plugin.dylib',
|
||||
'packetizer/libpacketizer_flac_plugin.dylib',
|
||||
'packetizer/libpacketizer_h264_plugin.dylib',
|
||||
'packetizer/libpacketizer_mlp_plugin.dylib',
|
||||
'packetizer/libpacketizer_mpeg4audio_plugin.dylib',
|
||||
'packetizer/libpacketizer_mpeg4video_plugin.dylib',
|
||||
'packetizer/libpacketizer_mpegvideo_plugin.dylib',
|
||||
'packetizer/libpacketizer_vc1_plugin.dylib',
|
||||
'sse2/libi420_rgb_sse2_plugin.dylib',
|
||||
'sse2/libi420_yuy2_sse2_plugin.dylib',
|
||||
'sse2/libi422_yuy2_sse2_plugin.dylib',
|
||||
'stream_filter/libdecomp_plugin.dylib',
|
||||
'stream_filter/libstream_filter_rar_plugin.dylib',
|
||||
'stream_filter/libstream_filter_record_plugin.dylib',
|
||||
'visualization/libvisual_plugin.dylib',
|
||||
'libaccess_attachment_plugin.dylib',
|
||||
#'libaccess_avio_plugin.dylib',
|
||||
#'libaccess_fake_plugin.dylib',
|
||||
'libaccess_ftp_plugin.dylib',
|
||||
'libaccess_http_plugin.dylib',
|
||||
'libaccess_imem_plugin.dylib',
|
||||
#'libaccess_mmap_plugin.dylib',
|
||||
'libaccess_mms_plugin.dylib',
|
||||
'libaccess_realrtsp_plugin.dylib',
|
||||
'libaccess_tcp_plugin.dylib',
|
||||
'libaccess_udp_plugin.dylib',
|
||||
'libcdda_plugin.dylib',
|
||||
'libfilesystem_plugin.dylib',
|
||||
'libqtcapture_plugin.dylib',
|
||||
'librtp_plugin.dylib',
|
||||
'libzip_plugin.dylib',
|
||||
'libaccess_output_dummy_plugin.dylib',
|
||||
'libaccess_output_file_plugin.dylib',
|
||||
'libaccess_output_http_plugin.dylib',
|
||||
'libaccess_output_shout_plugin.dylib',
|
||||
'libaccess_output_udp_plugin.dylib',
|
||||
'liba52tofloat32_plugin.dylib',
|
||||
'liba52tospdif_plugin.dylib',
|
||||
'libaudio_format_plugin.dylib',
|
||||
'libaudiobargraph_a_plugin.dylib',
|
||||
'libchorus_flanger_plugin.dylib',
|
||||
'libconverter_fixed_plugin.dylib',
|
||||
'libdolby_surround_decoder_plugin.dylib',
|
||||
'libdtstofloat32_plugin.dylib',
|
||||
'libdtstospdif_plugin.dylib',
|
||||
'libequalizer_plugin.dylib',
|
||||
'libheadphone_channel_mixer_plugin.dylib',
|
||||
'libmono_plugin.dylib',
|
||||
'libmpgatofixed32_plugin.dylib',
|
||||
'libnormvol_plugin.dylib',
|
||||
'libparam_eq_plugin.dylib',
|
||||
'libscaletempo_plugin.dylib',
|
||||
'libsimple_channel_mixer_plugin.dylib',
|
||||
'libspatializer_plugin.dylib',
|
||||
'libtrivial_channel_mixer_plugin.dylib',
|
||||
'libugly_resampler_plugin.dylib',
|
||||
'libfloat32_mixer_plugin.dylib',
|
||||
#'libspdif_mixer_plugin.dylib',
|
||||
#'libtrivial_mixer_plugin.dylib',
|
||||
'libaout_file_plugin.dylib',
|
||||
'libauhal_plugin.dylib',
|
||||
'liba52_plugin.dylib',
|
||||
'libadpcm_plugin.dylib',
|
||||
'libaes3_plugin.dylib',
|
||||
'libaraw_plugin.dylib',
|
||||
'libavcodec_plugin.dylib',
|
||||
'libcc_plugin.dylib',
|
||||
'libcdg_plugin.dylib',
|
||||
'libdts_plugin.dylib',
|
||||
'libfaad_plugin.dylib',
|
||||
#'libfake_plugin.dylib',
|
||||
'libflac_plugin.dylib',
|
||||
'libfluidsynth_plugin.dylib',
|
||||
#'libinvmem_plugin.dylib',
|
||||
'liblpcm_plugin.dylib',
|
||||
'libmpeg_audio_plugin.dylib',
|
||||
'libpng_plugin.dylib',
|
||||
'librawvideo_plugin.dylib',
|
||||
'libspeex_plugin.dylib',
|
||||
'libspudec_plugin.dylib',
|
||||
'libtheora_plugin.dylib',
|
||||
'libtwolame_plugin.dylib',
|
||||
'libvorbis_plugin.dylib',
|
||||
'libgestures_plugin.dylib',
|
||||
'libhotkeys_plugin.dylib',
|
||||
'libmotion_plugin.dylib',
|
||||
'libnetsync_plugin.dylib',
|
||||
#'libsignals_plugin.dylib',
|
||||
'libaiff_plugin.dylib',
|
||||
'libasf_plugin.dylib',
|
||||
'libau_plugin.dylib',
|
||||
#'libavformat_plugin.dylib',
|
||||
'libavi_plugin.dylib',
|
||||
'libdemux_cdg_plugin.dylib',
|
||||
'libdemuxdump_plugin.dylib',
|
||||
'libdirac_plugin.dylib',
|
||||
'libes_plugin.dylib',
|
||||
'libflacsys_plugin.dylib',
|
||||
'liblive555_plugin.dylib',
|
||||
'libmkv_plugin.dylib',
|
||||
'libmod_plugin.dylib',
|
||||
'libmp4_plugin.dylib',
|
||||
'libmpc_plugin.dylib',
|
||||
'libmpgv_plugin.dylib',
|
||||
'libnsc_plugin.dylib',
|
||||
'libnsv_plugin.dylib',
|
||||
'libnuv_plugin.dylib',
|
||||
'libogg_plugin.dylib',
|
||||
'libplaylist_plugin.dylib',
|
||||
'libps_plugin.dylib',
|
||||
'libpva_plugin.dylib',
|
||||
'librawaud_plugin.dylib',
|
||||
'librawdv_plugin.dylib',
|
||||
'librawvid_plugin.dylib',
|
||||
'libreal_plugin.dylib',
|
||||
'libsmf_plugin.dylib',
|
||||
'libts_plugin.dylib',
|
||||
'libtta_plugin.dylib',
|
||||
'libty_plugin.dylib',
|
||||
'libvc1_plugin.dylib',
|
||||
'libvoc_plugin.dylib',
|
||||
'libwav_plugin.dylib',
|
||||
'libxa_plugin.dylib',
|
||||
'libfolder_plugin.dylib',
|
||||
'libtaglib_plugin.dylib',
|
||||
'libaudioscrobbler_plugin.dylib',
|
||||
'libdummy_plugin.dylib',
|
||||
'libexport_plugin.dylib',
|
||||
'libfreetype_plugin.dylib',
|
||||
'libgnutls_plugin.dylib',
|
||||
'liblogger_plugin.dylib',
|
||||
'liblua_plugin.dylib',
|
||||
'libosd_parser_plugin.dylib',
|
||||
'libquartztext_plugin.dylib',
|
||||
'libstats_plugin.dylib',
|
||||
'libvod_rtsp_plugin.dylib',
|
||||
'libxml_plugin.dylib',
|
||||
#'libxtag_plugin.dylib',
|
||||
'libi420_rgb_mmx_plugin.dylib',
|
||||
'libi420_yuy2_mmx_plugin.dylib',
|
||||
'libi422_yuy2_mmx_plugin.dylib',
|
||||
'libmemcpymmx_plugin.dylib',
|
||||
'libmemcpymmxext_plugin.dylib',
|
||||
'libmux_asf_plugin.dylib',
|
||||
'libmux_avi_plugin.dylib',
|
||||
'libmux_dummy_plugin.dylib',
|
||||
'libmux_mp4_plugin.dylib',
|
||||
'libmux_mpjpeg_plugin.dylib',
|
||||
'libmux_ogg_plugin.dylib',
|
||||
'libmux_ps_plugin.dylib',
|
||||
'libmux_ts_plugin.dylib',
|
||||
'libmux_wav_plugin.dylib',
|
||||
'libpacketizer_copy_plugin.dylib',
|
||||
'libpacketizer_dirac_plugin.dylib',
|
||||
'libpacketizer_flac_plugin.dylib',
|
||||
'libpacketizer_h264_plugin.dylib',
|
||||
'libpacketizer_mlp_plugin.dylib',
|
||||
'libpacketizer_mpeg4audio_plugin.dylib',
|
||||
'libpacketizer_mpeg4video_plugin.dylib',
|
||||
'libpacketizer_mpegvideo_plugin.dylib',
|
||||
'libpacketizer_vc1_plugin.dylib',
|
||||
'libi420_rgb_sse2_plugin.dylib',
|
||||
'libi420_yuy2_sse2_plugin.dylib',
|
||||
'libi422_yuy2_sse2_plugin.dylib',
|
||||
'libdecomp_plugin.dylib',
|
||||
'libstream_filter_rar_plugin.dylib',
|
||||
'libstream_filter_record_plugin.dylib',
|
||||
'libvisual_plugin.dylib',
|
||||
]
|
||||
|
||||
VLC_SEARCH_PATH=[
|
||||
@ -203,10 +203,20 @@ TOMAHAWK_PLUGINS = [
|
||||
'libtomahawk_account_google.so',
|
||||
'libtomahawk_account_twitter.so',
|
||||
'libtomahawk_account_zeroconf.so',
|
||||
'libtomahawk_infoplugin_adium.so',
|
||||
'libtomahawk_infoplugin_charts.so',
|
||||
'libtomahawk_infoplugin_discogs.so',
|
||||
'libtomahawk_infoplugin_echonest.so',
|
||||
'libtomahawk_infoplugin_hypem.so',
|
||||
'libtomahawk_infoplugin_musicbrainz.so',
|
||||
'libtomahawk_infoplugin_musixmatch.so',
|
||||
'libtomahawk_infoplugin_newreleases.so',
|
||||
'libtomahawk_infoplugin_rovi.so',
|
||||
'libtomahawk_infoplugin_spotify.so',
|
||||
]
|
||||
|
||||
QT_PLUGINS_SEARCH_PATH=[
|
||||
'/usr/local/Cellar/qt/4.7.4/plugins',
|
||||
'/usr/local/Cellar/qt/4.8.2/plugins',
|
||||
]
|
||||
|
||||
|
||||
@ -249,7 +259,7 @@ frameworks_dir = os.path.join(bundle_dir, 'Contents', 'Frameworks')
|
||||
commands.append(['mkdir', '-p', frameworks_dir])
|
||||
resources_dir = os.path.join(bundle_dir, 'Contents', 'Resources')
|
||||
commands.append(['mkdir', '-p', resources_dir])
|
||||
plugins_dir = os.path.join(bundle_dir, 'Contents', 'PlugIns')
|
||||
plugins_dir = os.path.join(bundle_dir, 'Contents', 'qt-plugins')
|
||||
binary = os.path.join(bundle_dir, 'Contents', 'MacOS', bundle_name)
|
||||
|
||||
fixed_libraries = []
|
||||
@ -363,8 +373,7 @@ def FixVLCPlugin(abs_path, subdir):
|
||||
FixAllLibraries(broken_libs)
|
||||
|
||||
#print "Copying plugin....%s %s %s" % (plugins_dir, subdir, os.path.join(abs_path.split('/')[-2:]))
|
||||
plugindir = abs_path.split('/')[-2]
|
||||
new_path = os.path.join(plugins_dir, subdir, plugindir, os.path.basename(abs_path))
|
||||
new_path = os.path.join(plugins_dir, subdir, os.path.basename(abs_path))
|
||||
args = ['mkdir', '-p', os.path.dirname(new_path)]
|
||||
commands.append(args)
|
||||
args = ['ditto', '--arch=i386', '--arch=x86_64', abs_path, new_path]
|
||||
@ -490,7 +499,7 @@ def FindVLCPlugin(name):
|
||||
FixBinary(binary)
|
||||
|
||||
for plugin in VLC_PLUGINS:
|
||||
FixVLCPlugin(FindVLCPlugin(plugin), '../Frameworks/vlc/plugins')
|
||||
FixVLCPlugin(FindVLCPlugin(plugin), '../plugins')
|
||||
|
||||
for plugin in TOMAHAWK_PLUGINS:
|
||||
FixPlugin(plugin, '../MacOS')
|
||||
|
@ -1,2 +1,2 @@
|
||||
[Paths]
|
||||
Plugins = PlugIns
|
||||
Plugins = qt-plugins
|
||||
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 19 KiB |
@ -1,304 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="600px" height="600px" viewBox="0 0 600 600" enable-background="new 0 0 600 600" xml:space="preserve">
|
||||
<path fill="#010101" d="M543.773,253.359c0-49.962-19.305-86.572-54.194-104.54C477.84,71.133,405.027,13.418,316.568,13.418
|
||||
c-86.917,0-159.483,56.481-172.605,132.58c-38.049,16.818-59.889,55.24-59.889,107.361c0,27.029,7.188,51.824,20.321,71.749
|
||||
c-1.816,1.565-3.444,3.282-4.77,5.239c0,0,2.582,2.359,3.689,3.373c-4.262,2.123-8.22,4.322-11.555,6.67
|
||||
c0,0,3.021,7.355,5.896,14.353c-11.991,9.688-21.312,18.92-27.553,27.51c0,0,1.611,1.789,2.011,2.225
|
||||
c-12.354,9.158-22.133,18.205-28.528,27.021c0,0,6.927,7.35,12.408,13.166c-17.824,28.76-43.348,74.85-43.348,102.988
|
||||
c0,3.278,0.346,6.315,1.093,9.053c1.764,6.443,5.752,11.438,11.229,14.059c15.255,7.312,39.646-6.362,72.589-40.434
|
||||
c-0.828,8.287-1.457,16.662-1.457,24.736c0,16.805,2.266,32.069,8.77,41.25c4.887,6.895,10.898,9.067,15.084,9.682
|
||||
c6.723,0.99,26.375,3.797,57.992-61.295c2.678,0.705,5.421,1.178,8.235,1.178c8.798,0,17.065-3.424,23.287-9.639
|
||||
c4.284-4.287,7.133-9.584,8.562-15.312c7.516-2.129,14.555-6.701,20.779-13.19c19.562,24.86,44.779,37.643,75.38,37.643
|
||||
c7.317,0,14.474-0.754,21.281-2.242c0.392-0.073,2.555-0.623,2.555-0.623l0.62-0.166c23.05-5.823,42.463-20.409,58-43.254
|
||||
c7.2,9.23,15.731,15.994,24.849,19.457c1.141,6.658,4.226,12.808,9.102,17.691c6.22,6.213,14.487,9.639,23.288,9.639
|
||||
c8.798,0,17.063-3.426,23.285-9.639c6.221-6.229,9.647-14.494,9.647-23.293c0-8.797-3.429-17.066-9.647-23.293
|
||||
c-2.988-2.988-6.478-5.297-10.248-6.924c0.275-2.947,0.611-5.849,0.611-9.009c0-10.028-1.398-20.979-4.19-31.897
|
||||
c-1.196-4.672-2.757-8.746-4.513-12.568c2.84-6.467,4.807-13.268,4.807-20.426c0-7.316-1.74-14.422-4.706-21.01
|
||||
C509.263,358.345,543.773,313.068,543.773,253.359z M451.232,150.998c-33.396-54.619-88.048-93.359-134.569-85.472
|
||||
c-49.022-7.864-102.775,30.64-135.326,85.018c-2.646,0.208-5.276,0.497-7.875,0.88c8.694-54.414,69.431-111.108,143.107-111.108
|
||||
c74.113,0,135.142,57.197,143.271,112.08C457.013,151.799,454.137,151.348,451.232,150.998z"/>
|
||||
<path fill="#010101" stroke="#FFFFFF" stroke-width="4.8437" d="M110.937,367.38c-72.03,93.07-97.843,163.349-81.865,170.996
|
||||
c15.97,7.654,74.912-46.055,139.701-143.287c45.751-68.647,60.797-94.43,45.68-95.922l20.614-43.357l-10.687-6.644l-33.91,33.371
|
||||
C179.323,272.615,166.073,296.146,110.937,367.38z"/>
|
||||
<path fill="#010101" stroke="#FFFFFF" stroke-width="4.8437" d="M140.932,379.755c-39.101,113.041-39.738,189.89-20.813,192.654
|
||||
c18.912,2.787,59.039-67.617,89.306-182.603c21.383-81.178,27.257-111.029,11.438-108l5.133-48.806l-13.207-3.354l-22.192,42.936
|
||||
C175.736,266.142,170.865,293.244,140.932,379.755z"/>
|
||||
<circle fill="none" stroke="#010101" stroke-width="4.8437" cx="410.28" cy="388.832" r="37.801"/>
|
||||
<path fill="#ED2224" stroke="#010101" stroke-width="4.8437" d="M475.237,157.792c-7.115-73.197-76.231-130.645-160.495-130.645
|
||||
c-83.402,0-152.009,56.27-160.306,128.393c-39.811,13.607-58.455,52.219-58.455,97.818c0,56.946,34.681,103.108,89.925,103.108
|
||||
c35.784,0,67.089-19.432,84.771-48.551c14.01,3.533,28.776,5.463,44.064,5.463c13.16,0,25.934-1.438,38.173-4.076
|
||||
c17.966,28.357,49.108,47.164,84.604,47.164c55.665,0,90.696-46.162,90.696-103.108
|
||||
C528.218,210.073,512.209,173.073,475.237,157.792z M314.742,274.908c-10.501,0-20.723-0.878-30.584-2.506
|
||||
c1.125-6.177,1.778-12.527,1.778-19.043c0-56.941-44.786-103.104-100.03-103.104c-4.858,0-9.597,0.478-14.271,1.169
|
||||
c8.692-54.414,69.43-111.108,143.105-111.108c74.113,0,135.144,57.197,143.27,112.08c-6.617-1.398-13.473-2.141-20.49-2.141
|
||||
c-55.675,0-100.801,46.163-100.801,103.104c0,6.852,0.687,13.536,1.931,20.013C330.872,274.364,322.888,274.908,314.742,274.908z"/>
|
||||
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="-1087.6663" y1="191.4385" x2="-992.1917" y2="191.4385" gradientTransform="matrix(-0.3782 -0.8348 1.083 -0.4907 -423.9551 -476.2263)">
|
||||
<stop offset="0" style="stop-color:#010101"/>
|
||||
<stop offset="0.2606" style="stop-color:#3E221C"/>
|
||||
<stop offset="0.7732" style="stop-color:#B03126"/>
|
||||
<stop offset="1" style="stop-color:#ED2224"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_1_)" d="M153.69,260.35c31.322-14.19,65.739-18.887,77.129,6.254c11.391,25.14-4.763,57.026-36.091,71.214
|
||||
c-31.323,14.192-65.948,5.311-77.338-19.83C106,292.849,122.366,274.543,153.69,260.35z"/>
|
||||
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="-1275.886" y1="215.5034" x2="-1180.4114" y2="215.5034" gradientTransform="matrix(-0.9008 -0.3607 0.555 -1.386 -752.6548 131.7681)">
|
||||
<stop offset="0" style="stop-color:#B11F24"/>
|
||||
<stop offset="0.1017" style="stop-color:#B62024"/>
|
||||
<stop offset="1" style="stop-color:#ED2224"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_2_)" d="M427.738,265.165c16.043-40.085,41.342-74.985,68.475-64.122
|
||||
c27.121,10.86,36.109,52.165,20.056,92.248c-16.053,40.089-51.062,63.773-78.189,52.912
|
||||
C410.95,335.343,411.683,305.253,427.738,265.165z"/>
|
||||
<path fill="#010101" stroke="#010101" stroke-width="4.8437" d="M448.219,425.226c7.774,30.396,3.98,62.357-14.521,62.357
|
||||
c-16.301,0-34.904-17.332-42.675-47.732c-7.777-30.399,4.243-75.016,14.521-62.364C423.584,399.707,440.442,394.826,448.219,425.226
|
||||
z"/>
|
||||
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="-639.5422" y1="548.502" x2="-691.4051" y2="458.673" gradientTransform="matrix(0.9868 0.0515 0.0515 0.7987 840.2104 72.6462)">
|
||||
<stop offset="0" style="stop-color:#5B3E1D"/>
|
||||
<stop offset="0.1121" style="stop-color:#42301B"/>
|
||||
<stop offset="0.2377" style="stop-color:#2E2316"/>
|
||||
<stop offset="0.3753" style="stop-color:#1D1710"/>
|
||||
<stop offset="0.5292" style="stop-color:#0E0C08"/>
|
||||
<stop offset="0.7122" style="stop-color:#030302"/>
|
||||
<stop offset="1" style="stop-color:#000000"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_3_)" stroke="#010101" stroke-width="4.8437" d="M184.076,437.859c-6.111,23.875,1.745,46.508,17.54,50.549
|
||||
c15.79,4.039,33.552-12.045,39.658-35.924c6.101-23.882-9.153-57.129-24.947-61.17C200.537,387.275,190.178,413.972,184.076,437.859
|
||||
z"/>
|
||||
<path fill="#010101" stroke="#010101" stroke-width="4.8437" d="M314.837,65.525c72.757-12.333,165.505,89.311,165.505,187.528
|
||||
c0,98.213-74.307,162.833-165.707,162.833"/>
|
||||
<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="-664.3811" y1="374.0068" x2="-500.546" y2="90.2362" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#000000"/>
|
||||
<stop offset="1" style="stop-color:#5B3E1D"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_4_)" stroke="#010101" stroke-width="4.8437" d="M314.635,415.888c-91.402,0-165.299-64.619-165.299-162.833
|
||||
c0-98.218,88.615-199.862,165.5-187.528"/>
|
||||
<linearGradient id="SVGID_5_" gradientUnits="userSpaceOnUse" x1="-760.302" y1="-37.9087" x2="-639.3506" y2="-247.4027" gradientTransform="matrix(-0.6092 0.7802 -0.4118 -0.3216 -240.6183 671.6459)">
|
||||
<stop offset="0" style="stop-color:#8B654B"/>
|
||||
<stop offset="1" style="stop-color:#000000"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_5_)" d="M169.611,266.578c-27.578-21.539-16.863-81.354,23.935-133.604
|
||||
c40.804-52.245,93.81-72.894,126.21-59.689c26.672,10.864,14.476,85.434-26.326,137.681
|
||||
C252.63,263.215,197.193,288.112,169.611,266.578z"/>
|
||||
<circle fill="#010101" cx="214.367" cy="388.832" r="34.682"/>
|
||||
<g>
|
||||
<path fill="#F4DFED" d="M131.831,427.708c-23.973,79.734-18.741,132.268-9.011,135.459c10.854,3.564,43.561-47.223,60.839-128.324
|
||||
c12.189-57.264,11.729-83.75,0.009-81.625l3.505-31.108l-8.899-2.435l-14.271,32.445
|
||||
C152.554,347.564,150.184,366.689,131.831,427.708z"/>
|
||||
|
||||
<linearGradient id="SVGID_6_" gradientUnits="userSpaceOnUse" x1="-710.6404" y1="319.3252" x2="-710.6405" y2="562.8164" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#571A54"/>
|
||||
<stop offset="0.2641" style="stop-color:#7C5378"/>
|
||||
<stop offset="0.528" style="stop-color:#A78AA3"/>
|
||||
<stop offset="0.7459" style="stop-color:#CDBCCB"/>
|
||||
<stop offset="0.9095" style="stop-color:#EAE1E8"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_6_)" d="M146.41,479.117l-22.914,19.186l35.325-65.182l4.683-17.371c0,0,3.1-26.758-24.228,14.713
|
||||
c16.962-56.432,32.317-62.998,32.317-62.998l11.402-46.658l-4.725-1.131l-14.702,30.23c-11.429-4.588-13.859,14.521-32.392,75.483
|
||||
c-24.226,79.656-20.501,124.087-8.358,137.777L146.41,479.117z"/>
|
||||
|
||||
<linearGradient id="SVGID_7_" gradientUnits="userSpaceOnUse" x1="-789.3508" y1="444.1797" x2="-821.2424" y2="531.975" gradientTransform="matrix(0.9399 -0.3414 0.3414 0.9399 754.2939 -277.891)">
|
||||
<stop offset="0" style="stop-color:#802986"/>
|
||||
<stop offset="0.2641" style="stop-color:#9D66A2"/>
|
||||
<stop offset="0.528" style="stop-color:#BE9BC2"/>
|
||||
<stop offset="0.7459" style="stop-color:#DBC8DE"/>
|
||||
<stop offset="0.9095" style="stop-color:#F0E6F1"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_7_)" d="M147.332,501.478l31.839-92.399c0,0,6.608,60.69-7.474,93.406
|
||||
c1.438-44.879-2.328-36.951-9.176-25.257C159.71,482.031,147.332,501.478,147.332,501.478z"/>
|
||||
|
||||
<linearGradient id="SVGID_8_" gradientUnits="userSpaceOnUse" x1="-764.8928" y1="411.2344" x2="-797.3259" y2="500.5203" gradientTransform="matrix(0.9399 -0.3414 0.3414 0.9399 754.2939 -277.891)">
|
||||
<stop offset="0" style="stop-color:#802986"/>
|
||||
<stop offset="0.2641" style="stop-color:#9D66A2"/>
|
||||
<stop offset="0.528" style="stop-color:#BE9BC2"/>
|
||||
<stop offset="0.7459" style="stop-color:#DBC8DE"/>
|
||||
<stop offset="0.9095" style="stop-color:#F0E6F1"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_8_)" d="M156.286,463.716l38.825-93.953c0,0,2.251,62.279-11.831,94.992
|
||||
c-0.298-44.25-5.388-28.09-8.538-23.508C165.662,454.416,156.286,463.716,156.286,463.716z"/>
|
||||
|
||||
<linearGradient id="SVGID_9_" gradientUnits="userSpaceOnUse" x1="-872.7551" y1="422.8174" x2="-924.3751" y2="475.0038" gradientTransform="matrix(0.711 -0.7032 0.7032 0.711 517.3177 -556.6326)">
|
||||
<stop offset="0" style="stop-color:#571A54"/>
|
||||
<stop offset="0.2641" style="stop-color:#7C5378"/>
|
||||
<stop offset="0.528" style="stop-color:#A78AA3"/>
|
||||
<stop offset="0.7459" style="stop-color:#CDBCCB"/>
|
||||
<stop offset="0.9095" style="stop-color:#EAE1E8"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_9_)" d="M180.916,431.115l9.787-73.404c0,0,18.589,43.111,16.428,71.426
|
||||
c-11.771-30.424-13.671-21.049-17.576-14.961C187.396,417.539,180.916,431.115,180.916,431.115z"/>
|
||||
<path fill="#1E3D73" d="M174.914,335.556L158.76,362.31l-23.24,76.646c0,0,1.211-8.172,1.788-15.883l-18.783,50.772
|
||||
c0,0,8.386-31.227,3.607-28.383c-4.775,2.84,4.227-21.91-23.102,13.73c5.316-18.517,20.495-39.511,33.324-54.9
|
||||
c-2.172,0.473-7.102,4.787-18.388,18.373c4.381-15.232,14.956-32.934,25.357-47.898c-1.159-2.682-5.151-3.889-21.234,5.224
|
||||
C134.366,356.718,174.914,335.556,174.914,335.556z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#F4DFED" d="M94.453,401.164c-49.752,66.752-62.779,117.912-54.719,124.242c8.987,7.059,57.062-29.513,100.989-99.847
|
||||
c31.011-49.655,39.62-74.709,27.879-76.713l13.916-28.053l-7.539-5.318l-24.483,25.623
|
||||
C141.291,332.912,132.531,350.072,94.453,401.164z"/>
|
||||
<path fill="#656B84" d="M90.603,454.464l-28.088,10.205l55.456-49.201l10.331-14.729c0,0,12.047-24.097-27.796,5.559
|
||||
c35.213-47.256,51.892-48.182,51.892-48.182l26.641-39.957l-4.058-2.683l-24.133,23.4c-9.179-8.223-17.989,8.91-56.226,59.885
|
||||
c-49.96,66.601-61.634,109.635-54.889,126.646L90.603,454.464z"/>
|
||||
|
||||
<linearGradient id="SVGID_10_" gradientUnits="userSpaceOnUse" x1="-752.551" y1="484.6816" x2="-736.7991" y2="395.3488" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#571A54"/>
|
||||
<stop offset="0.2641" style="stop-color:#7C5378"/>
|
||||
<stop offset="0.528" style="stop-color:#A78AA3"/>
|
||||
<stop offset="0.7459" style="stop-color:#CDBCCB"/>
|
||||
<stop offset="0.9095" style="stop-color:#EAE1E8"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_10_)" d="M83.829,475.791l61.476-75.98c0,0-14.509,59.306-38.916,85.248
|
||||
c16.678-41.694,12.058-33.366,0-26.873C101.491,460.822,83.829,475.791,83.829,475.791z"/>
|
||||
|
||||
<linearGradient id="SVGID_11_" gradientUnits="userSpaceOnUse" x1="-727.8064" y1="453.3486" x2="-711.9149" y2="363.2233" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#571A54"/>
|
||||
<stop offset="0.2641" style="stop-color:#7C5378"/>
|
||||
<stop offset="0.528" style="stop-color:#A78AA3"/>
|
||||
<stop offset="0.7459" style="stop-color:#CDBCCB"/>
|
||||
<stop offset="0.9095" style="stop-color:#EAE1E8"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_11_)" d="M105.143,443.357l68.562-75.052c0,0-19.143,59.297-43.551,85.248
|
||||
c14.824-41.7,10.567-27.994,0-25.022C124.802,430.041,105.143,443.357,105.143,443.357z"/>
|
||||
<path fill="#656B84" d="M139.423,421.125l34.262-65.654c0,0,2.748,46.867-8.945,72.74c-0.676-32.615-3.041-28.432-11.413-20.061
|
||||
C150.5,410.974,139.423,421.125,139.423,421.125z"/>
|
||||
<path fill="#656B84" d="M166.408,329.255l-24.322,19.631l-48.011,64.111c0,0,3.931-7.273,7.104-14.322L66.185,439.99
|
||||
c0,0,18.552-26.484,13.089-25.449c-5.464,1.041,11.451-19.148-26.399,5.02c11.313-15.588,32.751-30.137,50.064-40.227
|
||||
c-2.205-0.299-8.316,2.076-23.552,10.988c9.312-12.818,25.302-25.842,40.183-36.357c-0.175-2.918-3.515-5.416-21.74-2.346
|
||||
C121.065,335.3,166.408,329.255,166.408,329.255z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#D9AF82" d="M315.05,115.063c-50.514,0-83.218,15.021-109.641,64.839c-2.502,4.713-0.23,14.337-2.796,19.152
|
||||
c-13.845,26.007-37.089,48.236-37.089,71.707c0,34.335,19.1,65.637,42.505,89.296c12.185,71.646,34.7,151.595,104.339,151.595"/>
|
||||
<path fill="#010101" d="M203.271,178.766c-1.521,2.855-1.59,6.774-1.656,10.562c-0.062,3.283-0.123,6.677-1.14,8.588
|
||||
c-4.537,8.519-10.146,16.707-15.577,24.624c-11.21,16.353-21.797,31.798-21.797,48.221c0,30.307,15.166,62.38,42.666,90.412
|
||||
c12.578,73.607,36.113,150.479,106.6,150.479v-1.547c-67.084,0-89.722-78.556-101.95-150.453l-0.127-0.748l-0.54-0.549
|
||||
c-26.957-27.257-41.805-58.361-41.805-87.594c0-14.923,10.174-29.766,20.949-45.482c5.501-8.027,11.19-16.327,15.855-25.087
|
||||
c1.562-2.935,1.638-6.92,1.707-10.773c0.059-3.221,0.118-6.551,1.088-8.381c24.258-45.734,54.398-65.974,107.503-65.974v-2.422
|
||||
C259.849,112.641,228.506,131.181,203.271,178.766z"/>
|
||||
</g>
|
||||
<path fill="#8B654B" d="M312.368,511.65c72.045,0,92.163-79.949,104.338-151.595c23.405-23.657,42.514-54.959,42.514-89.296
|
||||
c0-37.004-22.588-49.51-38.609-77.154c-5.681-9.798-1.496-24.634-8.084-33.382c-26.905-35.728-53.772-45.162-97.477-45.162"/>
|
||||
<ellipse fill="#D9AF82" cx="313.792" cy="343.947" rx="21.906" ry="68.144"/>
|
||||
<path fill="#8B654B" d="M342.916,373.455c0,7.812-14.979,12.535-27.273,12.535c-12.293,0-27.81-4.736-27.81-12.549
|
||||
c3.432-3.433,15.246,4.885,27.544,4.885C334.789,378.326,342.916,312.496,342.916,373.455z"/>
|
||||
<path fill="#D9AF82" d="M335.697,435.216c0,37.637-9.81,68.832-21.91,68.832c-12.096,0-21.899-31.195-21.899-68.832
|
||||
c0-37.639,9.882-50.258,21.977-50.258C325.962,384.958,335.697,397.578,335.697,435.216z"/>
|
||||
<path opacity="0.36" fill="#8A644B" enable-background="new " d="M328.365,281.605c-1.826,24.682-14.186-7.573-34.757,20.975
|
||||
c-8.672,12.025-23.23,10.877-38.845,10.877c-39.61,0-66.544-26.031-67.859-38.869c-2.517-24.557,29.024-39.586,71.464-39.586
|
||||
C297.028,235.002,329.255,269.622,328.365,281.605z"/>
|
||||
<linearGradient id="SVGID_12_" gradientUnits="userSpaceOnUse" x1="-644.0354" y1="340.7031" x2="-568.3508" y2="340.7031" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#D9AF82"/>
|
||||
<stop offset="0.0786" style="stop-color:#DFB791"/>
|
||||
<stop offset="0.2053" style="stop-color:#E7C1A5"/>
|
||||
<stop offset="0.345" style="stop-color:#EDC9B5"/>
|
||||
<stop offset="0.5023" style="stop-color:#F1CFC0"/>
|
||||
<stop offset="0.6917" style="stop-color:#F4D3C7"/>
|
||||
<stop offset="1" style="stop-color:#F5D4C9"/>
|
||||
</linearGradient>
|
||||
<path opacity="0.36" fill="url(#SVGID_12_)" enable-background="new " d="M272.246,361.529
|
||||
c-28.722,19.461-56.346-24.299-57.491-43.314c15.913,13.822,62.032,18.457,75.685-2.516L272.246,361.529z"/>
|
||||
<path opacity="0.36" fill="#8A644B" enable-background="new " d="M313.706,461.212c-38.167,0-61.229-13.68-61.229-31.629
|
||||
c0-6.049,15.649-24.078,37.318-49.365c5.952-3.699,7.464,10.037,14.958,4.73C331.61,392.044,328.318,461.212,313.706,461.212z"/>
|
||||
<g>
|
||||
<path fill="#8A644B" d="M260.464,472.117c8.341,23.938,32.817,36.465,52.688,36.465v-4.844
|
||||
C294.99,503.738,268.056,493.921,260.464,472.117L260.464,472.117z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#8A644B" d="M180.954,271.658c0,21.359,5.388,36.679,27.101,48.222c0.587,1.121,7.021,13.387,7.021,13.387
|
||||
c8.916,16.375,19.021,34.939,19.021,54.406h4.844c0-20.699-10.416-39.84-19.612-56.725l-7.586-14.455l-0.709-0.426
|
||||
C190.51,305.4,180.954,291.289,180.954,271.658L180.954,271.658z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path fill="#010101" d="M208.814,230.649l-0.104-0.97c-3.106-15.25-3.226-33.651-0.312-49.217l-4.764-0.889
|
||||
C200.613,195.722,205.583,214.815,208.814,230.649z"/>
|
||||
</g>
|
||||
<linearGradient id="SVGID_13_" gradientUnits="userSpaceOnUse" x1="-667.7327" y1="310.1709" x2="-407.218" y2="310.1709" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#5B3E1D"/>
|
||||
<stop offset="1" style="stop-color:#010101"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_13_)" d="M423.943,199.054c-3.983-11.059-0.737-20.853-8.062-31.231
|
||||
c-19.885-28.185-51.07-56.271-108.998-52.618l5.214,140.363c0,0-122.733-25.589-121.021,15.935c0.229,5.387,40.188,2.88,63.46,4.428
|
||||
c-26.092,4.566-32.185,5.898-32.185,8.838c0,6.206,21.861,0.683,25.106,2.467c4.978,2.739-43.139,7.052-34.351,8.757
|
||||
c10.057,1.951,44.474,3.086,57.442,3.086c28.931,0,41.077-25.413,41.077-4.485c7.348,27.894,14.739,59.239,13.974,69.882
|
||||
c-1.477,20.661-19.62,20.188-19.62,20.188l5.089,24.285c-8.557,0.438-6.245-1.324-13.85-0.549c-14.429,0-32.354,13.03-32.354,16.055
|
||||
l39.989,0.434c0,0-29.081,13.771-22.977,22.931c4.765,7.143,20.316,13.377,31.093,13.424c0,0,3.271,8.549,3.271,22.352
|
||||
c0,13.812-4.035,22.564-4.035,22.564c46.171,0,67.49-49.035,80.324-118.445c6.083-32.877,20.018-58.104,36.034-71.658
|
||||
c15.742-13.319,23.008-26.64,23.008-52.07C451.577,249.847,443.574,230.354,423.943,199.054z"/>
|
||||
<path fill="#D9AF82" d="M325.395,252.416l-13.297,4.328c0,0-65.85-96.356-46.493-121.312c12.682-16.357,24.609-18.136,40.046-19.238
|
||||
c13.519-0.965,21.294,16.525,27.302,24.271C350.375,162.927,325.395,252.416,325.395,252.416z"/>
|
||||
<linearGradient id="SVGID_14_" gradientUnits="userSpaceOnUse" x1="-629.0159" y1="50.6562" x2="-540.175" y2="50.6562" gradientTransform="matrix(0.676 0.6564 -0.9247 0.9523 711.8302 511.1852)">
|
||||
<stop offset="0" style="stop-color:#FFFFFF"/>
|
||||
<stop offset="0.0769" style="stop-color:#F4E9DD"/>
|
||||
<stop offset="0.1814" style="stop-color:#EBD6BF"/>
|
||||
<stop offset="0.2951" style="stop-color:#E5C7A8"/>
|
||||
<stop offset="0.419" style="stop-color:#DFBC96"/>
|
||||
<stop offset="0.5585" style="stop-color:#DCB58B"/>
|
||||
<stop offset="0.7265" style="stop-color:#DAB084"/>
|
||||
<stop offset="1" style="stop-color:#D9AF82"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_14_)" d="M305.253,199.27c-26.745,27.542-70.168,41.961-81.281,24.357
|
||||
c-14.515-22.972-12.896-47.545,13.854-75.082c26.74-27.547,64.922-33.847,85.28-14.081
|
||||
C343.464,154.233,332.003,171.726,305.253,199.27z"/>
|
||||
<linearGradient id="SVGID_15_" gradientUnits="userSpaceOnUse" x1="-617.7107" y1="401.4551" x2="-617.7107" y2="317.8633" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#D9AF82"/>
|
||||
<stop offset="0.1127" style="stop-color:#BD936E"/>
|
||||
<stop offset="0.2679" style="stop-color:#A57C5E"/>
|
||||
<stop offset="0.4437" style="stop-color:#966E53"/>
|
||||
<stop offset="0.6554" style="stop-color:#8D664D"/>
|
||||
<stop offset="1" style="stop-color:#8A644B"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_15_)" d="M272.246,361.529c0,46.272-35.419,42.799-45.104,36.896c0-45.752-17.229-80.211-17.229-80.211
|
||||
S249.882,354.22,272.246,361.529z"/>
|
||||
<linearGradient id="SVGID_16_" gradientUnits="userSpaceOnUse" x1="-925.8547" y1="344.666" x2="-972.7458" y2="361.7328" gradientTransform="matrix(-1 0 0 1 -562.3931 0.3506)">
|
||||
<stop offset="0" style="stop-color:#382815"/>
|
||||
<stop offset="0.4081" style="stop-color:#553E2B"/>
|
||||
<stop offset="1" style="stop-color:#8B654B"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_16_)" d="M359.338,356.349c0,46.271,21.506,44.033,31.073,44.033c7.488-45.135,35.671-81.516,35.671-81.516
|
||||
S381.703,349.044,359.338,356.349z"/>
|
||||
<path fill="none" stroke="#010101" stroke-width="4.8437" d="M173.934,294.978"/>
|
||||
<g>
|
||||
<path fill="#010101" d="M311.507,115.089c53.106,0,83.247,20.214,107.505,65.948c0.902,1.702,0.902,4.883,0.902,7.96
|
||||
c-0.005,4.146-0.005,8.432,2.029,11.419c16.157,23.757,31.934,48.809,31.934,70.969c0,32.38-12.817,62.458-37.073,86.969
|
||||
l-0.541,0.551l-0.13,0.748c-12.222,71.897-36.672,150.451-103.765,150.451v1.518c70.499,0,95.847-76.844,108.416-150.455
|
||||
c24.803-25.336,37.937-56.355,37.937-89.781c0-23.537-16.19-49.311-32.774-73.694c-1.151-1.698-1.19-5.061-1.19-8.37
|
||||
c0-0.109,0.004-0.537,0.004-0.646c0-3.567-0.041-7.221-1.471-9.91C398.053,131.18,366.71,112.64,311.51,112.64v2.449H311.507
|
||||
L311.507,115.089z"/>
|
||||
</g>
|
||||
<polygon fill="#010101" points="339.974,84.79 334.59,115.675 300.608,113.719 312.435,66.413 "/>
|
||||
<circle fill="#010101" stroke="#010101" stroke-width="4.8437" cx="452.06" cy="492.948" r="19.204"/>
|
||||
<g>
|
||||
|
||||
<linearGradient id="SVGID_17_" gradientUnits="userSpaceOnUse" x1="-749.6116" y1="335.9512" x2="-687.9983" y2="335.9512" gradientTransform="matrix(1 0 0 1 858.79 0.3506)">
|
||||
<stop offset="0" style="stop-color:#571A54"/>
|
||||
<stop offset="0.2641" style="stop-color:#7C5378"/>
|
||||
<stop offset="0.528" style="stop-color:#A78AA3"/>
|
||||
<stop offset="0.7459" style="stop-color:#CDBCCB"/>
|
||||
<stop offset="0.9095" style="stop-color:#EAE1E8"/>
|
||||
<stop offset="1" style="stop-color:#F9F3F8"/>
|
||||
</linearGradient>
|
||||
<path fill="url(#SVGID_17_)" d="M109.178,338.035c9.592-7.824,34.694,4.861,34.833,4.861l26.78-8.396
|
||||
C170.211,334.501,120.246,321.648,109.178,338.035z"/>
|
||||
</g>
|
||||
<linearGradient id="SVGID_18_" gradientUnits="userSpaceOnUse" x1="-1081.0227" y1="320.6133" x2="-1063.3801" y2="320.6133" gradientTransform="matrix(-0.0113 -0.7169 1.2476 -0.0198 -98.6661 -397.1379)">
|
||||
<stop offset="0" style="stop-color:#D9AF82"/>
|
||||
<stop offset="0.0786" style="stop-color:#DFB791"/>
|
||||
<stop offset="0.2053" style="stop-color:#E7C1A5"/>
|
||||
<stop offset="0.345" style="stop-color:#EDC9B5"/>
|
||||
<stop offset="0.5023" style="stop-color:#F1CFC0"/>
|
||||
<stop offset="0.6917" style="stop-color:#F4D3C7"/>
|
||||
<stop offset="1" style="stop-color:#F5D4C9"/>
|
||||
</linearGradient>
|
||||
<path opacity="0.36" fill="url(#SVGID_18_)" enable-background="new " d="M313.352,358.851c6.074-0.1,11.045,2.654,11.102,6.15
|
||||
c0.06,3.49-4.829,6.398-10.907,6.498c-6.076,0.1-11.045-2.658-11.105-6.154C302.388,361.853,307.269,358.947,313.352,358.851z"/>
|
||||
<path fill="#483218" d="M397.109,309.378c15.699-3.76,26.445-18.402,20.099-27.063c-38.738,19.354-75.295,11.369-85.529,9.147
|
||||
C368.014,309.492,371.117,315.595,397.109,309.378z"/>
|
||||
<path fill="#B4B4B4" d="M310.92,73.714c-38.372,0-93.116,22.758-117.549,74.944c-6.089,12.999-6.656,32.87,0.64,45.014
|
||||
c0,0,18.604-81.43,108.229-86.494"/>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="Layer_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
width="606.2478"
|
||||
height="595.49866"
|
||||
viewBox="0 0 606.24779 595.49863"
|
||||
enable-background="new 0 0 841.89 595.28"
|
||||
xml:space="preserve"
|
||||
inkscape:version="0.48.2 r9819"
|
||||
sodipodi:docname="tomahawk-icon.svg"><metadata
|
||||
id="metadata15"><rdf:RDF><cc:Work
|
||||
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
|
||||
id="defs13" /><sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1440"
|
||||
inkscape:window-height="794"
|
||||
id="namedview11"
|
||||
showgrid="false"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="431.12548"
|
||||
inkscape:cy="336.94553"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="Layer_1"
|
||||
inkscape:snap-page="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"><sodipodi:guide
|
||||
position="-3.5728101e-05,-1.501866e-05"
|
||||
orientation="0,841.89001"
|
||||
id="guide2994" /><sodipodi:guide
|
||||
position="841.88997,-1.501866e-05"
|
||||
orientation="-595.28003,0"
|
||||
id="guide2996" /><sodipodi:guide
|
||||
position="841.88997,595.28001"
|
||||
orientation="0,-841.89001"
|
||||
id="guide2998" /><sodipodi:guide
|
||||
position="-3.5728101e-05,595.28001"
|
||||
orientation="595.28003,0"
|
||||
id="guide3000" /></sodipodi:namedview>
|
||||
<g
|
||||
id="g3"
|
||||
transform="matrix(7.3080643,0,0,7.1790074,-2773.1692,-1839.0104)">
|
||||
<g
|
||||
id="g5">
|
||||
<path
|
||||
d="m 420.947,265.168 c -17.911,0 -32.477,14.565 -32.477,32.472 0,17.906 14.565,32.476 32.477,32.476 2.568,0 5.06,-0.318 7.459,-0.888 v -28.011 l -22.338,15.806 c -0.198,0.135 -0.444,0.213 -0.681,0.213 -0.184,0 -0.372,-0.039 -0.541,-0.136 -0.396,-0.202 -0.642,-0.608 -0.642,-1.043 v -37.053 c 0,-0.435 0.246,-0.845 0.642,-1.053 0.396,-0.193 0.864,-0.159 1.222,0.092 l 22.338,15.807 v -16.028 h 0.951 8.945 v 47.234 c 9.076,-5.764 15.121,-15.888 15.121,-27.417 10e-4,-17.905 -14.569,-32.471 -32.476,-32.471 z"
|
||||
id="path7"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none" />
|
||||
<path
|
||||
d="m 420.947,256.165 c -22.874,0 -41.48,18.606 -41.48,41.475 0,22.87 18.606,41.475 41.48,41.475 22.869,0 41.476,-18.605 41.476,-41.475 0,-22.869 -18.607,-41.475 -41.476,-41.475 z m 17.356,68.892 v -47.234 h -8.945 -0.951 v 16.028 l -22.338,-15.807 c -0.357,-0.251 -0.826,-0.285 -1.222,-0.092 -0.396,0.208 -0.642,0.618 -0.642,1.053 v 37.053 c 0,0.435 0.246,0.841 0.642,1.043 0.169,0.097 0.357,0.136 0.541,0.136 0.236,0 0.482,-0.078 0.681,-0.213 l 22.338,-15.806 v 28.011 c -2.399,0.569 -4.891,0.888 -7.459,0.888 -17.911,0 -32.477,-14.57 -32.477,-32.476 0,-17.906 14.565,-32.472 32.477,-32.472 17.906,0 32.477,14.565 32.477,32.472 -0.001,11.528 -6.046,21.652 -15.122,27.416 z"
|
||||
id="path9"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#e63e30" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
data/images/scrollbar-horizontal-handle.png
Normal file
After Width: | Height: | Size: 397 B |
BIN
data/images/scrollbar-vertical-handle.png
Normal file
After Width: | Height: | Size: 376 B |
BIN
data/images/track-icon-sidebar.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 68 KiB |
@ -43,8 +43,8 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a href="http://www.playdar.org/" title="Tomahawk - Powered by Playdar" id="head">
|
||||
<img alt="Tomahawk - Powered by Playdar" src="/staticdata/tomahawk_auth_logo.png" width="196" height="45"/>
|
||||
<a href="http://www.tomahawk-player.org" title="Tomahawk - Powered by Playdar" id="head">
|
||||
<img alt="Tomahawk - Powered by Playdar" src="/staticdata/tomahawk_auth_logo.png" width="200" height="30">
|
||||
</a>
|
||||
|
||||
<div id="content">
|
||||
|
@ -32,8 +32,8 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a href="http://www.gettomahawk.com/" title="Tomahawk - Powered by Playdar" id="head">
|
||||
<img alt="Tomahawk - Powered by Playdar" src="/staticdata/tomahawk_auth_logo.png" width="196" height="45"/>
|
||||
<a href="http://www.tomahawk-player.org" title="Tomahawk - Powered by Playdar" id="head">
|
||||
<img alt="Tomahawk - Powered by Playdar" src="/staticdata/tomahawk_auth_logo.png" width="200" height="30">
|
||||
</a>
|
||||
|
||||
<div id="content">
|
||||
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 27 KiB |
1913
lang/tomahawk_ar.ts
1041
lang/tomahawk_bg.ts
1045
lang/tomahawk_de.ts
1187
lang/tomahawk_fr.ts
@ -10,5 +10,6 @@
|
||||
<file>tomahawk_es.qm</file>
|
||||
<file>tomahawk_sv.qm</file>
|
||||
<file>tomahawk_ja.qm</file>
|
||||
<file>tomahawk_ar.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
1492
lang/tomahawk_ja.ts
@ -1,25 +1,48 @@
|
||||
FILE (GLOB TS_FILES ${CMAKE_SOURCE_DIR}/lang/*.ts)
|
||||
QT4_ADD_TRANSLATION(QM_FILES ${TS_FILES})
|
||||
macro(add_tomahawk_translations language)
|
||||
list(APPEND TOMAHAWK_LANGUAGES ${ARGV})
|
||||
|
||||
## HACK HACK HACK - around rcc limitations to allow out of source-tree building
|
||||
SET( trans_file tomahawk_i18n )
|
||||
SET( trans_srcfile ${CMAKE_SOURCE_DIR}/lang/${trans_file}.qrc)
|
||||
SET( trans_infile ${CMAKE_CURRENT_BINARY_DIR}/${trans_file}.qrc)
|
||||
SET( trans_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${trans_file}.cxx)
|
||||
set(tomahawk_i18n_qrc_content "<!DOCTYPE RCC><RCC version=\"1.0\">\n")
|
||||
|
||||
# Copy the QRC file to the output directory
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${trans_infile}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${trans_srcfile} ${trans_infile}
|
||||
MAIN_DEPENDENCY ${trans_srcfile}
|
||||
)
|
||||
# tomahawk and qt language files
|
||||
set(tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}<qresource prefix=\"/lang\">\n")
|
||||
foreach(lang ${TOMAHAWK_LANGUAGES})
|
||||
set(tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}<file>tomahawk_${lang}.qm</file>\n")
|
||||
if(NOT lang STREQUAL "en" AND EXISTS ${QT_TRANSLATIONS_DIR}/qt_${lang}.qm)
|
||||
file(COPY ${QT_TRANSLATIONS_DIR}/qt_${lang}.qm DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set(tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}<file>qt_${lang}.qm</file>\n")
|
||||
endif()
|
||||
|
||||
# Run the resource compiler (rcc_options should already be set)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${trans_outfile}
|
||||
COMMAND ${QT_RCC_EXECUTABLE}
|
||||
ARGS ${rcc_options} -name ${trans_file} -o ${trans_outfile} ${trans_infile}
|
||||
MAIN_DEPENDENCY ${trans_infile}
|
||||
DEPENDS ${QM_FILES}
|
||||
)
|
||||
# build explicitly enabled languages
|
||||
list(APPEND TS_FILES "${CMAKE_SOURCE_DIR}/lang/tomahawk_${lang}.ts")
|
||||
endforeach()
|
||||
|
||||
set(tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}</qresource>\n")
|
||||
set(tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}</RCC>\n")
|
||||
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc "${tomahawk_i18n_qrc_content}" )
|
||||
|
||||
QT4_ADD_TRANSLATION(QM_FILES ${TS_FILES})
|
||||
|
||||
## HACK HACK HACK - around rcc limitations to allow out of source-tree building
|
||||
SET( trans_file tomahawk_i18n )
|
||||
SET( trans_srcfile ${CMAKE_BINARY_DIR}/lang/${trans_file}.qrc)
|
||||
SET( trans_infile ${CMAKE_CURRENT_BINARY_DIR}/${trans_file}.qrc)
|
||||
SET( trans_outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${trans_file}.cxx)
|
||||
|
||||
# Copy the QRC file to the output directory
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${trans_infile}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${trans_srcfile} ${trans_infile}
|
||||
MAIN_DEPENDENCY ${trans_srcfile}
|
||||
)
|
||||
|
||||
# Run the resource compiler (rcc_options should already be set)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${trans_outfile}
|
||||
COMMAND ${QT_RCC_EXECUTABLE}
|
||||
ARGS ${rcc_options} -name ${trans_file} -o ${trans_outfile} ${trans_infile}
|
||||
MAIN_DEPENDENCY ${trans_infile}
|
||||
DEPENDS ${QM_FILES}
|
||||
)
|
||||
endmacro()
|
||||
|
||||
|
@ -141,6 +141,10 @@
|
||||
<file>data/images/process-stop.png</file>
|
||||
<file>data/icons/tomahawk-icon-128x128-grayscale.png</file>
|
||||
<file>data/images/collection.png</file>
|
||||
<file>data/misc/tomahawk_pubkey.pem</file>
|
||||
<file>data/misc/tomahawk_pubkey.pem</file>
|
||||
<file>data/images/track-icon-sidebar.png</file>
|
||||
<file>data/images/jump-link.png</file>
|
||||
<file>data/images/scrollbar-vertical-handle.png</file>
|
||||
<file>data/images/scrollbar-horizontal-handle.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -28,13 +28,14 @@
|
||||
#include "playlist/PlaylistView.h"
|
||||
#include "database/Database.h"
|
||||
#include "widgets/ImageButton.h"
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "Album.h"
|
||||
#include "DropJob.h"
|
||||
#include "SocialWidget.h"
|
||||
#include "GlobalActionManager.h"
|
||||
#include "ViewManager.h"
|
||||
#include "Source.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
@ -60,6 +61,7 @@ AudioControls::AudioControls( QWidget* parent )
|
||||
ui->artistTrackLabel->setFont( font );
|
||||
ui->artistTrackLabel->setElideMode( Qt::ElideMiddle );
|
||||
ui->artistTrackLabel->setType( QueryLabel::ArtistAndTrack );
|
||||
ui->artistTrackLabel->setJumpLinkVisible( true );
|
||||
|
||||
ui->albumLabel->setFont( font );
|
||||
ui->albumLabel->setType( QueryLabel::Album );
|
||||
@ -87,6 +89,9 @@ AudioControls::AudioControls( QWidget* parent )
|
||||
ui->socialButton->setPixmap( RESPATH "images/share.png" );
|
||||
ui->loveButton->setPixmap( RESPATH "images/not-loved.png" );
|
||||
ui->loveButton->setCheckable( true );
|
||||
|
||||
ui->socialButton->setFixedSize( QSize( 20, 20 ) );
|
||||
ui->loveButton->setFixedSize( QSize( 20, 20 ) );
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
ui->ownerLabel->setForegroundRole( QPalette::Text );
|
||||
@ -545,7 +550,6 @@ void
|
||||
AudioControls::onTrackClicked()
|
||||
{
|
||||
ViewManager::instance()->show( m_currentTrack->toQuery() );
|
||||
// ViewManager::instance()->showCurrentTrack();
|
||||
}
|
||||
|
||||
|
||||
@ -596,10 +600,13 @@ AudioControls::droppedTracks( QList< query_ptr > tracks )
|
||||
void
|
||||
AudioControls::onSocialButtonClicked()
|
||||
{
|
||||
SocialWidget* sw = new SocialWidget( m_parent );
|
||||
sw->setPosition( QCursor::pos() );
|
||||
sw->setQuery( m_currentTrack->toQuery() );
|
||||
sw->show();
|
||||
if ( !m_socialWidget.isNull() )
|
||||
return;
|
||||
|
||||
m_socialWidget = new SocialWidget( m_parent );
|
||||
m_socialWidget.data()->setPosition( m_socialWidget.data()->mapFromGlobal( QCursor::pos() ) );
|
||||
m_socialWidget.data()->setQuery( m_currentTrack->toQuery() );
|
||||
m_socialWidget.data()->show();
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
class QDropEvent;
|
||||
class QDragEnterEvent;
|
||||
class QDragMoveEvent;
|
||||
class SocialWidget;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -91,6 +92,8 @@ private:
|
||||
void setSocialActions();
|
||||
|
||||
Ui::AudioControls* ui;
|
||||
|
||||
QWeakPointer<SocialWidget> m_socialWidget;
|
||||
|
||||
Tomahawk::result_ptr m_currentTrack;
|
||||
Tomahawk::PlaylistModes::RepeatMode m_repeatMode;
|
||||
|
@ -207,9 +207,6 @@
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Artist</string>
|
||||
</property>
|
||||
@ -229,9 +226,6 @@
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Album</string>
|
||||
</property>
|
||||
|
@ -68,27 +68,13 @@ SET( tomahawkSourcesGui ${tomahawkSourcesGui}
|
||||
sourcetree/items/GroupItem.cpp
|
||||
sourcetree/items/HistoryItem.cpp
|
||||
|
||||
utils/GuiHelpers.cpp
|
||||
|
||||
accounts/lastfm/LastFmAccount.cpp
|
||||
accounts/lastfm/LastFmConfig.cpp
|
||||
accounts/lastfm/LastFmInfoPlugin.cpp
|
||||
|
||||
accounts/spotify/SpotifyAccount.cpp
|
||||
accounts/spotify/SpotifyAccountConfig.cpp
|
||||
accounts/spotify/SpotifyPlaylistUpdater.cpp
|
||||
|
||||
TomahawkTrayIcon.cpp
|
||||
AudioControls.cpp
|
||||
SettingsDialog.cpp
|
||||
DiagnosticsDialog.cpp
|
||||
AccountDelegate.cpp
|
||||
SettingsListDelegate.cpp
|
||||
DelegateConfigWrapper.cpp
|
||||
TomahawkWindow.cpp
|
||||
LoadXSPFDialog.cpp
|
||||
AccountFactoryWrapper.cpp
|
||||
AccountFactoryWrapperDelegate.cpp
|
||||
SocialWidget.cpp
|
||||
)
|
||||
|
||||
@ -102,19 +88,14 @@ SET( tomahawkUI ${tomahawkUI}
|
||||
StackedSettingsDialog.ui
|
||||
ProxyDialog.ui
|
||||
|
||||
accounts/lastfm/LastFmConfig.ui
|
||||
accounts/spotify/SpotifyAccountConfig.ui
|
||||
|
||||
AudioControls.ui
|
||||
LoadXSPFDialog.ui
|
||||
AccountFactoryWrapper.ui
|
||||
SocialWidget.ui
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}/thirdparty/liblastfm2/src
|
||||
|
||||
audio
|
||||
database
|
||||
@ -122,7 +103,6 @@ INCLUDE_DIRECTORIES(
|
||||
network
|
||||
sourcetree
|
||||
topbar
|
||||
utils
|
||||
libtomahawk
|
||||
mac
|
||||
|
||||
@ -137,6 +117,8 @@ INCLUDE_DIRECTORIES(
|
||||
${LIBATTICA_INCLUDE_DIR}
|
||||
${LIBECHONEST_INCLUDE_DIR}
|
||||
${LIBECHONEST_INCLUDE_DIR}/..
|
||||
${LIBLASTFM_INCLUDE_DIRS}
|
||||
${LIBLASTFM_INCLUDE_DIRS}/..
|
||||
)
|
||||
|
||||
SET( OS_SPECIFIC_LINK_LIBRARIES "" )
|
||||
@ -154,11 +136,6 @@ IF( APPLE )
|
||||
SET( tomahawkSources ${tomahawkSources} mac/TomahawkApp_Mac.mm mac/MacShortcutHandler.cpp )
|
||||
ENDIF( APPLE )
|
||||
|
||||
IF(GLOOX_FOUND)
|
||||
INCLUDE_DIRECTORIES( ${GLOOX_INCLUDE_DIR} )
|
||||
SET( tomahawkSources ${tomahawkSources} xmppbot/XmppBot.cpp )
|
||||
ENDIF(GLOOX_FOUND)
|
||||
|
||||
ADD_SUBDIRECTORY( accounts )
|
||||
ADD_SUBDIRECTORY( infoplugins )
|
||||
|
||||
@ -170,7 +147,9 @@ INCLUDE(GNUInstallDirs)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
# translations
|
||||
include( ${CMAKE_SOURCE_DIR}/lang/translations.cmake )
|
||||
add_tomahawk_translations(ar bg ca de en es fr ja pl pt_BR ru sv tr zh_CN zh_TW)
|
||||
|
||||
SET( final_src ${final_src} ${tomahawkMoc} ${tomahawkSources} ${trans_outfile})
|
||||
|
||||
@ -205,16 +184,13 @@ MESSAGE( STATUS "OS_SPECIFIC_LINK_LIBRARIES: ${OS_SPECIFIC_LINK_LIBRARIES}" )
|
||||
|
||||
SET(LINK_LIBRARIES "")
|
||||
IF(LIBLASTFM_FOUND)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} tomahawk_lastfm2 )
|
||||
SET( LINK_LIBRARIES ${LINK_LIBRARIES} ${LIBLASTFM_LIBRARIES} )
|
||||
ENDIF(LIBLASTFM_FOUND)
|
||||
IF(GLOOX_FOUND)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${GLOOX_LIBRARIES} )
|
||||
ENDIF(GLOOX_FOUND)
|
||||
IF(QCA2_FOUND)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${QCA2_LIBRARIES} )
|
||||
SET( LINK_LIBRARIES ${LINK_LIBRARIES} ${QCA2_LIBRARIES} )
|
||||
ENDIF(QCA2_FOUND)
|
||||
IF(WITH_BREAKPAD)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} tomahawk_breakpad)
|
||||
SET( LINK_LIBRARIES ${LINK_LIBRARIES} tomahawk_breakpad )
|
||||
ENDIF()
|
||||
|
||||
TARGET_LINK_LIBRARIES( tomahawk
|
||||
|
@ -19,9 +19,10 @@
|
||||
|
||||
#cmakedefine WITH_BREAKPAD
|
||||
#cmakedefine WITH_CRASHREPORTER
|
||||
#cmakedefine WITH_BINARY_ATTICA
|
||||
|
||||
|
||||
#cmakedefine LIBLASTFM_FOUND
|
||||
#cmakedefine GLOOX_FOUND
|
||||
#cmakedefine QCA2_FOUND
|
||||
|
||||
#endif // CONFIG_H_IN
|
||||
|
@ -26,11 +26,13 @@
|
||||
#include "network/Servent.h"
|
||||
#include "SourceList.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QDebug>
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "sip/SipHandler.h"
|
||||
@ -42,14 +44,17 @@ DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
|
||||
{
|
||||
ui->setupUi( this );
|
||||
|
||||
connect( ui->updateButton, SIGNAL( clicked() ), this, SLOT( updateLogView() ) );
|
||||
connect( ui->clipboardButton, SIGNAL( clicked() ), this, SLOT( copyToClipboard() ) );
|
||||
connect( ui->buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
|
||||
ui->scrollAreaWidgetContents->setLayout( new QVBoxLayout() );
|
||||
|
||||
updateLogView();
|
||||
}
|
||||
|
||||
void DiagnosticsDialog::updateLogView()
|
||||
|
||||
void
|
||||
DiagnosticsDialog::updateLogView()
|
||||
{
|
||||
QString log;
|
||||
|
||||
@ -59,16 +64,11 @@ void DiagnosticsDialog::updateLogView()
|
||||
);
|
||||
|
||||
// network
|
||||
log.append(
|
||||
"TOMAHAWK-VERSION: " TOMAHAWK_VERSION "\n\n\n"
|
||||
);
|
||||
log.append( "TOMAHAWK-VERSION: " TOMAHAWK_VERSION "\n\n" );
|
||||
|
||||
// network
|
||||
log.append(
|
||||
"NETWORK:\n"
|
||||
" General:\n"
|
||||
);
|
||||
if( Servent::instance()->visibleExternally() )
|
||||
log.append( "NETWORK:\n General:\n" );
|
||||
if ( Servent::instance()->visibleExternally() )
|
||||
{
|
||||
log.append(
|
||||
QString(
|
||||
@ -83,17 +83,13 @@ void DiagnosticsDialog::updateLogView()
|
||||
}
|
||||
else
|
||||
{
|
||||
log.append(
|
||||
QString(
|
||||
" visible: false"
|
||||
)
|
||||
);
|
||||
log.append( " visible: false" );
|
||||
}
|
||||
log.append("\n\n");
|
||||
|
||||
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget( new QLabel( log, this ) );
|
||||
// Peers / Accounts, TODO
|
||||
log.append("ACCOUNTS:\n");
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget( new QLabel( "ACCOUNTS:\n", this ) );
|
||||
|
||||
const QList< Tomahawk::source_ptr > sources = SourceList::instance()->sources( true );
|
||||
const QList< Tomahawk::Accounts::Account* > accounts = Tomahawk::Accounts::AccountManager::instance()->accounts( Tomahawk::Accounts::SipType );
|
||||
foreach ( Tomahawk::Accounts::Account* account, accounts )
|
||||
@ -102,6 +98,104 @@ void DiagnosticsDialog::updateLogView()
|
||||
if ( !account || !account->sipPlugin() )
|
||||
continue;
|
||||
|
||||
connect( account, SIGNAL( connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ),
|
||||
SLOT( onAccountConnectionStateChanged( Tomahawk::Accounts::Account::ConnectionState ) ) );
|
||||
connect( account, SIGNAL( error( int, QString ) ),
|
||||
SLOT( onAccountError( int, QString ) ) );
|
||||
|
||||
connect( account->sipPlugin(), SIGNAL( peerOnline( QString ) ), SLOT( onPeerOnline( QString ) ) );
|
||||
connect( account->sipPlugin(), SIGNAL( peerOffline( QString ) ), SLOT( onPeerOffline( QString ) ) );
|
||||
connect( account->sipPlugin(), SIGNAL( sipInfoReceived( QString, SipInfo ) ), SLOT( onSipInfoReceived( QString, SipInfo ) ) );
|
||||
connect( account->sipPlugin(), SIGNAL( softwareVersionReceived( QString, QString ) ), SLOT( onSoftwareVersionReceived( QString, QString ) ) );
|
||||
|
||||
QLabel* accountInfoLabel = new QLabel( this );
|
||||
ui->scrollAreaWidgetContents->layout()->addWidget( accountInfoLabel );
|
||||
m_accountDescriptionStore.insert( account, accountInfoLabel );
|
||||
|
||||
updateAccountLabel( account );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::copyToClipboard()
|
||||
{
|
||||
QString log;
|
||||
foreach ( QLabel* label, m_accountDescriptionStore.values() )
|
||||
{
|
||||
log += label->text() + "\n\n";
|
||||
}
|
||||
|
||||
QApplication::clipboard()->setText( log );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::onAccountConnectionStateChanged( Tomahawk::Accounts::Account::ConnectionState /* state */ )
|
||||
{
|
||||
Tomahawk::Accounts::Account* account = qobject_cast< Tomahawk::Accounts::Account* >( sender() );
|
||||
Q_ASSERT( account );
|
||||
|
||||
updateAccountLabel( account );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::onAccountError( int /* errorId */ , QString /* errorString */ )
|
||||
{
|
||||
Tomahawk::Accounts::Account* account = qobject_cast< Tomahawk::Accounts::Account* >( sender() );
|
||||
Q_ASSERT( account );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::onPeerOnline( const QString& )
|
||||
{
|
||||
Tomahawk::Accounts::Account* account = qobject_cast< SipPlugin* >( sender() )->account();
|
||||
Q_ASSERT( account );
|
||||
|
||||
updateAccountLabel( account );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::onPeerOffline( const QString& )
|
||||
{
|
||||
Tomahawk::Accounts::Account* account = qobject_cast< SipPlugin* >( sender() )->account();
|
||||
Q_ASSERT( account );
|
||||
|
||||
updateAccountLabel( account );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::onSipInfoReceived( const QString& /* peerId */ , const SipInfo& /* info */ )
|
||||
{
|
||||
Tomahawk::Accounts::Account* account = qobject_cast< SipPlugin* >( sender() )->account();
|
||||
Q_ASSERT( account );
|
||||
|
||||
updateAccountLabel( account );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::onSoftwareVersionReceived( const QString& /* peerId */ , const QString& /* versionString */ )
|
||||
{
|
||||
Tomahawk::Accounts::Account* account = qobject_cast< SipPlugin* >( sender() )->account();
|
||||
Q_ASSERT( account );
|
||||
|
||||
updateAccountLabel( account );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiagnosticsDialog::updateAccountLabel( Tomahawk::Accounts::Account* account )
|
||||
{
|
||||
QLabel* accountInfoLabel = m_accountDescriptionStore.value( account );
|
||||
|
||||
if ( accountInfoLabel )
|
||||
{
|
||||
QString accountInfo;
|
||||
QString stateString;
|
||||
switch( account->connectionState() )
|
||||
{
|
||||
@ -118,7 +212,7 @@ void DiagnosticsDialog::updateLogView()
|
||||
case Tomahawk::Accounts::Account::Disconnecting:
|
||||
stateString = "Disconnecting";
|
||||
}
|
||||
log.append(
|
||||
accountInfo.append(
|
||||
QString( " %2 (%1): %3 (%4)\n" )
|
||||
.arg( account->accountServiceName() )
|
||||
.arg( account->sipPlugin()->friendlyName() )
|
||||
@ -126,55 +220,43 @@ void DiagnosticsDialog::updateLogView()
|
||||
.arg( stateString )
|
||||
);
|
||||
|
||||
foreach( const QString &peerId, account->sipPlugin()->peersOnline() )
|
||||
foreach( const QString& peerId, account->sipPlugin()->peersOnline() )
|
||||
{
|
||||
/* enable this again, when we check the Source.has this peerId
|
||||
bool connected = false;
|
||||
Q_FOREACH( const Tomahawk::source_ptr &source, sources )
|
||||
{
|
||||
if( source->controlConnection() )
|
||||
{
|
||||
connected = true;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
QString versionString = SipHandler::instance()->versionString( peerId );
|
||||
SipInfo sipInfo = SipHandler::instance()->sipInfo( peerId );
|
||||
if( !sipInfo.isValid() )
|
||||
log.append(
|
||||
if ( !sipInfo.isValid() )
|
||||
{
|
||||
accountInfo.append(
|
||||
QString(" %1: %2 %3" /*"(%4)"*/ "\n")
|
||||
.arg( peerId )
|
||||
.arg( "sipinfo invalid" )
|
||||
.arg( versionString )
|
||||
// .arg( connected ? "connected" : "not connected")
|
||||
);
|
||||
else if( sipInfo.isVisible() )
|
||||
log.append(
|
||||
}
|
||||
else if ( sipInfo.isVisible() )
|
||||
{
|
||||
accountInfo.append(
|
||||
QString(" %1: %2:%3 %4" /*" (%5)"*/ "\n")
|
||||
.arg( peerId )
|
||||
.arg( sipInfo.host().hostName() )
|
||||
.arg( sipInfo.port() )
|
||||
.arg( versionString )
|
||||
// .arg( connected ? "connected" : "not connected")
|
||||
|
||||
);
|
||||
}
|
||||
else
|
||||
log.append(
|
||||
{
|
||||
accountInfo.append(
|
||||
QString(" %1: visible: false %2" /*" (%3)"*/ "\n")
|
||||
.arg( peerId )
|
||||
.arg( versionString )
|
||||
// .arg( connected ? "connected" : "not connected")
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
log.append("\n");
|
||||
accountInfo.append( "\n" );
|
||||
|
||||
accountInfoLabel->setText( accountInfo );
|
||||
}
|
||||
ui->logView->setPlainText(log);
|
||||
}
|
||||
|
||||
void DiagnosticsDialog::copyToClipboard()
|
||||
{
|
||||
QApplication::clipboard()->setText( ui->logView->toPlainText() );
|
||||
}
|
||||
|
||||
}
|
@ -19,7 +19,15 @@
|
||||
#ifndef DIGANOSTICSDIALOG_H
|
||||
#define DIAGNOSTICSDIALOG_H
|
||||
|
||||
#include "accounts/Account.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMap>
|
||||
|
||||
|
||||
class QLabel;
|
||||
|
||||
class SipInfo;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -37,8 +45,19 @@ public:
|
||||
private slots:
|
||||
void updateLogView();
|
||||
void copyToClipboard();
|
||||
|
||||
void onAccountConnectionStateChanged( Tomahawk::Accounts::Account::ConnectionState state );
|
||||
void onAccountError( int errorId, QString errorString );
|
||||
void onPeerOnline( const QString& );
|
||||
void onPeerOffline( const QString& );
|
||||
void onSipInfoReceived( const QString& peerId, const SipInfo& info );
|
||||
void onSoftwareVersionReceived( const QString& peerId, const QString& versionString );
|
||||
|
||||
void updateAccountLabel( Tomahawk::Accounts::Account* );
|
||||
private:
|
||||
|
||||
QMap< Tomahawk::Accounts::Account*, QLabel* > m_accountDescriptionStore;
|
||||
|
||||
Ui::DiagnosticsDialog* ui;
|
||||
};
|
||||
|
||||
|
@ -26,19 +26,26 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="logView"/>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>708</width>
|
||||
<height>386</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="updateButton">
|
||||
<property name="text">
|
||||
<string>Update</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="clipboardButton">
|
||||
<property name="text">
|
||||
|
@ -106,15 +106,17 @@ MusicScanner::MusicScanner( const QStringList& dirs, quint32 bs )
|
||||
, m_batchsize( bs )
|
||||
, m_dirListerThreadController( 0 )
|
||||
{
|
||||
m_ext2mime.insert( "mp3", TomahawkUtils::extensionToMimetype( "mp3" ) );
|
||||
m_ext2mime.insert( "ogg", TomahawkUtils::extensionToMimetype( "ogg" ) );
|
||||
m_ext2mime.insert( "oga", TomahawkUtils::extensionToMimetype( "oga" ) );
|
||||
m_ext2mime.insert( "mpc", TomahawkUtils::extensionToMimetype( "mpc" ) );
|
||||
m_ext2mime.insert( "wma", TomahawkUtils::extensionToMimetype( "wma" ) );
|
||||
m_ext2mime.insert( "aac", TomahawkUtils::extensionToMimetype( "aac" ) );
|
||||
m_ext2mime.insert( "m4a", TomahawkUtils::extensionToMimetype( "m4a" ) );
|
||||
m_ext2mime.insert( "mp4", TomahawkUtils::extensionToMimetype( "mp4" ) );
|
||||
m_ext2mime.insert( "mp3", TomahawkUtils::extensionToMimetype( "mp3" ) );
|
||||
m_ext2mime.insert( "ogg", TomahawkUtils::extensionToMimetype( "ogg" ) );
|
||||
m_ext2mime.insert( "oga", TomahawkUtils::extensionToMimetype( "oga" ) );
|
||||
m_ext2mime.insert( "mpc", TomahawkUtils::extensionToMimetype( "mpc" ) );
|
||||
m_ext2mime.insert( "wma", TomahawkUtils::extensionToMimetype( "wma" ) );
|
||||
m_ext2mime.insert( "aac", TomahawkUtils::extensionToMimetype( "aac" ) );
|
||||
m_ext2mime.insert( "m4a", TomahawkUtils::extensionToMimetype( "m4a" ) );
|
||||
m_ext2mime.insert( "mp4", TomahawkUtils::extensionToMimetype( "mp4" ) );
|
||||
m_ext2mime.insert( "flac", TomahawkUtils::extensionToMimetype( "flac" ) );
|
||||
m_ext2mime.insert( "aiff", TomahawkUtils::extensionToMimetype( "aiff" ) );
|
||||
m_ext2mime.insert( "aif", TomahawkUtils::extensionToMimetype( "aif" ) );
|
||||
}
|
||||
|
||||
|
||||
@ -199,18 +201,16 @@ MusicScanner::listerFinished()
|
||||
foreach( const QString& key, m_filemtimes.keys() )
|
||||
m_filesToDelete << m_filemtimes[ key ].keys().first();
|
||||
|
||||
tDebug() << "Lister finished: to delete:" << m_filesToDelete;
|
||||
tDebug( LOGINFO ) << "Scanning complete, saving to database. ( deleted" << m_filesToDelete.count() << "- scanned" << m_scanned << "- skipped" << m_skipped << ")";
|
||||
tDebug( LOGEXTRA ) << "Skipped the following files (no tags / no valid audio):";
|
||||
foreach ( const QString& s, m_skippedFiles )
|
||||
tDebug( LOGEXTRA ) << s;
|
||||
|
||||
if ( m_filesToDelete.length() || m_scannedfiles.length() )
|
||||
{
|
||||
commitBatch( m_scannedfiles, m_filesToDelete );
|
||||
m_scannedfiles.clear();
|
||||
m_filesToDelete.clear();
|
||||
|
||||
tDebug( LOGINFO ) << "Scanning complete, saving to database. ( scanned" << m_scanned << "skipped" << m_skipped << ")";
|
||||
tDebug( LOGEXTRA ) << "Skipped the following files (no tags / no valid audio):";
|
||||
foreach ( const QString& s, m_skippedFiles )
|
||||
tDebug( LOGEXTRA ) << s;
|
||||
}
|
||||
else
|
||||
cleanup();
|
||||
@ -335,9 +335,8 @@ MusicScanner::readFile( const QFileInfo& fi )
|
||||
|
||||
int bitrate = 0;
|
||||
int duration = 0;
|
||||
|
||||
|
||||
Tag *tag = Tag::fromFile( f );
|
||||
|
||||
if ( f.audioProperties() )
|
||||
{
|
||||
TagLib::AudioProperties *properties = f.audioProperties();
|
||||
@ -345,10 +344,14 @@ MusicScanner::readFile( const QFileInfo& fi )
|
||||
bitrate = properties->bitrate();
|
||||
}
|
||||
|
||||
QString artist = tag->artist().trimmed();
|
||||
QString album = tag->album().trimmed();
|
||||
QString track = tag->title().trimmed();
|
||||
if ( artist.isEmpty() || track.isEmpty() )
|
||||
QString artist, album, track;
|
||||
if ( tag )
|
||||
{
|
||||
artist = tag->artist().trimmed();
|
||||
album = tag->album().trimmed();
|
||||
track = tag->title().trimmed();
|
||||
}
|
||||
if ( !tag || artist.isEmpty() || track.isEmpty() )
|
||||
{
|
||||
// FIXME: do some clever filename guessing
|
||||
m_skippedFiles << fi.canonicalFilePath();
|
||||
|
@ -1,117 +0,0 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "JobStatusView.h"
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "libtomahawk/Pipeline.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
||||
JobStatusView::JobStatusView( AnimatedSplitter* parent )
|
||||
: AnimatedWidget( parent )
|
||||
, m_parent( parent )
|
||||
{
|
||||
setHiddenSize( QSize( 0, 0 ) );
|
||||
setLayout( new QVBoxLayout() );
|
||||
m_tree = new QTreeWidget( this );
|
||||
|
||||
layout()->setMargin( 0 );
|
||||
layout()->addWidget( m_tree );
|
||||
|
||||
QStringList headers;
|
||||
headers << tr( "Searching For" ) << tr( "Pending" );
|
||||
m_tree->setHeaderLabels( headers );
|
||||
|
||||
m_tree->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_tree->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
|
||||
m_tree->setColumnCount( 2 );
|
||||
m_tree->setColumnWidth( 0, 200 );
|
||||
m_tree->setColumnWidth( 1, 50 );
|
||||
|
||||
m_tree->header()->setStretchLastSection( true );
|
||||
m_tree->setRootIsDecorated( false );
|
||||
|
||||
m_tree->setFrameShape( QFrame::NoFrame );
|
||||
m_tree->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||
|
||||
new QTreeWidgetItem( m_tree );
|
||||
|
||||
connect( Pipeline::instance(), SIGNAL( resolving( Tomahawk::query_ptr ) ), SLOT( onPipelineUpdate( Tomahawk::query_ptr ) ) );
|
||||
connect( Pipeline::instance(), SIGNAL( idle() ), SLOT( onPipelineUpdate() ) );
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
QFont f = font();
|
||||
f.setPointSize( f.pointSize() - 1 );
|
||||
setFont( f );
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
f.setPointSize( f.pointSize() - 2 );
|
||||
setFont( f );
|
||||
#endif
|
||||
|
||||
onPipelineUpdate();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
JobStatusView::onPipelineUpdate( const query_ptr& query )
|
||||
{
|
||||
QTreeWidgetItem* ti = m_tree->invisibleRootItem()->child( 0 );
|
||||
|
||||
if ( Pipeline::instance()->activeQueryCount() && !query.isNull() )
|
||||
{
|
||||
ti->setText( 0, QString( "%1 - %2" ).arg( query->artist() ).arg( query->track() ) );
|
||||
ti->setText( 1, QString( "%1" ).arg( Pipeline::instance()->activeQueryCount() + Pipeline::instance()->pendingQueryCount() ) );
|
||||
|
||||
if ( isHidden() )
|
||||
emit showWidget();
|
||||
}
|
||||
else
|
||||
{
|
||||
ti->setText( 0, tr( "Idle" ) );
|
||||
ti->setText( 1, QString( "None" ) );
|
||||
|
||||
if ( !isHidden() )
|
||||
emit hideWidget();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QSize
|
||||
JobStatusView::sizeHint() const
|
||||
{
|
||||
unsigned int y = 0;
|
||||
y += m_tree->header()->height();
|
||||
y += m_tree->contentsMargins().top() + m_tree->contentsMargins().bottom();
|
||||
|
||||
if ( m_tree->invisibleRootItem()->childCount() )
|
||||
{
|
||||
unsigned int rowheight = m_tree->sizeHintForRow( 0 );
|
||||
y += rowheight * m_tree->invisibleRootItem()->childCount() + 2;
|
||||
}
|
||||
|
||||
return QSize( 0, y );
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef JOBSTATUSVIEW_H
|
||||
#define JOBSTATUSVIEW_H
|
||||
|
||||
#include <QTreeWidget>
|
||||
|
||||
#include "Typedefs.h"
|
||||
#include "widgets/AnimatedSplitter.h"
|
||||
#include "Query.h"
|
||||
|
||||
class StreamConnection;
|
||||
|
||||
class JobStatusView : public AnimatedWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit JobStatusView( AnimatedSplitter* parent );
|
||||
virtual ~JobStatusView()
|
||||
{
|
||||
}
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
private slots:
|
||||
void onPipelineUpdate( const Tomahawk::query_ptr& query = Tomahawk::query_ptr() );
|
||||
|
||||
private:
|
||||
QTreeView* m_tree;
|
||||
AnimatedSplitter* m_parent;
|
||||
};
|
||||
|
||||
#endif // JOBSTATUSVIEW_H
|
@ -44,8 +44,8 @@ Scrobbler::Scrobbler( QObject* parent )
|
||||
SLOT( engineTick( unsigned int ) ), Qt::QueuedConnection );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
|
||||
|
||||
connect( AudioEngine::instance(), SIGNAL( started( const Tomahawk::result_ptr& ) ),
|
||||
SLOT( trackStarted( const Tomahawk::result_ptr& ) ), Qt::QueuedConnection );
|
||||
@ -72,16 +72,13 @@ void
|
||||
Scrobbler::trackStarted( const Tomahawk::result_ptr& track )
|
||||
{
|
||||
Q_ASSERT( QThread::currentThread() == thread() );
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
|
||||
if( m_reachedScrobblePoint )
|
||||
if ( m_reachedScrobblePoint )
|
||||
{
|
||||
m_reachedScrobblePoint = false;
|
||||
scrobble();
|
||||
}
|
||||
|
||||
QVariantMap playInfo;
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash trackInfo;
|
||||
trackInfo["title"] = track->track();
|
||||
trackInfo["artist"] = track->artist()->name();
|
||||
@ -89,6 +86,7 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track )
|
||||
trackInfo["duration"] = QString::number( track->duration() );
|
||||
trackInfo["albumpos"] = QString::number( track->albumpos() );
|
||||
|
||||
QVariantMap playInfo;
|
||||
playInfo["trackinfo"] = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
|
||||
playInfo["private"] = TomahawkSettings::instance()->privateListeningMode();
|
||||
|
||||
@ -101,9 +99,9 @@ Scrobbler::trackStarted( const Tomahawk::result_ptr& track )
|
||||
|
||||
// liblastfm forces 0-length tracks to scrobble after 4 minutes, stupid.
|
||||
if ( track->duration() == 0 )
|
||||
m_scrobblePoint = ScrobblePoint( 30 );
|
||||
m_scrobblePoint = lastfm::ScrobblePoint( 30 );
|
||||
else
|
||||
m_scrobblePoint = ScrobblePoint( track->duration() / 2 );
|
||||
m_scrobblePoint = lastfm::ScrobblePoint( track->duration() / 2 );
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +124,7 @@ Scrobbler::trackStopped()
|
||||
{
|
||||
Q_ASSERT( QThread::currentThread() == thread() );
|
||||
|
||||
if( m_reachedScrobblePoint )
|
||||
if ( m_reachedScrobblePoint )
|
||||
{
|
||||
m_reachedScrobblePoint = false;
|
||||
scrobble();
|
||||
|
@ -20,7 +20,7 @@
|
||||
#ifndef TOMAHAWK_SCROBBLER_H
|
||||
#define TOMAHAWK_SCROBBLER_H
|
||||
|
||||
#include "lastfm/ScrobblePoint"
|
||||
#include "lastfm/ScrobblePoint.h"
|
||||
#include "Result.h"
|
||||
#include "infosystem/InfoSystem.h"
|
||||
|
||||
@ -51,7 +51,7 @@ private:
|
||||
void scrobble();
|
||||
|
||||
bool m_reachedScrobblePoint;
|
||||
ScrobblePoint m_scrobblePoint;
|
||||
lastfm::ScrobblePoint m_scrobblePoint;
|
||||
};
|
||||
|
||||
|
||||
|
@ -32,16 +32,16 @@
|
||||
#include "AtticaManager.h"
|
||||
#include "TomahawkApp.h"
|
||||
#include "TomahawkSettings.h"
|
||||
#include "DelegateConfigWrapper.h"
|
||||
#include "accounts/DelegateConfigWrapper.h"
|
||||
#include "MusicScanner.h"
|
||||
#include "Pipeline.h"
|
||||
#include "Resolver.h"
|
||||
#include "ExternalResolverGui.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "GuiHelpers.h"
|
||||
#include "utils/GuiHelpers.h"
|
||||
#include "ScanManager.h"
|
||||
#include "SettingsListDelegate.h"
|
||||
#include "AccountDelegate.h"
|
||||
#include "accounts/AccountDelegate.h"
|
||||
#include "database/Database.h"
|
||||
#include "network/Servent.h"
|
||||
#include "utils/AnimatedSpinner.h"
|
||||
@ -51,7 +51,7 @@
|
||||
#include <accounts/AccountModelFilterProxy.h>
|
||||
#include <accounts/ResolverAccount.h>
|
||||
#include "utils/Logger.h"
|
||||
#include "AccountFactoryWrapper.h"
|
||||
#include "accounts/AccountFactoryWrapper.h"
|
||||
#include "accounts/spotify/SpotifyAccount.h"
|
||||
|
||||
#include "ui_ProxyDialog.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
#define CORNER_ROUNDNESS 8.0
|
||||
#define FADING_DURATION 500
|
||||
#define FONT_SIZE 16
|
||||
#define OPACITY 0.70
|
||||
#define OPACITY 0.85
|
||||
|
||||
|
||||
SocialWidget::SocialWidget( QWidget* parent )
|
||||
@ -55,17 +55,23 @@ SocialWidget::SocialWidget( QWidget* parent )
|
||||
#endif
|
||||
|
||||
ui->charsLeftLabel->setForegroundRole( QPalette::HighlightedText );
|
||||
|
||||
|
||||
ui->buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Tweet" ) );
|
||||
|
||||
m_parent->installEventFilter( this );
|
||||
|
||||
connect( ui->buttonBox, SIGNAL( accepted() ), SLOT( accept() ) );
|
||||
connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( deleteLater() ) );
|
||||
connect( ui->buttonBox, SIGNAL( rejected() ), SLOT( close() ) );
|
||||
connect( ui->textEdit, SIGNAL( textChanged() ), SLOT( onChanged() ) );
|
||||
connect( ui->facebookButton, SIGNAL( clicked( bool ) ), SLOT( onChanged() ) );
|
||||
connect( ui->twitterButton, SIGNAL( clicked( bool ) ), SLOT( onChanged() ) );
|
||||
connect( GlobalActionManager::instance(), SIGNAL( shortLinkReady( QUrl, QUrl, QVariant ) ), SLOT( onShortLinkReady( QUrl, QUrl, QVariant ) ) );
|
||||
|
||||
onChanged();
|
||||
|
||||
ui->twitterButton->setChecked( true );
|
||||
ui->twitterButton->setVisible( false );
|
||||
ui->facebookButton->setVisible( false );
|
||||
}
|
||||
|
||||
|
||||
@ -83,6 +89,7 @@ SocialWidget::setOpacity( qreal opacity )
|
||||
if ( m_opacity == 0.00 && !isHidden() )
|
||||
{
|
||||
QWidget::hide();
|
||||
emit hidden();
|
||||
}
|
||||
else if ( m_opacity > 0.00 && isHidden() )
|
||||
{
|
||||
@ -197,9 +204,9 @@ SocialWidget::onShortLinkReady( const QUrl& longUrl, const QUrl& shortUrl, const
|
||||
Q_UNUSED( callbackObj );
|
||||
|
||||
if ( m_query->album().isEmpty() )
|
||||
ui->textEdit->setText( tr( "Listening to \"%1\" by %2 and loving it! %3" ).arg( m_query->track() ).arg( m_query->artist() ).arg( shortUrl.toString() ) );
|
||||
ui->textEdit->setText( tr( "Listening to \"%1\" by %2. %3" ).arg( m_query->track() ).arg( m_query->artist() ).arg( shortUrl.toString() ) );
|
||||
else
|
||||
ui->textEdit->setText( tr( "Listening to \"%1\" by %2 on \"%3\" and loving it! %4" ).arg( m_query->track() ).arg( m_query->artist() ).arg( m_query->album() ).arg( shortUrl.toString() ) );
|
||||
ui->textEdit->setText( tr( "Listening to \"%1\" by %2 on \"%3\". %4" ).arg( m_query->track() ).arg( m_query->artist() ).arg( m_query->album() ).arg( shortUrl.toString() ) );
|
||||
}
|
||||
|
||||
|
||||
@ -229,7 +236,29 @@ void
|
||||
SocialWidget::accept()
|
||||
{
|
||||
tDebug() << "Sharing social link!";
|
||||
|
||||
QVariantMap shareInfo;
|
||||
Tomahawk::InfoSystem::InfoStringHash trackInfo;
|
||||
|
||||
trackInfo["title"] = m_query->track();
|
||||
trackInfo["artist"] = m_query->artist();
|
||||
trackInfo["album"] = m_query->album();
|
||||
|
||||
shareInfo["trackinfo"] = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
|
||||
shareInfo["message"] = ui->textEdit->toPlainText();
|
||||
shareInfo["accountlist"] = QStringList( "all" );
|
||||
|
||||
Tomahawk::InfoSystem::InfoPushData pushData( uuid(), Tomahawk::InfoSystem::InfoShareTrack, shareInfo, Tomahawk::InfoSystem::PushNoFlag );
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->pushInfo( pushData );
|
||||
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SocialWidget::close()
|
||||
{
|
||||
QWidget::hide();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,9 @@ public:
|
||||
|
||||
bool shown() const;
|
||||
|
||||
signals:
|
||||
void hidden();
|
||||
|
||||
public slots:
|
||||
void show( int timeoutSecs = 0 );
|
||||
void hide();
|
||||
@ -65,6 +68,7 @@ private slots:
|
||||
void onShortLinkReady( const QUrl& longUrl, const QUrl& shortUrl, const QVariant& callbackObj );
|
||||
|
||||
void onGeometryUpdate();
|
||||
void close();
|
||||
|
||||
private:
|
||||
unsigned int charsAvailable() const;
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QTranslator>
|
||||
|
||||
#include "Artist.h"
|
||||
#include "Album.h"
|
||||
@ -83,11 +84,6 @@
|
||||
#include <TomahawkSettingsGui.h>
|
||||
#endif
|
||||
|
||||
// should go to a plugin actually
|
||||
#ifdef GLOOX_FOUND
|
||||
#include "xmppbot/XmppBot.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#include "mac/MacShortcutHandler.h"
|
||||
|
||||
@ -134,6 +130,43 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
||||
setApplicationVersion( QLatin1String( TOMAHAWK_VERSION ) );
|
||||
|
||||
registerMetaTypes();
|
||||
installTranslator();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkApp::installTranslator()
|
||||
{
|
||||
QString locale = QLocale::system().name();
|
||||
if ( locale == "C" )
|
||||
locale = "en";
|
||||
|
||||
// Tomahawk translations
|
||||
QTranslator* translator = new QTranslator( this );
|
||||
if ( translator->load( QString( ":/lang/tomahawk_" ) + locale ) )
|
||||
{
|
||||
tDebug() << "Translation: Tomahawk: Using system locale:" << locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
tDebug() << "Translation: Tomahawk: Using default locale, system locale one not found:" << locale;
|
||||
translator->load( QString( ":/lang/tomahawk_en" ) );
|
||||
}
|
||||
|
||||
TOMAHAWK_APPLICATION::installTranslator( translator );
|
||||
|
||||
// Qt translations
|
||||
translator = new QTranslator( this );
|
||||
if ( translator->load( QString( ":/lang/qt_" ) + locale ) )
|
||||
{
|
||||
tDebug() << "Translation: Qt: Using system locale:" << locale;
|
||||
}
|
||||
else
|
||||
{
|
||||
tDebug() << "Translation: Qt: Using default locale, system locale one not found:" << locale;
|
||||
}
|
||||
|
||||
TOMAHAWK_APPLICATION::installTranslator( translator );
|
||||
}
|
||||
|
||||
|
||||
@ -309,9 +342,9 @@ TomahawkApp::init()
|
||||
connect( r, SIGNAL( finished() ), this, SLOT( spotifyApiCheckFinished() ) );
|
||||
#endif
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
// Make sure to do this after main window is inited
|
||||
Tomahawk::enableFullscreen();
|
||||
Tomahawk::enableFullscreen( m_mainwindow );
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -426,6 +459,7 @@ TomahawkApp::registerMetaTypes()
|
||||
qRegisterMetaType<Tomahawk::ModelMode>("Tomahawk::ModelMode");
|
||||
|
||||
// Extra definition for namespaced-versions of signals/slots required
|
||||
qRegisterMetaType< Tomahawk::Resolver* >("Tomahawk::Resolver*");
|
||||
qRegisterMetaType< Tomahawk::source_ptr >("Tomahawk::source_ptr");
|
||||
qRegisterMetaType< Tomahawk::collection_ptr >("Tomahawk::collection_ptr");
|
||||
qRegisterMetaType< Tomahawk::result_ptr >("Tomahawk::result_ptr");
|
||||
@ -593,10 +627,6 @@ TomahawkApp::initSIP()
|
||||
//FIXME: jabber autoconnect is really more, now that there is sip -- should be renamed and/or split out of jabber-specific settings
|
||||
if ( !arguments().contains( "--nosip" ) )
|
||||
{
|
||||
#ifdef GLOOX_FOUND
|
||||
m_xmppBot = QWeakPointer<XMPPBot>( new XMPPBot( this ) );
|
||||
#endif
|
||||
|
||||
tDebug( LOGINFO ) << "Connecting SIP classes";
|
||||
Accounts::AccountManager::instance()->initSIP();
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ namespace Tomahawk
|
||||
}
|
||||
|
||||
#ifdef LIBLASTFM_FOUND
|
||||
#include <lastfm/NetworkAccessManager>
|
||||
#include <lastfm/NetworkAccessManager.h>
|
||||
#include "Scrobbler.h"
|
||||
#endif
|
||||
|
||||
@ -115,6 +115,7 @@ private slots:
|
||||
void accountManagerReady();
|
||||
|
||||
private:
|
||||
void installTranslator();
|
||||
void registerMetaTypes();
|
||||
|
||||
void printHelp();
|
||||
|
@ -40,8 +40,14 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
||||
, m_currentAnimationFrame( 0 )
|
||||
, m_showWindowAction( 0 )
|
||||
, m_stopContinueAfterTrackAction( 0 )
|
||||
, m_loveTrackAction( 0 )
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
QIcon icon( RESPATH "icons/tomahawk-icon-128x128-grayscale.png" );
|
||||
#else
|
||||
QIcon icon( RESPATH "icons/tomahawk-icon-128x128.png" );
|
||||
#endif
|
||||
|
||||
setIcon( icon );
|
||||
|
||||
refreshToolTip();
|
||||
@ -49,12 +55,14 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
||||
m_contextMenu = new QMenu();
|
||||
setContextMenu( m_contextMenu );
|
||||
|
||||
m_loveTrackAction = new QAction( this );
|
||||
m_stopContinueAfterTrackAction = new QAction( this );
|
||||
onStopContinueAfterTrackChanged();
|
||||
|
||||
ActionCollection *ac = ActionCollection::instance();
|
||||
m_contextMenu->addAction( ac->getAction( "playPause" ) );
|
||||
m_contextMenu->addAction( ac->getAction( "stop" ) );
|
||||
m_contextMenu->addSeparator();
|
||||
m_contextMenu->addAction( m_loveTrackAction );
|
||||
m_contextMenu->addAction( m_stopContinueAfterTrackAction );
|
||||
m_contextMenu->addSeparator();
|
||||
m_contextMenu->addAction( ac->getAction( "previousTrack" ) );
|
||||
@ -62,8 +70,6 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
||||
m_contextMenu->addSeparator();
|
||||
m_contextMenu->addAction( ActionCollection::instance()->getAction( "togglePrivacy" ) );
|
||||
|
||||
connect( m_stopContinueAfterTrackAction, SIGNAL( triggered() ), SLOT( stopContinueAfterTrackActionTriggered() ) );
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
// On mac you can close the windows while leaving the app open. We then need a way to show the main window again
|
||||
m_contextMenu->addSeparator();
|
||||
@ -77,6 +83,9 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
||||
m_contextMenu->addSeparator();
|
||||
m_contextMenu->addAction( ac->getAction( "quit" ) );
|
||||
|
||||
connect( m_loveTrackAction, SIGNAL( triggered() ), SLOT( loveTrackTriggered() ) );
|
||||
connect( m_stopContinueAfterTrackAction, SIGNAL( triggered() ), SLOT( stopContinueAfterTrackActionTriggered() ) );
|
||||
|
||||
connect( AudioEngine::instance(), SIGNAL( loading( Tomahawk::result_ptr ) ), SLOT( setResult( Tomahawk::result_ptr ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlay() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( resumed() ), SLOT( onResume() ) );
|
||||
@ -87,6 +96,7 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
||||
connect( &m_animationTimer, SIGNAL( timeout() ), SLOT( onAnimationTimer() ) );
|
||||
connect( this, SIGNAL( activated( QSystemTrayIcon::ActivationReason ) ), SLOT( onActivated( QSystemTrayIcon::ActivationReason ) ) );
|
||||
|
||||
onStop();
|
||||
show();
|
||||
}
|
||||
|
||||
@ -146,8 +156,29 @@ TomahawkTrayIcon::menuAboutToShow()
|
||||
void
|
||||
TomahawkTrayIcon::setResult( const Tomahawk::result_ptr& result )
|
||||
{
|
||||
if ( m_currentTrack )
|
||||
{
|
||||
disconnect( m_currentTrack->toQuery().data(), SIGNAL( socialActionsLoaded() ), this, SLOT( onSocialActionsLoaded() ) );
|
||||
}
|
||||
|
||||
m_currentTrack = result;
|
||||
refreshToolTip();
|
||||
|
||||
if ( result )
|
||||
connect( result->toQuery().data(), SIGNAL( socialActionsLoaded() ), SLOT( onSocialActionsLoaded() ), Qt::UniqueConnection );
|
||||
|
||||
onSocialActionsLoaded();
|
||||
onStopContinueAfterTrackChanged();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkTrayIcon::onStopContinueAfterTrackChanged()
|
||||
{
|
||||
if ( m_currentTrack && m_currentTrack->toQuery()->equals( AudioEngine::instance()->stopAfterTrack() ) )
|
||||
m_stopContinueAfterTrackAction->setText( tr( "&Continue Playback after current Track" ) );
|
||||
else
|
||||
m_stopContinueAfterTrackAction->setText( tr( "&Stop Playback after current Track" ) );
|
||||
}
|
||||
|
||||
|
||||
@ -235,16 +266,20 @@ TomahawkTrayIcon::onPause()
|
||||
void
|
||||
TomahawkTrayIcon::onPlay()
|
||||
{
|
||||
m_loveTrackAction->setEnabled( true );
|
||||
m_stopContinueAfterTrackAction->setEnabled( true );
|
||||
|
||||
onResume();
|
||||
onStopContinueAfterTrackChanged();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkTrayIcon::onStop()
|
||||
{
|
||||
m_loveTrackAction->setEnabled( false );
|
||||
m_stopContinueAfterTrackAction->setEnabled( false );
|
||||
|
||||
setResult( Tomahawk::result_ptr() );
|
||||
onPause();
|
||||
}
|
||||
|
||||
@ -257,26 +292,41 @@ TomahawkTrayIcon::onResume()
|
||||
|
||||
|
||||
void
|
||||
TomahawkTrayIcon::onStopContinueAfterTrackChanged()
|
||||
TomahawkTrayIcon::loveTrackTriggered()
|
||||
{
|
||||
if ( !AudioEngine::instance()->currentTrack().isNull() )
|
||||
{
|
||||
if ( AudioEngine::instance()->currentTrack()->toQuery()->equals( AudioEngine::instance()->stopAfterTrack() ) )
|
||||
m_stopContinueAfterTrackAction->setText( tr( "&Continue Playback after current Track" ) );
|
||||
else
|
||||
m_stopContinueAfterTrackAction->setText( tr( "&Stop Playback after current Track" ) );
|
||||
}
|
||||
if ( !m_currentTrack )
|
||||
return;
|
||||
|
||||
m_currentTrack->toQuery()->setLoved( !m_currentTrack->toQuery()->loved() );
|
||||
}
|
||||
|
||||
|
||||
void TomahawkTrayIcon::stopContinueAfterTrackActionTriggered()
|
||||
void
|
||||
TomahawkTrayIcon::stopContinueAfterTrackActionTriggered()
|
||||
{
|
||||
if ( !AudioEngine::instance()->currentTrack().isNull() )
|
||||
if ( !m_currentTrack )
|
||||
return;
|
||||
|
||||
if ( !m_currentTrack->toQuery()->equals( AudioEngine::instance()->stopAfterTrack() ) )
|
||||
AudioEngine::instance()->setStopAfterTrack( m_currentTrack->toQuery() );
|
||||
else
|
||||
AudioEngine::instance()->setStopAfterTrack( Tomahawk::query_ptr() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkTrayIcon::onSocialActionsLoaded()
|
||||
{
|
||||
m_loveTrackAction->setText( tr( "&Love" ) );
|
||||
m_loveTrackAction->setIcon( QIcon( RESPATH "images/loved.png" ) );
|
||||
|
||||
if ( !m_currentTrack )
|
||||
return;
|
||||
|
||||
if ( m_currentTrack->toQuery()->loved() )
|
||||
{
|
||||
if ( !AudioEngine::instance()->currentTrack()->toQuery()->equals( AudioEngine::instance()->stopAfterTrack() ) )
|
||||
AudioEngine::instance()->setStopAfterTrack( AudioEngine::instance()->currentTrack()->toQuery() );
|
||||
else
|
||||
AudioEngine::instance()->setStopAfterTrack( Tomahawk::query_ptr() );
|
||||
m_loveTrackAction->setText( tr( "Un-&Love" ) );
|
||||
m_loveTrackAction->setIcon( QIcon( RESPATH "images/not-loved.png" ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,4 +352,3 @@ TomahawkTrayIcon::event( QEvent* e )
|
||||
|
||||
return QSystemTrayIcon::event( e );
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,13 @@ private slots:
|
||||
void onStop();
|
||||
void onResume();
|
||||
|
||||
void onSocialActionsLoaded();
|
||||
void onStopContinueAfterTrackChanged();
|
||||
void stopContinueAfterTrackActionTriggered();
|
||||
void loveTrackTriggered();
|
||||
|
||||
void menuAboutToShow();
|
||||
|
||||
private:
|
||||
void refreshToolTip();
|
||||
~TomahawkTrayIcon();
|
||||
@ -67,6 +70,7 @@ private:
|
||||
|
||||
QAction* m_showWindowAction;
|
||||
QAction* m_stopContinueAfterTrackAction;
|
||||
QAction* m_loveTrackAction;
|
||||
};
|
||||
|
||||
#endif // TOMAHAWK_TRAYICON_H
|
||||
|
@ -35,14 +35,12 @@
|
||||
#include <QTimer>
|
||||
#include <QToolBar>
|
||||
|
||||
#include "Playlist.h"
|
||||
#include "Query.h"
|
||||
#include "Artist.h"
|
||||
#include "ViewManager.h"
|
||||
#include "accounts/AccountManager.h"
|
||||
#include "sourcetree/SourceTreeView.h"
|
||||
#include "network/Servent.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/ProxyStyle.h"
|
||||
#include "utils/WidgetDragFilter.h"
|
||||
#include "widgets/AnimatedSplitter.h"
|
||||
#include "widgets/NewPlaylistWidget.h"
|
||||
#include "widgets/SearchWidget.h"
|
||||
@ -52,27 +50,31 @@
|
||||
#include "playlist/PlaylistModel.h"
|
||||
#include "playlist/PlaylistView.h"
|
||||
#include "playlist/QueueView.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#include "jobview/ErrorStatusMessage.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
|
||||
#include "Playlist.h"
|
||||
#include "Query.h"
|
||||
#include "Artist.h"
|
||||
#include "ViewManager.h"
|
||||
#include "ActionCollection.h"
|
||||
#include "AudioControls.h"
|
||||
#include "SettingsDialog.h"
|
||||
#include "DiagnosticsDialog.h"
|
||||
#include "TomahawkSettings.h"
|
||||
#include "SourceList.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#include "jobview/ErrorStatusMessage.h"
|
||||
#include "TomahawkTrayIcon.h"
|
||||
#include "ScanManager.h"
|
||||
#include "TomahawkApp.h"
|
||||
#include "LoadXSPFDialog.h"
|
||||
|
||||
#ifdef Q_WS_WIN
|
||||
#include <qtsparkle/Updater>
|
||||
#endif
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#include "LoadXSPFDialog.h"
|
||||
#include <ActionCollection.h>
|
||||
|
||||
using namespace Tomahawk;
|
||||
using namespace Accounts;
|
||||
@ -118,6 +120,8 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
|
||||
|
||||
// set initial state
|
||||
onAccountDisconnected();
|
||||
audioStopped();
|
||||
|
||||
vm->setQueue( m_queueView );
|
||||
vm->showWelcomePage();
|
||||
}
|
||||
@ -156,11 +160,12 @@ TomahawkWindow::loadSettings()
|
||||
restoreState( s->mainWindowState() );
|
||||
if ( !s->mainWindowSplitterState().isEmpty() )
|
||||
ui->splitter->restoreState( s->mainWindowSplitterState() );
|
||||
else
|
||||
{
|
||||
ui->splitter->setStretchFactor( 0, 0 );
|
||||
ui->splitter->setStretchFactor( 1, 1 );
|
||||
}
|
||||
|
||||
// Always set stretch factor. If user hasn't manually set splitter sizes,
|
||||
// this will ensure a sane default on all startups. If the user has, the manual
|
||||
// size will override the default stretching
|
||||
ui->splitter->setStretchFactor( 0, 0 );
|
||||
ui->splitter->setStretchFactor( 1, 1 );
|
||||
|
||||
#ifdef QT_MAC_USE_COCOA
|
||||
if ( workaround )
|
||||
@ -191,7 +196,7 @@ TomahawkWindow::applyPlatformTweaks()
|
||||
if ( !QString( qApp->style()->metaObject()->className() ).toLower().contains( "qtcurve" ) )
|
||||
qApp->setStyle( new ProxyStyle() );
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
setUnifiedTitleAndToolBarOnMac( true );
|
||||
delete ui->hline1;
|
||||
delete ui->hline2;
|
||||
@ -211,7 +216,12 @@ TomahawkWindow::setupToolBar()
|
||||
toolbar->setFloatable( false );
|
||||
toolbar->setIconSize( QSize( 22, 22 ) );
|
||||
toolbar->setToolButtonStyle( Qt::ToolButtonIconOnly );
|
||||
|
||||
toolbar->setStyleSheet( "border-bottom: 0px" );
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
toolbar->installEventFilter( new WidgetDragFilter( toolbar ) );
|
||||
#endif
|
||||
|
||||
m_backAction = toolbar->addAction( QIcon( RESPATH "images/back.png" ), tr( "Back" ), ViewManager::instance(), SLOT( historyBack() ) );
|
||||
m_backAction->setToolTip( tr( "Go back one page" ) );
|
||||
m_forwardAction = toolbar->addAction( QIcon( RESPATH "images/forward.png" ), tr( "Forward" ), ViewManager::instance(), SLOT( historyForward() ) );
|
||||
@ -251,10 +261,6 @@ TomahawkWindow::setupSideBar()
|
||||
jobsView->setModel( m_jobsModel );
|
||||
|
||||
m_queueView = new QueueView( m_sidebar );
|
||||
m_queueModel = new PlaylistModel( m_queueView );
|
||||
m_queueModel->setStyle( PlaylistModel::Short );
|
||||
m_queueView->queue()->setPlaylistModel( m_queueModel );
|
||||
m_queueView->queue()->playlistModel()->setReadOnly( false );
|
||||
AudioEngine::instance()->setQueue( m_queueView->queue()->proxyModel()->playlistInterface() );
|
||||
|
||||
m_sidebar->addWidget( m_sourcetree );
|
||||
@ -271,7 +277,7 @@ TomahawkWindow::setupSideBar()
|
||||
sidebarWidget->layout()->setContentsMargins( 0, 0, 0, 0 );
|
||||
sidebarWidget->layout()->setMargin( 0 );
|
||||
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
sidebarWidget->layout()->setSpacing( 0 );
|
||||
#endif
|
||||
|
||||
@ -286,11 +292,11 @@ TomahawkWindow::setupSideBar()
|
||||
void
|
||||
TomahawkWindow::setupUpdateCheck()
|
||||
{
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
ui->menu_Help->insertSeparator( ui->actionAboutTomahawk );
|
||||
#endif
|
||||
|
||||
#if defined( Q_WS_MAC ) && defined( HAVE_SPARKLE )
|
||||
#if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE )
|
||||
QAction* checkForUpdates = ui->menu_Help->addAction( tr( "Check For Updates..." ) );
|
||||
checkForUpdates->setMenuRole( QAction::ApplicationSpecificRole );
|
||||
connect( checkForUpdates, SIGNAL( triggered( bool ) ), SLOT( checkForUpdates() ) );
|
||||
@ -328,7 +334,7 @@ TomahawkWindow::setupSignals()
|
||||
connect( AudioEngine::instance(), SIGNAL( loading( const Tomahawk::result_ptr& ) ), SLOT( onPlaybackLoading( const Tomahawk::result_ptr& ) ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( audioStarted() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( resumed()), SLOT( audioStarted() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( paused() ), SLOT( audioStopped() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( paused() ), SLOT( audioPaused() ) );
|
||||
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( audioStopped() ) );
|
||||
|
||||
// <Menu Items>
|
||||
@ -349,7 +355,7 @@ TomahawkWindow::setupSignals()
|
||||
connect( ui->actionNext, SIGNAL( triggered() ), AudioEngine::instance(), SLOT( next() ) );
|
||||
connect( ui->actionPrevious, SIGNAL( triggered() ), AudioEngine::instance(), SLOT( previous() ) );
|
||||
|
||||
#if defined( Q_WS_MAC )
|
||||
#if defined( Q_OS_MAC )
|
||||
connect( ui->actionMinimize, SIGNAL( triggered() ), SLOT( minimize() ) );
|
||||
connect( ui->actionZoom, SIGNAL( triggered() ), SLOT( maximize() ) );
|
||||
#else
|
||||
@ -398,7 +404,7 @@ TomahawkWindow::changeEvent( QEvent* e )
|
||||
void
|
||||
TomahawkWindow::closeEvent( QCloseEvent* e )
|
||||
{
|
||||
#ifndef Q_WS_MAC
|
||||
#ifndef Q_OS_MAC
|
||||
if ( e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable() )
|
||||
{
|
||||
hide();
|
||||
@ -418,7 +424,7 @@ TomahawkWindow::showEvent( QShowEvent* e )
|
||||
{
|
||||
QMainWindow::showEvent( e );
|
||||
|
||||
#if defined( Q_WS_MAC )
|
||||
#if defined( Q_OS_MAC )
|
||||
ui->actionMinimize->setDisabled( false );
|
||||
ui->actionZoom->setDisabled( false );
|
||||
#endif
|
||||
@ -430,7 +436,7 @@ TomahawkWindow::hideEvent( QHideEvent* e )
|
||||
{
|
||||
QMainWindow::hideEvent( e );
|
||||
|
||||
#if defined( Q_WS_MAC )
|
||||
#if defined( Q_OS_MAC )
|
||||
ui->actionMinimize->setDisabled( true );
|
||||
ui->actionZoom->setDisabled( true );
|
||||
#endif
|
||||
@ -441,7 +447,7 @@ void
|
||||
TomahawkWindow::keyPressEvent( QKeyEvent* e )
|
||||
{
|
||||
bool accept = true;
|
||||
#if ! defined ( Q_WS_MAC )
|
||||
#if ! defined ( Q_OS_MAC )
|
||||
#define KEY_PRESSED Q_FUNC_INFO << "Multimedia Key Pressed:"
|
||||
switch( e->key() )
|
||||
{
|
||||
@ -589,11 +595,25 @@ TomahawkWindow::showOfflineSources()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::fullScreenEntered()
|
||||
{
|
||||
statusBar()->setSizeGripEnabled( false );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::fullScreenExited()
|
||||
{
|
||||
statusBar()->setSizeGripEnabled( true );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::loadSpiff()
|
||||
{
|
||||
LoadXSPFDialog* diag = new LoadXSPFDialog( this, Qt::Sheet );
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
connect( diag, SIGNAL( finished( int ) ), this, SLOT( loadXspfFinished( int ) ) );
|
||||
diag->show();
|
||||
#else
|
||||
@ -679,18 +699,18 @@ TomahawkWindow::onAudioEngineError( AudioEngine::AudioErrorCode /* error */ )
|
||||
void
|
||||
TomahawkWindow::createAutomaticPlaylist( QString playlistName )
|
||||
{
|
||||
QString name = playlistName;
|
||||
|
||||
if ( name.isEmpty() )
|
||||
if ( playlistName.isEmpty() )
|
||||
return;
|
||||
|
||||
source_ptr author = SourceList::instance()->getLocal();
|
||||
QString id = uuid();
|
||||
QString info = ""; // FIXME
|
||||
QString creator = "someone"; // FIXME
|
||||
dynplaylist_ptr playlist = DynamicPlaylist::create( author, id, name, info, creator, Static, false );
|
||||
|
||||
dynplaylist_ptr playlist = DynamicPlaylist::create( author, id, playlistName, info, creator, Static, false );
|
||||
playlist->setMode( Static );
|
||||
playlist->createNewRevision( uuid(), playlist->currentrevision(), playlist->type(), playlist->generator()->controls(), playlist->entries() );
|
||||
|
||||
ViewManager::instance()->show( playlist );
|
||||
}
|
||||
|
||||
@ -698,18 +718,36 @@ TomahawkWindow::createAutomaticPlaylist( QString playlistName )
|
||||
void
|
||||
TomahawkWindow::createStation()
|
||||
{
|
||||
QString title = tr( "Station" );
|
||||
bool ok;
|
||||
QString name = QInputDialog::getText( this, tr( "Create New Station" ), tr( "Name:" ), QLineEdit::Normal, tr( "New Station" ), &ok );
|
||||
if ( !ok || name.isEmpty() )
|
||||
QString playlistName = QInputDialog( this, Qt::Sheet ).getText( this, tr( "Create New Station" ), tr( "Name:" ), QLineEdit::Normal, title, &ok );
|
||||
if ( !ok )
|
||||
return;
|
||||
|
||||
if ( playlistName.isEmpty() || playlistName == title )
|
||||
{
|
||||
QList< dynplaylist_ptr > pls = SourceList::instance()->getLocal()->collection()->stations();
|
||||
QStringList titles;
|
||||
foreach ( const playlist_ptr& pl, pls )
|
||||
titles << pl->title();
|
||||
|
||||
playlistName = title;
|
||||
int i = 2;
|
||||
while ( titles.contains( playlistName ) )
|
||||
{
|
||||
playlistName = QString( "%1 (%2)" ).arg( title ).arg( i++ );
|
||||
}
|
||||
}
|
||||
|
||||
source_ptr author = SourceList::instance()->getLocal();
|
||||
QString id = uuid();
|
||||
QString info = ""; // FIXME
|
||||
QString creator = "someone"; // FIXME
|
||||
dynplaylist_ptr playlist = DynamicPlaylist::create( author, id, name, info, creator, OnDemand, false );
|
||||
|
||||
dynplaylist_ptr playlist = DynamicPlaylist::create( author, id, playlistName, info, creator, OnDemand, false );
|
||||
playlist->setMode( OnDemand );
|
||||
playlist->createNewRevision( uuid(), playlist->currentrevision(), playlist->type(), playlist->generator()->controls() );
|
||||
|
||||
ViewManager::instance()->show( playlist );
|
||||
}
|
||||
|
||||
@ -718,11 +756,12 @@ void
|
||||
TomahawkWindow::createPlaylist()
|
||||
{
|
||||
PlaylistTypeSelectorDlg* playlistSelectorDlg = new PlaylistTypeSelectorDlg( TomahawkApp::instance()->mainWindow(), Qt::Sheet );
|
||||
#ifndef Q_WS_MAC
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
playlistSelectorDlg->setModal( true );
|
||||
#endif
|
||||
connect( playlistSelectorDlg, SIGNAL( finished( int ) ), this, SLOT( playlistCreateDialogFinished( int ) ) );
|
||||
|
||||
connect( playlistSelectorDlg, SIGNAL( finished( int ) ), SLOT( playlistCreateDialogFinished( int ) ) );
|
||||
playlistSelectorDlg->show();
|
||||
}
|
||||
|
||||
@ -734,17 +773,50 @@ TomahawkWindow::playlistCreateDialogFinished( int ret )
|
||||
Q_ASSERT( playlistSelectorDlg );
|
||||
|
||||
QString playlistName = playlistSelectorDlg->playlistName();
|
||||
if ( playlistName.isEmpty() )
|
||||
playlistName = tr( "New Playlist" );
|
||||
|
||||
if ( !playlistSelectorDlg->playlistTypeIsAuto() && ret ) {
|
||||
if ( !playlistSelectorDlg->playlistTypeIsAuto() && ret )
|
||||
{
|
||||
if ( playlistName.isEmpty() )
|
||||
{
|
||||
QList< playlist_ptr > pls = SourceList::instance()->getLocal()->collection()->playlists();
|
||||
QStringList titles;
|
||||
foreach ( const playlist_ptr& pl, pls )
|
||||
titles << pl->title();
|
||||
|
||||
QString title = tr( "Playlist" );
|
||||
playlistName = title;
|
||||
int i = 2;
|
||||
while ( titles.contains( playlistName ) )
|
||||
{
|
||||
playlistName = QString( "%1 (%2)" ).arg( title ).arg( i++ );
|
||||
}
|
||||
}
|
||||
|
||||
playlist_ptr playlist = Tomahawk::Playlist::create( SourceList::instance()->getLocal(), uuid(), playlistName, "", "", false, QList< query_ptr>() );
|
||||
ViewManager::instance()->show( playlist );
|
||||
} else if ( playlistSelectorDlg->playlistTypeIsAuto() && ret ) {
|
||||
}
|
||||
else if ( playlistSelectorDlg->playlistTypeIsAuto() && ret )
|
||||
{
|
||||
// create Auto Playlist
|
||||
if ( playlistName.isEmpty() )
|
||||
{
|
||||
QList< dynplaylist_ptr > pls = SourceList::instance()->getLocal()->collection()->autoPlaylists();
|
||||
QStringList titles;
|
||||
foreach ( const dynplaylist_ptr& pl, pls )
|
||||
titles << pl->title();
|
||||
|
||||
QString title = tr( "Automatic Playlist" );
|
||||
playlistName = title;
|
||||
int i = 2;
|
||||
while ( titles.contains( playlistName ) )
|
||||
{
|
||||
playlistName = QString( "%1 (%2)" ).arg( title ).arg( i++ );
|
||||
}
|
||||
}
|
||||
|
||||
createAutomaticPlaylist( playlistName );
|
||||
}
|
||||
|
||||
playlistSelectorDlg->deleteLater();
|
||||
}
|
||||
|
||||
@ -753,21 +825,27 @@ void
|
||||
TomahawkWindow::audioStarted()
|
||||
{
|
||||
m_audioRetryCounter = 0;
|
||||
|
||||
ui->actionPlay->setText( tr( "Pause" ) );
|
||||
ActionCollection::instance()->getAction( "stop" )->setEnabled( true );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::audioPaused()
|
||||
{
|
||||
ui->actionPlay->setText( tr( "Play" ) );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::audioStopped()
|
||||
{
|
||||
ui->actionPlay->setText( tr( "Play" ) );
|
||||
audioPaused();
|
||||
ActionCollection::instance()->getAction( "stop" )->setEnabled( false );
|
||||
|
||||
tDebug() << Q_FUNC_INFO << AudioEngine::instance()->isStopped();
|
||||
if ( AudioEngine::instance()->isStopped() )
|
||||
{
|
||||
m_currentTrack = result_ptr();
|
||||
setWindowTitle( m_windowTitle );
|
||||
}
|
||||
m_currentTrack = result_ptr();
|
||||
setWindowTitle( m_windowTitle );
|
||||
}
|
||||
|
||||
|
||||
@ -847,8 +925,13 @@ TomahawkWindow::showAboutTomahawk()
|
||||
.arg( TomahawkUtils::appFriendlyVersion() );
|
||||
#endif
|
||||
|
||||
desc = tr( "Copyright 2010 - 2012<br/>Christian Muehlhaeuser <muesli@tomahawk-player.org><br/><br/>"
|
||||
"Thanks to: Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Hugo Lindström, Michael Zanetti, Harald Sitter and Steve Robertson" );
|
||||
const QString copyright( tr( "Copyright 2010 - 2012" ) );
|
||||
const QString thanksto( tr( "Thanks to:" ) );
|
||||
|
||||
desc = QString( "%1<br/>Christian Muehlhaeuser <muesli@tomahawk-player.org><br/><br/>"
|
||||
"%2 Leo Franchi, Jeff Mitchell, Dominik Schmidt, Jason Herskowitz, Alejandro Wainzinger, Hugo Lindström, Syd Lawrence, Michael Zanetti, Harald Sitter, Steve Robertson" )
|
||||
.arg( copyright )
|
||||
.arg( thanksto );
|
||||
|
||||
QMessageBox::about( this, tr( "About Tomahawk" ), head + desc );
|
||||
}
|
||||
@ -857,7 +940,7 @@ TomahawkWindow::showAboutTomahawk()
|
||||
void
|
||||
TomahawkWindow::checkForUpdates()
|
||||
{
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
Tomahawk::checkForUpdates();
|
||||
#endif
|
||||
}
|
||||
|
@ -88,6 +88,9 @@ public slots:
|
||||
void pluginMenuRemoved(QMenu*);
|
||||
void showOfflineSources();
|
||||
|
||||
void fullScreenEntered();
|
||||
void fullScreenExited();
|
||||
|
||||
private slots:
|
||||
void onAccountAdded( Tomahawk::Accounts::Account* account );
|
||||
void onAccountConnected();
|
||||
@ -107,6 +110,7 @@ private slots:
|
||||
void onPlaybackLoading( const Tomahawk::result_ptr& result );
|
||||
|
||||
void audioStarted();
|
||||
void audioPaused();
|
||||
void audioStopped();
|
||||
|
||||
void showAboutTomahawk();
|
||||
@ -144,7 +148,6 @@ private:
|
||||
SourceTreeView* m_sourcetree;
|
||||
QPushButton* m_statusButton;
|
||||
QPushButton* m_queueButton;
|
||||
PlaylistModel* m_queueModel;
|
||||
QueueView* m_queueView;
|
||||
AnimatedSplitter* m_sidebar;
|
||||
JobStatusModel* m_jobsModel;
|
||||
|
@ -76,15 +76,15 @@ TwitterInfoPlugin::~TwitterInfoPlugin()
|
||||
bool
|
||||
TwitterInfoPlugin::refreshTwitterAuth()
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << " begin" << this;
|
||||
if( !m_twitterAuth.isNull() )
|
||||
tDebug() << Q_FUNC_INFO << "begin" << this;
|
||||
if ( !m_twitterAuth.isNull() )
|
||||
delete m_twitterAuth.data();
|
||||
|
||||
Q_ASSERT( TomahawkUtils::nam() != 0 );
|
||||
tDebug() << Q_FUNC_INFO << " with nam " << TomahawkUtils::nam() << this;
|
||||
tDebug() << Q_FUNC_INFO << "with nam" << TomahawkUtils::nam() << this;
|
||||
m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) );
|
||||
|
||||
if( m_twitterAuth.isNull() )
|
||||
if ( m_twitterAuth.isNull() )
|
||||
return false;
|
||||
|
||||
m_twitterAuth.data()->setOAuthToken( m_account->credentials()[ "oauthtoken" ].toString().toLatin1() );
|
||||
@ -138,7 +138,8 @@ TwitterInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !map[ "accountlist" ].toStringList().contains( m_account->accountId() ) )
|
||||
const QStringList accountList = map[ "accountlist" ].toStringList();
|
||||
if ( !accountList.contains( "all" ) && !accountList.contains( m_account->accountId() ) )
|
||||
{
|
||||
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Our account not in the list, not tweeting out";
|
||||
return;
|
||||
@ -168,7 +169,7 @@ TwitterInfoPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
|
||||
QTweetStatusUpdate *statUpdate = new QTweetStatusUpdate( m_twitterAuth.data(), this );
|
||||
connect( statUpdate, SIGNAL( postedStatus(const QTweetStatus &) ), SLOT( postLovedStatusUpdateReply(const QTweetStatus &) ) );
|
||||
connect( statUpdate, SIGNAL( error(QTweetNetBase::ErrorCode, const QString&) ), SLOT( postLovedStatusUpdateError(QTweetNetBase::ErrorCode, const QString &) ) );
|
||||
tDebug() << Q_FUNC_INFO << "Posting message: " << msg;
|
||||
tDebug() << Q_FUNC_INFO << "Posting message:" << msg;
|
||||
statUpdate->post( msg );
|
||||
}
|
||||
|
||||
|
@ -33,47 +33,51 @@
|
||||
#include "utils/Logger.h"
|
||||
|
||||
|
||||
AvatarManager::AvatarManager(Jreen::Client *client) :
|
||||
m_cacheDir(TomahawkUtils::appDataDir().absolutePath().append("/jreen/"))
|
||||
AvatarManager::AvatarManager( Jreen::Client* client )
|
||||
: m_cacheDir( TomahawkUtils::appDataDir().absolutePath().append( "/jreen/" ) )
|
||||
{
|
||||
m_client = client;
|
||||
|
||||
m_cachedAvatars = m_cacheDir.entryList();
|
||||
|
||||
connect(m_client, SIGNAL(serverFeaturesReceived(QSet<QString>)), SLOT(onNewConnection()));
|
||||
connect(m_client, SIGNAL(presenceReceived(Jreen::Presence)), SLOT(onNewPresence(Jreen::Presence)));
|
||||
connect(m_client, SIGNAL(iqReceived(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ)));
|
||||
connect( m_client, SIGNAL( serverFeaturesReceived( QSet<QString> ) ), SLOT( onNewConnection() ) );
|
||||
connect( m_client, SIGNAL( presenceReceived( Jreen::Presence ) ), SLOT( onNewPresence( Jreen::Presence ) ) );
|
||||
connect( m_client, SIGNAL( iqReceived( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
|
||||
connect(this, SIGNAL(newAvatar(QString)), SLOT(onNewAvatar(QString)));
|
||||
connect( this, SIGNAL( newAvatar( QString ) ), SLOT( onNewAvatar( QString ) ) );
|
||||
}
|
||||
|
||||
|
||||
AvatarManager::~AvatarManager()
|
||||
{
|
||||
}
|
||||
|
||||
void AvatarManager::onNewConnection()
|
||||
|
||||
void
|
||||
AvatarManager::onNewConnection()
|
||||
{
|
||||
fetchVCard( m_client->jid().bare() );
|
||||
}
|
||||
|
||||
|
||||
void AvatarManager::fetchVCard(const QString &jid)
|
||||
void
|
||||
AvatarManager::fetchVCard( const QString& jid )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
Jreen::IQ iq( Jreen::IQ::Get, jid );
|
||||
iq.addExtension( new Jreen::VCard() );
|
||||
Jreen::IQReply *reply = m_client->send( iq );
|
||||
|
||||
Jreen::IQ iq(Jreen::IQ::Get, jid );
|
||||
iq.addExtension(new Jreen::VCard());
|
||||
Jreen::IQReply *reply = m_client->send(iq);
|
||||
connect(reply, SIGNAL(received(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ)));
|
||||
connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
}
|
||||
|
||||
void AvatarManager::onNewPresence(const Jreen::Presence& presence)
|
||||
|
||||
void
|
||||
AvatarManager::onNewPresence( const Jreen::Presence& presence )
|
||||
{
|
||||
Jreen::VCardUpdate::Ptr update = presence.payload<Jreen::VCardUpdate>();
|
||||
if(update)
|
||||
if ( update )
|
||||
{
|
||||
// qDebug() << "vcard: found update for" << presence.from().full();
|
||||
if(!isCached(update->photoHash()))
|
||||
if ( !isCached( update->photoHash() ) )
|
||||
{
|
||||
// qDebug() << presence.from().full() << "vcard: photo not cached, starting request..." << update->photoHash();
|
||||
fetchVCard( presence.from().bare() );
|
||||
@ -84,78 +88,72 @@ void AvatarManager::onNewPresence(const Jreen::Presence& presence)
|
||||
m_JidsAvatarHashes.insert( update->photoHash(), presence.from().bare() );
|
||||
|
||||
if ( !this->avatar( presence.from().bare() ).isNull() )
|
||||
emit newAvatar(presence.from().bare());
|
||||
emit newAvatar( presence.from().bare() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << presence.from().full() << "got no statusupdateextension";
|
||||
|
||||
//TODO: do we want this? might fetch avatars for broken clients
|
||||
fetchVCard( presence.from().bare() );
|
||||
}
|
||||
}
|
||||
|
||||
void AvatarManager::onNewIq(const Jreen::IQ& iq)
|
||||
|
||||
void
|
||||
AvatarManager::onNewIq( const Jreen::IQ& iq )
|
||||
{
|
||||
Jreen::VCard::Ptr vcard = iq.payload<Jreen::VCard>();
|
||||
if(vcard)
|
||||
if ( vcard )
|
||||
{
|
||||
iq.accept();
|
||||
|
||||
// qDebug() << Q_FUNC_INFO << "Got vcard from " << iq.from().full();
|
||||
|
||||
QString id = iq.from().full();
|
||||
QString avatarHash;
|
||||
|
||||
const Jreen::VCard::Photo &photo = vcard->photo();
|
||||
if (!photo.data().isEmpty()) {
|
||||
if ( !photo.data().isEmpty() )
|
||||
{
|
||||
// qDebug() << "vcard: got photo data" << id;
|
||||
|
||||
avatarHash = QCryptographicHash::hash(photo.data(), QCryptographicHash::Sha1).toHex();
|
||||
avatarHash = QCryptographicHash::hash( photo.data(), QCryptographicHash::Sha1 ).toHex();
|
||||
|
||||
if (!m_cacheDir.exists())
|
||||
if ( !m_cacheDir.exists() )
|
||||
m_cacheDir.mkpath( avatarDir( avatarHash ).absolutePath() );
|
||||
|
||||
|
||||
QFile file(avatarPath(avatarHash));
|
||||
if (file.open(QIODevice::WriteOnly)) {
|
||||
file.write(photo.data());
|
||||
QFile file( avatarPath( avatarHash ) );
|
||||
if ( file.open( QIODevice::WriteOnly ) )
|
||||
{
|
||||
file.write( photo.data() );
|
||||
file.close();
|
||||
}
|
||||
|
||||
m_cachedAvatars.append(avatarHash);
|
||||
m_cachedAvatars.append( avatarHash );
|
||||
m_JidsAvatarHashes.insert( avatarHash, iq.from().bare() );
|
||||
|
||||
Q_ASSERT(!this->avatar(iq.from().bare()).isNull());
|
||||
emit newAvatar(iq.from().bare());
|
||||
}
|
||||
else
|
||||
{
|
||||
// qDebug() << "vcard: got no photo data" << id;
|
||||
Q_ASSERT( !this->avatar( iq.from().bare() ).isNull() );
|
||||
emit newAvatar( iq.from().bare() );
|
||||
}
|
||||
|
||||
// got own presence
|
||||
if ( m_client->jid().bare() == id )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << "got own vcard";
|
||||
|
||||
Jreen::Presence presence = m_client->presence();
|
||||
Jreen::VCardUpdate::Ptr update = presence.payload<Jreen::VCardUpdate>();
|
||||
if (update->photoHash() != avatarHash)
|
||||
if ( update->photoHash() != avatarHash )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << "Updating own presence...";
|
||||
|
||||
update->setPhotoHash(avatarHash);
|
||||
m_client->send(presence);
|
||||
update->setPhotoHash( avatarHash );
|
||||
m_client->send( presence );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPixmap AvatarManager::avatar(const QString &jid) const
|
||||
|
||||
QPixmap
|
||||
AvatarManager::avatar( const QString& jid ) const
|
||||
{
|
||||
if( isCached( avatarHash( jid ) ) )
|
||||
if ( isCached( avatarHash( jid ) ) )
|
||||
{
|
||||
return QPixmap( avatarPath( avatarHash( jid ) ) );
|
||||
}
|
||||
@ -165,29 +163,39 @@ QPixmap AvatarManager::avatar(const QString &jid) const
|
||||
}
|
||||
}
|
||||
|
||||
QString AvatarManager::avatarHash(const QString &jid) const
|
||||
|
||||
QString
|
||||
AvatarManager::avatarHash( const QString& jid ) const
|
||||
{
|
||||
//qDebug() << Q_FUNC_INFO << jid << m_JidsAvatarHashes.key(jid);
|
||||
return m_JidsAvatarHashes.key(jid);
|
||||
//qDebug() << Q_FUNC_INFO << jid << m_JidsAvatarHashes.key( jid );
|
||||
return m_JidsAvatarHashes.key( jid );
|
||||
}
|
||||
|
||||
QDir AvatarManager::avatarDir(const QString&) const
|
||||
|
||||
QDir
|
||||
AvatarManager::avatarDir( const QString& /* avatarHash */ ) const
|
||||
{
|
||||
return m_cacheDir;
|
||||
}
|
||||
|
||||
QString AvatarManager::avatarPath(const QString &avatarHash) const
|
||||
|
||||
QString
|
||||
AvatarManager::avatarPath( const QString& avatarHash ) const
|
||||
{
|
||||
Q_ASSERT(!avatarHash.contains("@"));
|
||||
return avatarDir(avatarHash).absoluteFilePath(avatarHash);
|
||||
Q_ASSERT( !avatarHash.contains( "@" ) );
|
||||
return avatarDir( avatarHash ).absoluteFilePath( avatarHash );
|
||||
}
|
||||
|
||||
bool AvatarManager::isCached(const QString &avatarHash) const
|
||||
|
||||
bool
|
||||
AvatarManager::isCached( const QString& avatarHash ) const
|
||||
{
|
||||
return m_cachedAvatars.contains( avatarHash );
|
||||
}
|
||||
|
||||
void AvatarManager::onNewAvatar(const QString&)
|
||||
|
||||
void
|
||||
AvatarManager::onNewAvatar( const QString& /* jid */ )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << "Found new Avatar..." << jid;
|
||||
}
|
||||
|
@ -32,32 +32,32 @@ class ACCOUNTDLLEXPORT AvatarManager : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AvatarManager(Jreen::Client *client);
|
||||
AvatarManager(Jreen::Client* client);
|
||||
virtual ~AvatarManager();
|
||||
|
||||
QPixmap avatar(const QString &jid) const;
|
||||
QPixmap avatar(const QString& jid) const;
|
||||
|
||||
signals:
|
||||
void newAvatar( const QString &jid );
|
||||
void newAvatar( const QString& jid );
|
||||
|
||||
private slots:
|
||||
void onNewPresence( const Jreen::Presence& presence );
|
||||
void onNewIq(const Jreen::IQ &iq);
|
||||
void onNewIq(const Jreen::IQ& iq);
|
||||
void onNewConnection();
|
||||
void onNewAvatar( const QString &jid );
|
||||
void onNewAvatar( const QString& jid );
|
||||
|
||||
private:
|
||||
void fetchVCard( const QString &jid);
|
||||
QString avatarHash(const QString &jid) const;
|
||||
QString avatarPath(const QString &avatarHash) const;
|
||||
void fetchVCard( const QString& jid );
|
||||
QString avatarHash( const QString& jid ) const;
|
||||
QString avatarPath( const QString& avatarHash ) const;
|
||||
|
||||
QDir avatarDir(const QString &avatarHash) const;
|
||||
bool isCached(const QString &avatarHash) const;
|
||||
QDir avatarDir( const QString& avatarHash ) const;
|
||||
bool isCached( const QString& avatarHash ) const;
|
||||
|
||||
Jreen::Client *m_client;
|
||||
Jreen::Client* m_client;
|
||||
QStringList m_cachedAvatars;
|
||||
QDir m_cacheDir;
|
||||
QMap<QString, QString> m_JidsAvatarHashes;
|
||||
QMap< QString, QString > m_JidsAvatarHashes;
|
||||
};
|
||||
|
||||
#endif // AVATARMANAGER_H
|
||||
|
@ -65,27 +65,32 @@ using namespace Accounts;
|
||||
// instead of simply copying this function for another thirdparty lib
|
||||
// please make it a meta-function or a macro and put it in Logger.h. kthxbbq
|
||||
#define JREEN_LOG_INFIX "Jreen"
|
||||
#define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" )
|
||||
#define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" )
|
||||
|
||||
|
||||
void
|
||||
JreenMessageHandler(QtMsgType type, const char *msg)
|
||||
JreenMessageHandler( QtMsgType type, const char *msg )
|
||||
{
|
||||
switch (type)
|
||||
switch ( type )
|
||||
{
|
||||
case QtDebugMsg:
|
||||
tDebug(LOGTHIRDPARTY).nospace() << JREEN_LOG_INFIX << ": " << "Debug: " << msg;
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ": " << "Debug: " << msg;
|
||||
break;
|
||||
case QtWarningMsg:
|
||||
tDebug(LOGTHIRDPARTY).nospace() << JREEN_LOG_INFIX << ": " << "Warning: " << msg;
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ": " << "Warning: " << msg;
|
||||
break;
|
||||
case QtCriticalMsg:
|
||||
tDebug(LOGTHIRDPARTY).nospace() << JREEN_LOG_INFIX << ": " << "Critical: " << msg;
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ": " << "Critical: " << msg;
|
||||
break;
|
||||
case QtFatalMsg:
|
||||
tDebug(LOGTHIRDPARTY).nospace() << JREEN_LOG_INFIX << ": " << "Fatal: " << msg;
|
||||
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ": " << "Fatal: " << msg;
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
XmppSipPlugin::XmppSipPlugin( Account *account )
|
||||
|
||||
XmppSipPlugin::XmppSipPlugin( Account* account )
|
||||
: SipPlugin( account )
|
||||
, m_state( Account::Disconnected )
|
||||
#ifndef ENABLE_HEADLESS
|
||||
@ -97,7 +102,6 @@ XmppSipPlugin::XmppSipPlugin( Account *account )
|
||||
Jreen::Logger::addHandler( JreenMessageHandler );
|
||||
|
||||
m_currentUsername = readUsername();
|
||||
|
||||
m_currentServer = readServer();
|
||||
m_currentPassword = readPassword();
|
||||
m_currentPort = readPort();
|
||||
@ -122,6 +126,7 @@ XmppSipPlugin::XmppSipPlugin( Account *account )
|
||||
m_xmlConsole->show();
|
||||
}
|
||||
#endif
|
||||
|
||||
// add VCardUpdate extension to own presence
|
||||
m_client->presence().addExtension( new Jreen::VCardUpdate() );
|
||||
|
||||
@ -148,19 +153,19 @@ XmppSipPlugin::XmppSipPlugin( Account *account )
|
||||
qDebug() << "Our Port set to" << m_client->port();
|
||||
|
||||
// setup slots
|
||||
connect(m_client, SIGNAL(serverFeaturesReceived(QSet<QString>)), SLOT(onConnect()));
|
||||
connect(m_client, SIGNAL(disconnected(Jreen::Client::DisconnectReason)), SLOT(onDisconnect(Jreen::Client::DisconnectReason)));
|
||||
connect(m_client, SIGNAL(messageReceived(Jreen::Message)), SLOT(onNewMessage(Jreen::Message)));
|
||||
connect( m_client, SIGNAL( serverFeaturesReceived( QSet<QString> ) ), SLOT( onConnect() ) );
|
||||
connect( m_client, SIGNAL( disconnected( Jreen::Client::DisconnectReason ) ), SLOT( onDisconnect( Jreen::Client::DisconnectReason ) ) );
|
||||
connect( m_client, SIGNAL( messageReceived( Jreen::Message ) ), SLOT( onNewMessage( Jreen::Message ) ) );
|
||||
|
||||
connect(m_client, SIGNAL(iqReceived(Jreen::IQ)), SLOT(onNewIq(Jreen::IQ)));
|
||||
connect( m_client, SIGNAL( iqReceived( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
|
||||
connect(m_roster, SIGNAL(presenceReceived(Jreen::RosterItem::Ptr,Jreen::Presence)),
|
||||
SLOT(onPresenceReceived(Jreen::RosterItem::Ptr,Jreen::Presence)));
|
||||
connect(m_roster, SIGNAL(subscriptionReceived(Jreen::RosterItem::Ptr,Jreen::Presence)),
|
||||
SLOT(onSubscriptionReceived(Jreen::RosterItem::Ptr,Jreen::Presence)));
|
||||
connect( m_roster, SIGNAL( presenceReceived( Jreen::RosterItem::Ptr, Jreen::Presence ) ),
|
||||
SLOT( onPresenceReceived( Jreen::RosterItem::Ptr, Jreen::Presence ) ) );
|
||||
connect( m_roster, SIGNAL( subscriptionReceived( Jreen::RosterItem::Ptr, Jreen::Presence ) ),
|
||||
SLOT( onSubscriptionReceived( Jreen::RosterItem::Ptr, Jreen::Presence ) ) );
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
connect(m_avatarManager, SIGNAL(newAvatar(QString)), SLOT(onNewAvatar(QString)));
|
||||
connect( m_avatarManager, SIGNAL( newAvatar( QString ) ), SLOT( onNewAvatar( QString ) ) );
|
||||
#endif
|
||||
|
||||
m_pubSubManager = new Jreen::PubSub::Manager( m_client );
|
||||
@ -168,15 +173,16 @@ XmppSipPlugin::XmppSipPlugin( Account *account )
|
||||
|
||||
// Clear status
|
||||
Jreen::Tune::Ptr tune( new Jreen::Tune() );
|
||||
m_pubSubManager->publishItems(QList<Jreen::Payload::Ptr>() << tune, Jreen::JID());
|
||||
|
||||
m_pubSubManager->publishItems( QList<Jreen::Payload::Ptr>() << tune, Jreen::JID() );
|
||||
}
|
||||
|
||||
|
||||
XmppSipPlugin::~XmppSipPlugin()
|
||||
{
|
||||
//Note: the next two lines don't currently work, because the deletion wipes out internally posted events, need to talk to euro about a fix
|
||||
Jreen::Tune::Ptr tune( new Jreen::Tune() );
|
||||
m_pubSubManager->publishItems(QList<Jreen::Payload::Ptr>() << tune, Jreen::JID());
|
||||
m_pubSubManager->publishItems( QList<Jreen::Payload::Ptr>() << tune, Jreen::JID() );
|
||||
|
||||
delete m_pubSubManager;
|
||||
delete m_avatarManager;
|
||||
delete m_roster;
|
||||
@ -205,21 +211,20 @@ XmppSipPlugin::menu()
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
XmppSipPlugin::connectPlugin()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
if( m_client->isConnected() )
|
||||
if ( m_client->isConnected() )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << "Already connected to server, not connecting again...";
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_account->configuration().contains("enforcesecure") && m_account->configuration().value("enforcesecure").toBool() )
|
||||
if ( m_account->configuration().contains( "enforcesecure" ) && m_account->configuration().value( "enforcesecure" ).toBool() )
|
||||
{
|
||||
tLog() << Q_FUNC_INFO << "Enforcing secure connection...";
|
||||
m_client->setFeatureConfig(Jreen::Client::Encryption, Jreen::Client::Force);
|
||||
m_client->setFeatureConfig( Jreen::Client::Encryption, Jreen::Client::Force );
|
||||
}
|
||||
|
||||
tDebug() << "Connecting to the Xmpp server..." << m_client->jid().full();
|
||||
@ -228,18 +233,17 @@ XmppSipPlugin::connectPlugin()
|
||||
QTimer::singleShot( 1000, m_client, SLOT( connectToServer() ) );
|
||||
|
||||
if ( m_client->connection() )
|
||||
connect(m_client->connection(), SIGNAL(error(Jreen::Connection::SocketError)), SLOT(onError(Jreen::Connection::SocketError)));
|
||||
connect( m_client->connection(), SIGNAL( error( Jreen::Connection::SocketError ) ), SLOT( onError( Jreen::Connection::SocketError ) ) );
|
||||
|
||||
m_state = Account::Connecting;
|
||||
emit stateChanged( m_state );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XmppSipPlugin::disconnectPlugin()
|
||||
{
|
||||
if (!m_client->isConnected())
|
||||
if ( !m_client->isConnected() )
|
||||
{
|
||||
if ( m_state != Account::Disconnected ) // might be Connecting
|
||||
{
|
||||
@ -267,8 +271,6 @@ XmppSipPlugin::disconnectPlugin()
|
||||
void
|
||||
XmppSipPlugin::onConnect()
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO;
|
||||
|
||||
// update jid resource, servers like gtalk use resource binding and may
|
||||
// have changed our requested /resource
|
||||
if ( m_client->jid().resource() != m_currentResource )
|
||||
@ -277,15 +279,9 @@ XmppSipPlugin::onConnect()
|
||||
emit jidChanged( m_client->jid().full() );
|
||||
}
|
||||
|
||||
qDebug() << "Connected to xmpp as:" << m_client->jid().full();
|
||||
|
||||
// set presence to least valid value
|
||||
m_client->setPresence(Jreen::Presence::XA, "Got Tomahawk? http://gettomahawk.com", -127);
|
||||
|
||||
// set ping timeout to 15 secs (TODO: verify if this works)
|
||||
m_client->setPingInterval(1000);
|
||||
|
||||
// load roster
|
||||
m_client->setPresence( Jreen::Presence::XA, "Got Tomahawk? http://gettomahawk.com", -127 );
|
||||
m_client->setPingInterval( 1000 );
|
||||
m_roster->load();
|
||||
|
||||
// load XmppInfoPlugin
|
||||
@ -298,7 +294,7 @@ XmppSipPlugin::onConnect()
|
||||
//FIXME: this implementation is totally broken atm, so it's disabled to avoid harm :P
|
||||
// join MUC with bare jid as nickname
|
||||
//TODO: make the room a list of rooms and make that configurable
|
||||
QString mucNickname = QString( "tomahawk@conference.qutim.org/" ).append( QString( m_client->jid().bare() ).replace( "@", "-" ) );
|
||||
// QString mucNickname = QString( "tomahawk@conference.qutim.org/" ).append( QString( m_client->jid().bare() ).replace( "@", "-" ) );
|
||||
//m_room = new Jreen::MUCRoom(m_client, Jreen::JID( mucNickname ) );
|
||||
//m_room->setHistorySeconds(0);
|
||||
//m_room->join();
|
||||
@ -317,8 +313,6 @@ XmppSipPlugin::onConnect()
|
||||
void
|
||||
XmppSipPlugin::onDisconnect( Jreen::Client::DisconnectReason reason )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
switch( reason )
|
||||
{
|
||||
case Jreen::Client::User:
|
||||
@ -345,7 +339,7 @@ XmppSipPlugin::onDisconnect( Jreen::Client::DisconnectReason reason )
|
||||
|
||||
default:
|
||||
qDebug() << "Not all Client::DisconnectReasons checked" << ( int ) reason;
|
||||
Q_ASSERT(false);
|
||||
Q_ASSERT( false );
|
||||
break;
|
||||
}
|
||||
m_state = Account::Disconnected;
|
||||
@ -353,9 +347,9 @@ XmppSipPlugin::onDisconnect( Jreen::Client::DisconnectReason reason )
|
||||
|
||||
removeMenuHelper();
|
||||
|
||||
Q_FOREACH(const Jreen::JID &peer, m_peers.keys())
|
||||
Q_FOREACH( const Jreen::JID &peer, m_peers.keys() )
|
||||
{
|
||||
handlePeerStatus(peer, Jreen::Presence::Unavailable);
|
||||
handlePeerStatus( peer, Jreen::Presence::Unavailable );
|
||||
}
|
||||
|
||||
if ( !m_infoPlugin.isNull() )
|
||||
@ -376,56 +370,51 @@ XmppSipPlugin::errorMessage( Jreen::Client::DisconnectReason reason )
|
||||
switch( reason )
|
||||
{
|
||||
case Jreen::Client::User:
|
||||
return tr("User Interaction");
|
||||
return tr( "User Interaction" );
|
||||
break;
|
||||
case Jreen::Client::HostUnknown:
|
||||
return tr("Host is unknown");
|
||||
return tr( "Host is unknown" );
|
||||
break;
|
||||
case Jreen::Client::ItemNotFound:
|
||||
return tr("Item not found");
|
||||
return tr( "Item not found" );
|
||||
break;
|
||||
case Jreen::Client::AuthorizationError:
|
||||
return tr("Authorization Error");
|
||||
return tr( "Authorization Error" );
|
||||
break;
|
||||
case Jreen::Client::RemoteStreamError:
|
||||
return tr("Remote Stream Error");
|
||||
return tr( "Remote Stream Error" );
|
||||
break;
|
||||
case Jreen::Client::RemoteConnectionFailed:
|
||||
return tr("Remote Connection failed");
|
||||
return tr( "Remote Connection failed" );
|
||||
break;
|
||||
case Jreen::Client::InternalServerError:
|
||||
return tr("Internal Server Error");
|
||||
return tr( "Internal Server Error" );
|
||||
break;
|
||||
case Jreen::Client::SystemShutdown:
|
||||
return tr("System shutdown");
|
||||
return tr( "System shutdown" );
|
||||
break;
|
||||
case Jreen::Client::Conflict:
|
||||
return tr("Conflict");
|
||||
return tr( "Conflict" );
|
||||
break;
|
||||
|
||||
case Jreen::Client::Unknown:
|
||||
return tr("Unknown");
|
||||
break;
|
||||
|
||||
case Jreen::Client::NoCompressionSupport:
|
||||
return tr("No Compression Support");
|
||||
return tr( "No Compression Support" );
|
||||
break;
|
||||
|
||||
case Jreen::Client::NoEncryptionSupport:
|
||||
return tr("No Encryption Support");
|
||||
return tr( "No Encryption Support" );
|
||||
break;
|
||||
|
||||
case Jreen::Client::NoAuthorizationSupport:
|
||||
return tr("No Authorization Support");
|
||||
return tr( "No Authorization Support" );
|
||||
break;
|
||||
|
||||
case Jreen::Client::NoSupportedFeature:
|
||||
return tr("No Supported Feature");
|
||||
return tr( "No Supported Feature" );
|
||||
break;
|
||||
case Jreen::Client::Unknown:
|
||||
return tr( "Unknown" );
|
||||
break;
|
||||
|
||||
default:
|
||||
qDebug() << "Not all Client::DisconnectReasons checked";
|
||||
Q_ASSERT(false);
|
||||
Q_ASSERT( false );
|
||||
break;
|
||||
}
|
||||
|
||||
@ -441,9 +430,8 @@ XmppSipPlugin::sendMsg( const QString& to, const QString& msg )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << to << msg;
|
||||
|
||||
if ( !m_client ) {
|
||||
if ( !m_client )
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
* Obsolete this by a SipMessage class
|
||||
@ -451,29 +439,24 @@ XmppSipPlugin::sendMsg( const QString& to, const QString& msg )
|
||||
QJson::Parser parser;
|
||||
bool ok;
|
||||
QVariant v = parser.parse( msg.toAscii(), &ok );
|
||||
if ( !ok || v.type() != QVariant::Map )
|
||||
if ( !ok || v.type() != QVariant::Map )
|
||||
{
|
||||
qDebug() << "Invalid JSON in Xmpp msg";
|
||||
return;
|
||||
}
|
||||
|
||||
QVariantMap m = v.toMap();
|
||||
/*******************************************************/
|
||||
|
||||
TomahawkXmppMessage *sipMessage;
|
||||
if(m["visible"].toBool())
|
||||
if ( m["visible"].toBool() )
|
||||
{
|
||||
sipMessage = new TomahawkXmppMessage( m["ip"].toString(),
|
||||
m["port"].toInt(),
|
||||
m["uniqname"].toString(),
|
||||
m["key"].toString()
|
||||
);
|
||||
sipMessage = new TomahawkXmppMessage( m["ip"].toString(), m["port"].toInt(), m["uniqname"].toString(), m["key"].toString() );
|
||||
}
|
||||
else
|
||||
{
|
||||
sipMessage = new TomahawkXmppMessage();
|
||||
}
|
||||
|
||||
qDebug() << "Send sip messsage to " << to;
|
||||
qDebug() << "Send sip messsage to" << to;
|
||||
Jreen::IQ iq( Jreen::IQ::Set, to );
|
||||
iq.addExtension( sipMessage );
|
||||
Jreen::IQReply *reply = m_client->send( iq );
|
||||
@ -485,12 +468,10 @@ XmppSipPlugin::sendMsg( const QString& to, const QString& msg )
|
||||
void
|
||||
XmppSipPlugin::broadcastMsg( const QString& msg )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
if ( !m_client )
|
||||
return;
|
||||
|
||||
foreach( const Jreen::JID& jid, m_peers.keys() )
|
||||
foreach ( const Jreen::JID& jid, m_peers.keys() )
|
||||
{
|
||||
sendMsg( jid.full(), msg );
|
||||
}
|
||||
@ -501,14 +482,11 @@ void
|
||||
XmppSipPlugin::addContact( const QString& jid, const QString& msg )
|
||||
{
|
||||
// Add contact to the Tomahawk group on the roster
|
||||
|
||||
QString realJid = jid;
|
||||
if( !realJid.contains( '@' ) )
|
||||
if ( !realJid.contains( '@' ) )
|
||||
realJid += defaultSuffix();
|
||||
|
||||
m_roster->subscribe( realJid, msg, realJid, QStringList() << "Tomahawk" );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -532,24 +510,24 @@ XmppSipPlugin::showAddFriendDialog()
|
||||
void
|
||||
XmppSipPlugin::publishTune( const QUrl& url, const InfoSystem::InfoStringHash& trackInfo )
|
||||
{
|
||||
if( m_account->configuration().value("publishtracks").toBool() == false )
|
||||
if ( m_account->configuration().value("publishtracks").toBool() == false )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << m_client->jid().full() << "Not publishing now playing info (disabled in account config)";
|
||||
tDebug() << Q_FUNC_INFO << m_client->jid().full() << "Not publishing now playing info (disabled in account config)";
|
||||
return;
|
||||
}
|
||||
|
||||
if ( trackInfo.isEmpty() )
|
||||
{
|
||||
Jreen::Tune::Ptr tune( new Jreen::Tune() );
|
||||
m_pubSubManager->publishItems(QList<Jreen::Payload::Ptr>() << tune, Jreen::JID());
|
||||
m_pubSubManager->publishItems( QList<Jreen::Payload::Ptr>() << tune, Jreen::JID() );
|
||||
}
|
||||
|
||||
Jreen::Tune::Ptr tune( new Jreen::Tune() );
|
||||
|
||||
tune->setTitle( trackInfo.value( "title" ) );
|
||||
tune->setArtist( trackInfo.value( "artist" ) );
|
||||
tune->setLength( trackInfo.value("duration").toInt() );
|
||||
tune->setTrack( trackInfo.value("albumpos") );
|
||||
tune->setLength( trackInfo.value( "duration" ).toInt() );
|
||||
tune->setTrack( trackInfo.value( "albumpos" ) );
|
||||
|
||||
//TODO: provide a rating once available in Tomahawk
|
||||
tune->setRating( 10 );
|
||||
@ -558,7 +536,7 @@ XmppSipPlugin::publishTune( const QUrl& url, const InfoSystem::InfoStringHash& t
|
||||
tune->setSource( "Tomahawk" );
|
||||
|
||||
tune->setUri( url );
|
||||
tDebug() << Q_FUNC_INFO << "Setting URI of " << tune->uri().toString();
|
||||
tDebug() << Q_FUNC_INFO << "Setting URI of" << tune->uri().toString();
|
||||
|
||||
m_pubSubManager->publishItems( QList<Jreen::Payload::Ptr>() << tune, Jreen::JID() );
|
||||
}
|
||||
@ -642,13 +620,15 @@ XmppSipPlugin::configurationChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void XmppSipPlugin::setupClientHelper()
|
||||
|
||||
void
|
||||
XmppSipPlugin::setupClientHelper()
|
||||
{
|
||||
Jreen::JID jid = Jreen::JID( m_currentUsername );
|
||||
m_client->setJID( jid );
|
||||
m_client->setPassword( m_currentPassword );
|
||||
|
||||
if( !m_currentServer.isEmpty() )
|
||||
if ( !m_currentServer.isEmpty() )
|
||||
{
|
||||
// set explicit server details
|
||||
m_client->setServer( m_currentServer );
|
||||
@ -662,20 +642,22 @@ void XmppSipPlugin::setupClientHelper()
|
||||
}
|
||||
}
|
||||
|
||||
void XmppSipPlugin::addMenuHelper()
|
||||
|
||||
void
|
||||
XmppSipPlugin::addMenuHelper()
|
||||
{
|
||||
#ifndef ENABLE_HEADLESS
|
||||
if( !m_menu )
|
||||
if ( !m_menu )
|
||||
{
|
||||
m_menu = new QMenu( QString( "%1 (" ).arg( friendlyName() ).append( readUsername() ).append(")" ) );
|
||||
|
||||
QAction* addFriendAction = m_menu->addAction( tr( "Add Friend..." ) );
|
||||
connect( addFriendAction, SIGNAL( triggered() ), this, SLOT( showAddFriendDialog() ) );
|
||||
connect( addFriendAction, SIGNAL( triggered() ), SLOT( showAddFriendDialog() ) );
|
||||
|
||||
if( readXmlConsoleEnabled() )
|
||||
if ( readXmlConsoleEnabled() )
|
||||
{
|
||||
QAction* showXmlConsoleAction = m_menu->addAction( tr( "XML Console...") );
|
||||
connect( showXmlConsoleAction, SIGNAL( triggered() ), this, SLOT( showXmlConsole() ) );
|
||||
QAction* showXmlConsoleAction = m_menu->addAction( tr( "XML Console..." ) );
|
||||
connect( showXmlConsoleAction, SIGNAL( triggered() ), SLOT( showXmlConsole() ) );
|
||||
}
|
||||
|
||||
emit addMenu( m_menu );
|
||||
@ -683,10 +665,12 @@ void XmppSipPlugin::addMenuHelper()
|
||||
#endif
|
||||
}
|
||||
|
||||
void XmppSipPlugin::removeMenuHelper()
|
||||
|
||||
void
|
||||
XmppSipPlugin::removeMenuHelper()
|
||||
{
|
||||
#ifndef ENABLE_HEADLESS
|
||||
if( m_menu )
|
||||
if ( m_menu )
|
||||
{
|
||||
emit removeMenu( m_menu );
|
||||
|
||||
@ -697,37 +681,35 @@ void XmppSipPlugin::removeMenuHelper()
|
||||
}
|
||||
|
||||
|
||||
void XmppSipPlugin::onNewMessage( const Jreen::Message& message )
|
||||
void
|
||||
XmppSipPlugin::onNewMessage( const Jreen::Message& message )
|
||||
{
|
||||
if ( m_state != Account::Connected )
|
||||
return;
|
||||
|
||||
// qDebug() << Q_FUNC_INFO << "message type" << message.subtype();
|
||||
|
||||
QString from = message.from().full();
|
||||
QString msg = message.body();
|
||||
|
||||
if(msg.isEmpty())
|
||||
if ( msg.isEmpty() )
|
||||
return;
|
||||
|
||||
if( message.subtype() == Jreen::Message::Error )
|
||||
if ( message.subtype() == Jreen::Message::Error )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << "Received error message from " << from << ", not answering... (Condition: "
|
||||
tDebug() << Q_FUNC_INFO << "Received error message from" << from << ", not answering... (Condition:"
|
||||
<< ( message.error().isNull() ? -1 : message.error()->condition() ) << ")";
|
||||
return;
|
||||
}
|
||||
|
||||
SipInfo info = SipInfo::fromJson( msg );
|
||||
|
||||
if ( !info.isValid() )
|
||||
{
|
||||
QString to = from;
|
||||
QString response = QString( tr("I'm sorry -- I'm just an automatic presence used by Tomahawk Player"
|
||||
" (http://gettomahawk.com). If you are getting this message, the person you"
|
||||
" are trying to reach is probably not signed on, so please try again later!") );
|
||||
QString response = QString( tr( "I'm sorry -- I'm just an automatic presence used by Tomahawk Player"
|
||||
" (http://gettomahawk.com). If you are getting this message, the person you"
|
||||
" are trying to reach is probably not signed on, so please try again later!" ) );
|
||||
|
||||
// this is not a sip message, so we send it directly through the client
|
||||
m_client->send( Jreen::Message ( Jreen::Message::Error, Jreen::JID(to), response) );
|
||||
m_client->send( Jreen::Message ( Jreen::Message::Error, Jreen::JID( to ), response) );
|
||||
|
||||
emit msgReceived( from, msg );
|
||||
return;
|
||||
@ -738,7 +720,8 @@ void XmppSipPlugin::onNewMessage( const Jreen::Message& message )
|
||||
}
|
||||
|
||||
|
||||
void XmppSipPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence )
|
||||
void
|
||||
XmppSipPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence )
|
||||
{
|
||||
Q_UNUSED(item);
|
||||
if ( m_state != Account::Connected )
|
||||
@ -749,19 +732,20 @@ void XmppSipPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, cons
|
||||
|
||||
qDebug() << Q_FUNC_INFO << "* New presence:" << fulljid << presence.subtype();
|
||||
|
||||
if( jid == m_client->jid() )
|
||||
if ( jid == m_client->jid() )
|
||||
return;
|
||||
|
||||
if ( presence.error() ) {
|
||||
if ( presence.error() )
|
||||
{
|
||||
//qDebug() << Q_FUNC_INFO << fulljid << "Running tomahawk: no" << "presence error";
|
||||
return;
|
||||
}
|
||||
|
||||
// ignore anyone not Running tomahawk:
|
||||
Jreen::Capabilities::Ptr caps = presence.payload<Jreen::Capabilities>();
|
||||
if( caps )
|
||||
if ( caps )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << fulljid << "Running tomahawk: maybe" << "caps " << caps->node() << "requesting disco...";
|
||||
qDebug() << Q_FUNC_INFO << fulljid << "Running tomahawk: maybe" << "caps" << caps->node() << "requesting disco...";
|
||||
|
||||
// request disco features
|
||||
QString node = caps->node() + '#' + caps->ver();
|
||||
@ -773,7 +757,7 @@ void XmppSipPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, cons
|
||||
reply->setData( RequestDisco );
|
||||
connect( reply, SIGNAL( received( Jreen::IQ ) ), SLOT( onNewIq( Jreen::IQ ) ) );
|
||||
}
|
||||
else if( !caps )
|
||||
else if ( !caps )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << "Running tomahawk: no" << "no caps";
|
||||
if ( presenceMeansOnline( m_peers[ jid ] ) )
|
||||
@ -782,46 +766,40 @@ void XmppSipPlugin::onPresenceReceived( const Jreen::RosterItem::Ptr &item, cons
|
||||
}
|
||||
|
||||
|
||||
void XmppSipPlugin::onSubscriptionReceived( const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence )
|
||||
void
|
||||
XmppSipPlugin::onSubscriptionReceived( const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence )
|
||||
{
|
||||
if ( m_state != Account::Connected )
|
||||
return;
|
||||
|
||||
// qDebug() << Q_FUNC_INFO << "presence type:" << presence.subtype();
|
||||
if(item)
|
||||
if ( item )
|
||||
qDebug() << Q_FUNC_INFO << presence.from().full() << "subs" << item->subscription() << "ask" << item->ask();
|
||||
else
|
||||
qDebug() << Q_FUNC_INFO << "item empty";
|
||||
|
||||
// don't do anything if the contact is already subscribed to us
|
||||
if( presence.subtype() != Jreen::Presence::Subscribe ||
|
||||
(
|
||||
item && (item->subscription() == Jreen::RosterItem::From || item->subscription() == Jreen::RosterItem::Both)
|
||||
)
|
||||
)
|
||||
if ( presence.subtype() != Jreen::Presence::Subscribe ||
|
||||
( item && (item->subscription() == Jreen::RosterItem::From || item->subscription() == Jreen::RosterItem::Both ) ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// check if the requester is already on the roster
|
||||
if(item &&
|
||||
(
|
||||
item->subscription() == Jreen::RosterItem::To ||
|
||||
( item->subscription() == Jreen::RosterItem::None && !item->ask().isEmpty() )
|
||||
)
|
||||
)
|
||||
if ( item &&
|
||||
( item->subscription() == Jreen::RosterItem::To || ( item->subscription() == Jreen::RosterItem::None && !item->ask().isEmpty() ) ) )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << presence.from().bare() << "already on the roster so we assume ack'ing subscription request is okay...";
|
||||
m_roster->allowSubscription(presence.from(), true);
|
||||
m_roster->allowSubscription( presence.from(), true );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
// preparing the confirm box for the user
|
||||
QMessageBox *confirmBox = new QMessageBox(
|
||||
QMessageBox::Question,
|
||||
tr( "Authorize User" ),
|
||||
QString( tr( "Do you want to grant <b>%1</b> access to your Collection?" ) ).arg(presence.from().bare()),
|
||||
QString( tr( "Do you want to grant <b>%1</b> access to your Collection?" ) ).arg( presence.from().bare() ),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
TomahawkUtils::tomahawkWindow()
|
||||
);
|
||||
@ -857,11 +835,10 @@ XmppSipPlugin::onSubscriptionRequestConfirmed( int result )
|
||||
sender()->deleteLater();
|
||||
|
||||
QMessageBox::StandardButton allowSubscription = static_cast< QMessageBox::StandardButton >( result );
|
||||
|
||||
if ( allowSubscription == QMessageBox::Yes )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << jid.bare() << "accepted by user, adding to roster";
|
||||
addContact(jid, "");
|
||||
addContact( jid, "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -873,7 +850,8 @@ XmppSipPlugin::onSubscriptionRequestConfirmed( int result )
|
||||
}
|
||||
|
||||
|
||||
void XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
|
||||
void
|
||||
XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
|
||||
{
|
||||
if ( m_state != Account::Connected )
|
||||
return;
|
||||
@ -887,10 +865,9 @@ void XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
|
||||
Jreen::Disco::Info *discoInfo = iq.payload< Jreen::Disco::Info >().data();
|
||||
if ( !discoInfo )
|
||||
return;
|
||||
|
||||
iq.accept();
|
||||
|
||||
Jreen::JID jid = iq.from();
|
||||
|
||||
Jreen::DataForm::Ptr form = discoInfo->form();
|
||||
|
||||
if ( discoInfo->features().contains( TOMAHAWK_FEATURE ) )
|
||||
@ -906,8 +883,8 @@ void XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
|
||||
Jreen::SoftwareVersion::Ptr softwareVersion = iq.payload<Jreen::SoftwareVersion>();
|
||||
if ( softwareVersion )
|
||||
{
|
||||
QString versionString = QString("%1 %2 %3").arg( softwareVersion->name(), softwareVersion->os(), softwareVersion->version() );
|
||||
qDebug() << Q_FUNC_INFO << "Received software version for " << iq.from().full() << ":" << versionString;
|
||||
QString versionString = QString( "%1 %2 %3" ).arg( softwareVersion->name(), softwareVersion->os(), softwareVersion->version() );
|
||||
qDebug() << Q_FUNC_INFO << "Received software version for" << iq.from().full() << ":" << versionString;
|
||||
emit softwareVersionReceived( iq.from().full(), versionString );
|
||||
}
|
||||
}
|
||||
@ -935,9 +912,8 @@ void XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
|
||||
|
||||
SipInfo info;
|
||||
info.setVisible( sipMessage->visible() );
|
||||
if( sipMessage->visible() )
|
||||
if ( sipMessage->visible() )
|
||||
{
|
||||
|
||||
QHostInfo hi;
|
||||
hi.setHostName( sipMessage->ip() );
|
||||
info.setHost( hi );
|
||||
@ -955,7 +931,8 @@ void XmppSipPlugin::onNewIq( const Jreen::IQ& iq )
|
||||
}
|
||||
|
||||
|
||||
bool XmppSipPlugin::presenceMeansOnline( Jreen::Presence::Type p )
|
||||
bool
|
||||
XmppSipPlugin::presenceMeansOnline( Jreen::Presence::Type p )
|
||||
{
|
||||
switch( p )
|
||||
{
|
||||
@ -964,22 +941,21 @@ bool XmppSipPlugin::presenceMeansOnline( Jreen::Presence::Type p )
|
||||
case Jreen::Presence::Error:
|
||||
return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type presenceType )
|
||||
void
|
||||
XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type presenceType )
|
||||
{
|
||||
QString fulljid = jid.full();
|
||||
|
||||
// "going offline" event
|
||||
if ( !presenceMeansOnline( presenceType ) &&
|
||||
( !m_peers.contains( jid ) ||
|
||||
presenceMeansOnline( m_peers.value( jid ) )
|
||||
)
|
||||
)
|
||||
( !m_peers.contains( jid ) || presenceMeansOnline( m_peers.value( jid ) ) ) )
|
||||
{
|
||||
m_peers[ jid ] = presenceType;
|
||||
qDebug() << Q_FUNC_INFO << "* Peer goes offline:" << fulljid;
|
||||
@ -990,10 +966,7 @@ void XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Ty
|
||||
|
||||
// "coming online" event
|
||||
if ( presenceMeansOnline( presenceType ) &&
|
||||
( !m_peers.contains( jid ) ||
|
||||
!presenceMeansOnline( m_peers.value( jid ) )
|
||||
)
|
||||
)
|
||||
( !m_peers.contains( jid ) || !presenceMeansOnline( m_peers.value( jid ) ) ) )
|
||||
{
|
||||
m_peers[ jid ] = presenceType;
|
||||
qDebug() << Q_FUNC_INFO << "* Peer goes online:" << fulljid;
|
||||
@ -1020,7 +993,8 @@ void XmppSipPlugin::handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Ty
|
||||
}
|
||||
|
||||
|
||||
void XmppSipPlugin::onNewAvatar( const QString& jid )
|
||||
void
|
||||
XmppSipPlugin::onNewAvatar( const QString& jid )
|
||||
{
|
||||
#ifndef ENABLE_HEADLESS
|
||||
// qDebug() << Q_FUNC_INFO << jid;
|
||||
@ -1031,20 +1005,20 @@ void XmppSipPlugin::onNewAvatar( const QString& jid )
|
||||
|
||||
// find peers for the jid
|
||||
QList< Jreen::JID > peers = m_peers.keys();
|
||||
foreach ( const Jreen::JID &peer, peers )
|
||||
foreach ( const Jreen::JID& peer, peers )
|
||||
{
|
||||
if( peer.bare() == jid )
|
||||
if ( peer.bare() == jid )
|
||||
{
|
||||
emit avatarReceived ( peer.full(), m_avatarManager->avatar( jid ) );
|
||||
emit avatarReceived( peer.full(), m_avatarManager->avatar( jid ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( jid == m_client->jid().bare() )
|
||||
// own avatar
|
||||
emit avatarReceived ( m_avatarManager->avatar( jid ) );
|
||||
emit avatarReceived( m_avatarManager->avatar( jid ) );
|
||||
else
|
||||
// someone else's avatar
|
||||
emit avatarReceived ( jid, m_avatarManager->avatar( jid ) );
|
||||
emit avatarReceived( jid, m_avatarManager->avatar( jid ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1065,6 +1039,7 @@ XmppSipPlugin::readUsername()
|
||||
return credentials.contains( "username" ) ? credentials[ "username" ].toString() : QString();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
XmppSipPlugin::readPassword()
|
||||
{
|
||||
|
@ -48,9 +48,6 @@
|
||||
#include <QtGui/QMessageBox>
|
||||
#endif
|
||||
|
||||
#define TOMAHAWK_FEATURE QLatin1String( "tomahawk:sip:v1" )
|
||||
#define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" )
|
||||
|
||||
#include "accounts/AccountDllMacro.h"
|
||||
|
||||
#include "../XmppInfoPlugin.h"
|
||||
@ -90,10 +87,11 @@ public slots:
|
||||
virtual void checkSettings();
|
||||
virtual void configurationChanged();
|
||||
virtual void sendMsg( const QString& to, const QString& msg );
|
||||
void broadcastMsg( const QString &msg );
|
||||
virtual void addContact( const QString &jid, const QString& msg = QString() );
|
||||
virtual void addContact( const QString& jid, const QString& msg = QString() );
|
||||
|
||||
void broadcastMsg( const QString& msg );
|
||||
void showAddFriendDialog();
|
||||
void publishTune( const QUrl &url, const Tomahawk::InfoSystem::InfoStringHash &trackInfo );
|
||||
void publishTune( const QUrl& url, const Tomahawk::InfoSystem::InfoStringHash& trackInfo );
|
||||
|
||||
protected:
|
||||
virtual QString defaultSuffix() const;
|
||||
@ -103,14 +101,14 @@ private slots:
|
||||
void onConnect();
|
||||
void onDisconnect( Jreen::Client::DisconnectReason reason );
|
||||
|
||||
void onPresenceReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence );
|
||||
void onSubscriptionReceived( const Jreen::RosterItem::Ptr &item, const Jreen::Presence& presence );
|
||||
void onPresenceReceived( const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence );
|
||||
void onSubscriptionReceived( const Jreen::RosterItem::Ptr& item, const Jreen::Presence& presence );
|
||||
void onSubscriptionRequestConfirmed( int result );
|
||||
|
||||
void onNewMessage( const Jreen::Message& message );
|
||||
void onError( const Jreen::Connection::SocketError& e );
|
||||
void onNewIq( const Jreen::IQ &iq );
|
||||
void onNewAvatar( const QString &jid );
|
||||
void onNewIq( const Jreen::IQ& iq );
|
||||
void onNewAvatar( const QString& jid );
|
||||
|
||||
private:
|
||||
bool readXmlConsoleEnabled();
|
||||
@ -125,7 +123,7 @@ private:
|
||||
void removeMenuHelper();
|
||||
|
||||
bool presenceMeansOnline( Jreen::Presence::Type p );
|
||||
void handlePeerStatus( const Jreen::JID &jid, Jreen::Presence::Type presenceType );
|
||||
void handlePeerStatus( const Jreen::JID& jid, Jreen::Presence::Type presenceType );
|
||||
|
||||
QString m_currentUsername;
|
||||
QString m_currentPassword;
|
||||
@ -133,22 +131,24 @@ private:
|
||||
int m_currentPort;
|
||||
QString m_currentResource;
|
||||
|
||||
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin> m_infoPlugin;
|
||||
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_infoPlugin;
|
||||
Tomahawk::Accounts::Account::ConnectionState m_state;
|
||||
|
||||
// sort out
|
||||
Jreen::Client *m_client;
|
||||
Jreen::Client* m_client;
|
||||
|
||||
Jreen::MUCRoom* m_room;
|
||||
Jreen::SimpleRoster* m_roster;
|
||||
QHash< Jreen::JID, Jreen::Presence::Type > m_peers;
|
||||
|
||||
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;
|
||||
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;
|
||||
AvatarManager* m_avatarManager;
|
||||
Jreen::PubSub::Manager* m_pubSubManager;
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ void
|
||||
ZeroconfAccount::authenticate()
|
||||
{
|
||||
if ( !isAuthenticated() )
|
||||
static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->connectPlugin();
|
||||
sipPlugin()->connectPlugin();
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ void
|
||||
ZeroconfAccount::deauthenticate()
|
||||
{
|
||||
if ( isAuthenticated() )
|
||||
static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->disconnectPlugin();
|
||||
sipPlugin()->disconnectPlugin();
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ ZeroconfAccount::connectionState() const
|
||||
return Disconnected;
|
||||
|
||||
// TODO can we get called before sipPlugin()?
|
||||
return static_cast< ZeroconfPlugin* >( m_sipPlugin.data() )->connectionState();
|
||||
return m_sipPlugin.data()->connectionState();
|
||||
}
|
||||
|
||||
|
||||
@ -120,10 +120,10 @@ SipPlugin*
|
||||
ZeroconfAccount::sipPlugin()
|
||||
{
|
||||
if ( m_sipPlugin.isNull() )
|
||||
m_sipPlugin = QWeakPointer< SipPlugin >( new ZeroconfPlugin( this ) );
|
||||
m_sipPlugin = QWeakPointer< ZeroconfPlugin >( new ZeroconfPlugin( this ) );
|
||||
|
||||
return m_sipPlugin.data();
|
||||
}
|
||||
|
||||
|
||||
Q_EXPORT_PLUGIN2( Tomahawk::Accounts::AccountFactory, Tomahawk::Accounts::ZeroconfFactory )
|
||||
Q_EXPORT_PLUGIN2( Tomahawk::Accounts::AccountFactory, Tomahawk::Accounts::ZeroconfFactory )
|
||||
|
@ -19,6 +19,7 @@
|
||||
#ifndef ZEROCONF_ACCOUNTS_H
|
||||
#define ZEROCONF_ACCOUNTS_H
|
||||
|
||||
#include "Zeroconf.h"
|
||||
#include "accounts/Account.h"
|
||||
#include "../AccountDllMacro.h"
|
||||
|
||||
@ -71,7 +72,7 @@ public:
|
||||
QWidget* aclWidget() { return 0; }
|
||||
|
||||
private:
|
||||
QWeakPointer< SipPlugin > m_sipPlugin;
|
||||
QWeakPointer< ZeroconfPlugin > m_sipPlugin;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -77,7 +77,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-weight:600;">Sorry!</span> Tomahawk crashed. Please tell us about it! Tomahawk has created an error report for you that can help improve the stability in the future. You can now send the this report directly to the Tomahawk developers.</p></body></html></string>
|
||||
<string><html><head/><body><p><span style=" font-weight:600;">Sorry!</span> Tomahawk crashed. Please tell us about it! Tomahawk has created an error report for you that can help improve the stability in the future. You can now send this report directly to the Tomahawk developers.</p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
|
@ -9,6 +9,7 @@ list(APPEND simple_plugins
|
||||
MusixMatch
|
||||
MusicBrainz
|
||||
Rovi
|
||||
Discogs
|
||||
)
|
||||
|
||||
foreach(simple_plugin ${simple_plugins})
|
||||
|
189
src/infoplugins/generic/discogs/DiscogsPlugin.cpp
Normal file
@ -0,0 +1,189 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2012 Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "DiscogsPlugin.h"
|
||||
|
||||
#include <QNetworkReply>
|
||||
#include <QDomDocument>
|
||||
#include <QtPlugin>
|
||||
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Closure.h"
|
||||
#include <parser.h>
|
||||
|
||||
using namespace Tomahawk::InfoSystem;
|
||||
|
||||
|
||||
DiscogsPlugin::DiscogsPlugin()
|
||||
: InfoPlugin()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
m_supportedGetTypes << Tomahawk::InfoSystem::InfoAlbumSongs;
|
||||
}
|
||||
|
||||
|
||||
DiscogsPlugin::~DiscogsPlugin() {}
|
||||
|
||||
|
||||
void
|
||||
DiscogsPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||
{
|
||||
if ( !requestData.input.canConvert< Tomahawk::InfoSystem::InfoStringHash >() )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
InfoStringHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >();
|
||||
if ( !hash.contains( "artist" ) || !hash.contains( "album" ) )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
switch ( requestData.type )
|
||||
{
|
||||
case InfoAlbumSongs:
|
||||
{
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash criteria;
|
||||
criteria["artist"] = hash["artist"];
|
||||
criteria["album"] = hash["album"];
|
||||
|
||||
emit getCachedInfo( criteria, 2419200000, requestData );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
Q_ASSERT( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiscogsPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requestData )
|
||||
{
|
||||
switch ( requestData.type )
|
||||
{
|
||||
case InfoAlbumSongs:
|
||||
{
|
||||
QString requestString( "http://api.discogs.com/database/search" );
|
||||
QUrl url( requestString );
|
||||
url.addQueryItem( "type", "release" );
|
||||
url.addQueryItem( "release_title", criteria[ "album" ] );
|
||||
url.addQueryItem( "artist", criteria[ "artist" ] );
|
||||
QNetworkRequest req( url );
|
||||
req.setRawHeader( "User-Agent", "TomahawkPlayer/1.0 +http://tomahawk-player.org" );
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( req );
|
||||
|
||||
NewClosure( reply, SIGNAL( finished() ), this, SLOT( albumSearchSlot( Tomahawk::InfoSystem::InfoRequestData, QNetworkReply* ) ), requestData, reply );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
Q_ASSERT( false );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiscogsPlugin::albumSearchSlot( const InfoRequestData &requestData, QNetworkReply *reply )
|
||||
{
|
||||
QJson::Parser p;
|
||||
QVariantMap results = p.parse( reply ).toMap();
|
||||
|
||||
if ( !results.contains( "results" ) || results.value( "results" ).toList().isEmpty() )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
const QVariantMap result = results.value( "results" ).toList().first().toMap();
|
||||
if ( !result.contains( "id" ) )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
const int id = result.value( "id" ).toInt();
|
||||
QUrl url( QString( "http://api.discogs.com/release/%1" ).arg( id ) );
|
||||
QNetworkRequest req( url );
|
||||
req.setRawHeader( "User-Agent", "TomahawkPlayer/1.0 +http://tomahawk-player.org" );
|
||||
|
||||
QNetworkReply* reply2 = TomahawkUtils::nam()->get( req );
|
||||
NewClosure( reply2, SIGNAL( finished() ), this, SLOT( albumInfoSlot( Tomahawk::InfoSystem::InfoRequestData, QNetworkReply* ) ), requestData, reply2 );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiscogsPlugin::albumInfoSlot( const InfoRequestData& requestData, QNetworkReply* reply )
|
||||
{
|
||||
QJson::Parser p;
|
||||
QVariantMap results = p.parse( reply ).toMap();
|
||||
|
||||
if ( !results.contains( "resp" ) )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
const QVariantMap resp = results[ "resp" ].toMap();
|
||||
if ( !resp.contains( "release" ) )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
const QVariantMap release = resp[ "release" ].toMap();
|
||||
if ( !release.contains( "tracklist" ) || release[ "tracklist" ].toList().isEmpty() )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
|
||||
QStringList trackNameList;
|
||||
foreach ( const QVariant& v, release[ "tracklist" ].toList() )
|
||||
{
|
||||
const QVariantMap track = v.toMap();
|
||||
if ( track.contains( "title" ) )
|
||||
trackNameList << track[ "title" ].toString();
|
||||
}
|
||||
|
||||
QVariantMap returnedData;
|
||||
returnedData["tracks"] = trackNameList;
|
||||
|
||||
emit info( requestData, returnedData );
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash criteria;
|
||||
criteria["artist"] = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>()["artist"];
|
||||
criteria["album"] = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash>()["album"];
|
||||
|
||||
emit updateCache( criteria, 0, requestData.type, returnedData );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Q_EXPORT_PLUGIN2( Tomahawk::InfoSystem::InfoPlugin, Tomahawk::InfoSystem::DiscogsPlugin )
|
63
src/infoplugins/generic/discogs/DiscogsPlugin.h
Normal file
@ -0,0 +1,63 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2012 Leo Franchi <lfranchi@kde.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Tomahawk is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DISCOGS_PLUGIN_H
|
||||
#define DISCOGS_PLUGIN_H
|
||||
|
||||
#include "Typedefs.h"
|
||||
#include "infosystem/InfoSystem.h"
|
||||
#include "infosystem/InfoSystemWorker.h"
|
||||
#include "infoplugins/InfoPluginDllMacro.h"
|
||||
|
||||
class QNetworkReply;
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
||||
namespace InfoSystem
|
||||
{
|
||||
|
||||
class INFOPLUGINDLLEXPORT DiscogsPlugin : public InfoPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES( Tomahawk::InfoSystem::InfoPlugin )
|
||||
|
||||
public:
|
||||
DiscogsPlugin();
|
||||
virtual ~DiscogsPlugin();
|
||||
|
||||
protected slots:
|
||||
virtual void init() {}
|
||||
virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
|
||||
virtual void notInCacheSlot( InfoStringHash criteria, InfoRequestData requestData );
|
||||
|
||||
virtual void pushInfo( Tomahawk::InfoSystem::InfoPushData ) {}
|
||||
private slots:
|
||||
void albumSearchSlot( const Tomahawk::InfoSystem::InfoRequestData& , QNetworkReply* );
|
||||
void albumInfoSlot( const Tomahawk::InfoSystem::InfoRequestData& , QNetworkReply* );
|
||||
|
||||
private:
|
||||
bool isValidTrackData( Tomahawk::InfoSystem::InfoRequestData requestData );
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE( QNetworkReply* )
|
||||
#endif
|
@ -129,32 +129,6 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MusicBrainzPlugin::isValidTrackData( Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||
{
|
||||
if ( requestData.input.isNull() || !requestData.input.isValid() || !requestData.input.canConvert< QVariantMap >() )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
qDebug() << Q_FUNC_INFO << "Data null, invalid, or can't convert";
|
||||
return false;
|
||||
}
|
||||
QVariantMap hash = requestData.input.value< QVariantMap >();
|
||||
if ( hash[ "trackName" ].toString().isEmpty() )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
qDebug() << Q_FUNC_INFO << "Track name is empty";
|
||||
return false;
|
||||
}
|
||||
if ( hash[ "artistName" ].toString().isEmpty() )
|
||||
{
|
||||
emit info( requestData, QVariant() );
|
||||
qDebug() << Q_FUNC_INFO << "No artist name found";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MusicBrainzPlugin::artistSearchSlot()
|
||||
{
|
||||
|
@ -59,9 +59,6 @@ private slots:
|
||||
|
||||
void albumFoundSlot();
|
||||
void tracksFoundSlot();
|
||||
|
||||
private:
|
||||
bool isValidTrackData( Tomahawk::InfoSystem::InfoRequestData requestData );
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,20 @@
|
||||
|
||||
using namespace Tomahawk::InfoSystem;
|
||||
|
||||
bool newReleaseSort( const InfoStringHash& left, const InfoStringHash& right )
|
||||
{
|
||||
if ( !left.contains( "date" ) || !right.contains( "date" ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const QDate lDate = QDate::fromString( left[ "date" ], "yyyy-MM-dd" );
|
||||
const QDate rDate = QDate::fromString( right[ "date" ], "yyyy-MM-dd" );
|
||||
|
||||
return lDate > rDate;
|
||||
}
|
||||
|
||||
|
||||
NewReleasesPlugin::NewReleasesPlugin()
|
||||
: InfoPlugin()
|
||||
, m_nrFetchJobs ( 0 )
|
||||
@ -274,6 +288,7 @@ void NewReleasesPlugin::nrList()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( !albumNRs.isEmpty() )
|
||||
newreleases.insert ( tr ( "Albums" ), QVariant::fromValue< QList< Tomahawk::InfoSystem::InfoStringHash > > ( albumNRs ) );
|
||||
|
||||
@ -334,11 +349,14 @@ void NewReleasesPlugin::nrReturned()
|
||||
Tomahawk::InfoSystem::InfoStringHash pair;
|
||||
pair["artist"] = artist;
|
||||
pair["album"] = album;
|
||||
pair["date"] = date;
|
||||
newreleases.append( pair );
|
||||
}
|
||||
}
|
||||
|
||||
tDebug() << "NewReleasesPlugin:" << "\tgot " << newreleases.size() << " albums";
|
||||
qSort( newreleases.begin(), newreleases.end(), newReleaseSort );
|
||||
|
||||
// tDebug() << "NewReleasesPlugin:" << "\tgot " << newreleases.size() << " albums";
|
||||
returnedData[ "albums" ] = QVariant::fromValue< QList< Tomahawk::InfoSystem::InfoStringHash > >( newreleases );
|
||||
returnedData[ "type" ] = "albums";
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
|
||||
|
@ -26,10 +26,13 @@
|
||||
#include "TomahawkApp.h"
|
||||
#include "Source.h"
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
#include "jobview/AclJobItem.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
#endif
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "jobview/AclJobItem.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
|
||||
|
||||
ACLRegistry* ACLRegistry::s_instance = 0;
|
||||
@ -124,6 +127,7 @@ ACLRegistry::isAuthorizedUser( const QString& dbid, const QString &username, ACL
|
||||
return ACLRegistry::NotFound;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_cache.append( user );
|
||||
emit aclResult( dbid, username, user.acl );
|
||||
return user.acl;
|
||||
@ -131,6 +135,7 @@ ACLRegistry::isAuthorizedUser( const QString& dbid, const QString &username, ACL
|
||||
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
||||
void
|
||||
ACLRegistry::getUserDecision( ACLRegistry::User user, const QString &username )
|
||||
{
|
||||
@ -138,7 +143,6 @@ ACLRegistry::getUserDecision( ACLRegistry::User user, const QString &username )
|
||||
m_jobQueue.enqueue( job );
|
||||
queueNextJob();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
@ -189,6 +193,8 @@ ACLRegistry::queueNextJob()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
ACLRegistry::load()
|
||||
|
@ -86,13 +86,13 @@ public slots:
|
||||
**/
|
||||
ACLRegistry::ACL isAuthorizedUser( const QString &dbid, const QString &username, ACLRegistry::ACL globalType = ACLRegistry::NotFound, bool skipEmission = false );
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
#ifndef ENABLE_HEADLESS
|
||||
void getUserDecision( ACLRegistry::User user, const QString &username );
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
void userDecision( ACLRegistry::User user );
|
||||
void queueNextJob();
|
||||
#endif
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -82,8 +82,8 @@ Album::Album( unsigned int id, const QString& name, const Tomahawk::artist_ptr&
|
||||
, m_id( id )
|
||||
, m_name( name )
|
||||
, m_artist( artist )
|
||||
, m_infoLoaded( false )
|
||||
, m_infoLoading( false )
|
||||
, m_coverLoaded( false )
|
||||
, m_coverLoading( false )
|
||||
#ifndef ENABLE_HEADLESS
|
||||
, m_cover( 0 )
|
||||
#endif
|
||||
@ -110,19 +110,17 @@ Album::artist() const
|
||||
QPixmap
|
||||
Album::cover( const QSize& size, bool forceLoad ) const
|
||||
{
|
||||
if ( !m_infoLoaded && !m_infoLoading )
|
||||
if ( !m_coverLoaded && !m_coverLoading )
|
||||
{
|
||||
if ( !forceLoad )
|
||||
return QPixmap();
|
||||
|
||||
m_uuid = uuid();
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash trackInfo;
|
||||
trackInfo["artist"] = artist()->name();
|
||||
trackInfo["album"] = name();
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = m_uuid;
|
||||
requestData.caller = infoid();
|
||||
requestData.type = Tomahawk::InfoSystem::InfoAlbumCoverArt;
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
|
||||
requestData.customData = QVariantMap();
|
||||
@ -137,7 +135,7 @@ Album::cover( const QSize& size, bool forceLoad ) const
|
||||
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
||||
|
||||
m_infoLoading = true;
|
||||
m_coverLoading = true;
|
||||
}
|
||||
|
||||
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
||||
@ -170,7 +168,7 @@ Album::cover( const QSize& size, bool forceLoad ) const
|
||||
void
|
||||
Album::infoSystemInfo( const Tomahawk::InfoSystem::InfoRequestData& requestData, const QVariant& output )
|
||||
{
|
||||
if ( requestData.caller != m_uuid ||
|
||||
if ( requestData.caller != infoid() ||
|
||||
requestData.type != Tomahawk::InfoSystem::InfoAlbumCoverArt )
|
||||
{
|
||||
return;
|
||||
@ -183,9 +181,10 @@ Album::infoSystemInfo( const Tomahawk::InfoSystem::InfoRequestData& requestData,
|
||||
if ( ba.length() )
|
||||
{
|
||||
m_coverBuffer = ba;
|
||||
|
||||
emit coverChanged();
|
||||
}
|
||||
|
||||
m_coverLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,7 +192,7 @@ Album::infoSystemInfo( const Tomahawk::InfoSystem::InfoRequestData& requestData,
|
||||
void
|
||||
Album::infoSystemFinished( const QString& target )
|
||||
{
|
||||
if ( target != m_uuid )
|
||||
if ( target != infoid() )
|
||||
return;
|
||||
|
||||
disconnect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
@ -202,7 +201,8 @@ Album::infoSystemFinished( const QString& target )
|
||||
disconnect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ),
|
||||
this, SLOT( infoSystemFinished( QString ) ) );
|
||||
|
||||
m_infoLoaded = true;
|
||||
m_coverLoading = false;
|
||||
|
||||
emit updated();
|
||||
}
|
||||
|
||||
@ -230,3 +230,13 @@ Album::tracks( ModelMode mode, const Tomahawk::collection_ptr& collection )
|
||||
{
|
||||
return playlistInterface( mode, collection )->tracks();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Album::infoid() const
|
||||
{
|
||||
if ( m_uuid.isEmpty() )
|
||||
m_uuid = uuid();
|
||||
|
||||
return m_uuid;
|
||||
}
|
@ -56,7 +56,7 @@ public:
|
||||
#ifndef ENABLE_HEADLESS
|
||||
QPixmap cover( const QSize& size, bool forceLoad = true ) const;
|
||||
#endif
|
||||
bool infoLoaded() const { return m_infoLoaded; }
|
||||
bool coverLoaded() const { return m_coverLoaded; }
|
||||
|
||||
QList<Tomahawk::query_ptr> tracks( ModelMode mode = Mixed, const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr() );
|
||||
Tomahawk::playlistinterface_ptr playlistInterface( ModelMode mode, const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr() );
|
||||
@ -77,6 +77,7 @@ private slots:
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY( Album )
|
||||
QString infoid() const;
|
||||
|
||||
unsigned int m_id;
|
||||
QString m_name;
|
||||
@ -85,8 +86,8 @@ private:
|
||||
artist_ptr m_artist;
|
||||
QByteArray m_coverBuffer;
|
||||
|
||||
bool m_infoLoaded;
|
||||
mutable bool m_infoLoading;
|
||||
bool m_coverLoaded;
|
||||
mutable bool m_coverLoading;
|
||||
mutable QString m_uuid;
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
@ -82,9 +82,10 @@ Artist::Artist( unsigned int id, const QString& name )
|
||||
: QObject()
|
||||
, m_id( id )
|
||||
, m_name( name )
|
||||
, m_infoLoaded( false )
|
||||
, m_infoLoading( false )
|
||||
, m_coverLoaded( false )
|
||||
, m_coverLoading( false )
|
||||
, m_simArtistsLoaded( false )
|
||||
, m_biographyLoaded( false )
|
||||
, m_infoJobs( 0 )
|
||||
#ifndef ENABLE_HEADLESS
|
||||
, m_cover( 0 )
|
||||
@ -111,9 +112,6 @@ Artist::albums( ModelMode mode, const Tomahawk::collection_ptr& collection ) con
|
||||
if ( !collection.isNull() )
|
||||
dbLoaded = false;
|
||||
|
||||
m_uuid = uuid();
|
||||
tDebug() << Q_FUNC_INFO << mode;
|
||||
|
||||
if ( ( mode == DatabaseMode || mode == Mixed ) && !dbLoaded )
|
||||
{
|
||||
DatabaseCommand_AllAlbums* cmd = new DatabaseCommand_AllAlbums( collection, artist );
|
||||
@ -131,7 +129,7 @@ Artist::albums( ModelMode mode, const Tomahawk::collection_ptr& collection ) con
|
||||
artistInfo["artist"] = name();
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = m_uuid;
|
||||
requestData.caller = infoid();
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo );
|
||||
requestData.type = Tomahawk::InfoSystem::InfoArtistReleases;
|
||||
|
||||
@ -171,7 +169,7 @@ Artist::similarArtists() const
|
||||
artistInfo["artist"] = name();
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = m_uuid;
|
||||
requestData.caller = infoid();
|
||||
requestData.customData = QVariantMap();
|
||||
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo );
|
||||
@ -194,6 +192,35 @@ Artist::similarArtists() const
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Artist::biography() const
|
||||
{
|
||||
if ( !m_biographyLoaded )
|
||||
{
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = infoid();
|
||||
requestData.customData = QVariantMap();
|
||||
|
||||
requestData.input = name();
|
||||
requestData.type = Tomahawk::InfoSystem::InfoArtistBiography;
|
||||
requestData.requestId = TomahawkUtils::infosystemRequestId();
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ), Qt::UniqueConnection );
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( finished( QString ) ),
|
||||
SLOT( infoSystemFinished( QString ) ), Qt::UniqueConnection );
|
||||
|
||||
m_infoJobs++;
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
||||
}
|
||||
|
||||
return m_biography;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Artist::loadStats()
|
||||
{
|
||||
@ -259,7 +286,7 @@ Artist::onAlbumsFound( const QList< album_ptr >& albums, const QVariant& data )
|
||||
void
|
||||
Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
|
||||
{
|
||||
if ( requestData.caller != m_uuid )
|
||||
if ( requestData.caller != infoid() )
|
||||
return;
|
||||
|
||||
QVariantMap returnedData = output.value< QVariantMap >();
|
||||
@ -274,7 +301,6 @@ Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVari
|
||||
QList< album_ptr > albums;
|
||||
foreach ( const QString& albumName, albumNames )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << albumName;
|
||||
Tomahawk::album_ptr album = Tomahawk::Album::get( m_ownRef.toStrongRef(), albumName, false );
|
||||
m_officialAlbums << album;
|
||||
albums << album;
|
||||
@ -295,9 +321,10 @@ Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVari
|
||||
if ( ba.length() )
|
||||
{
|
||||
m_coverBuffer = ba;
|
||||
m_infoLoaded = true;
|
||||
emit coverChanged();
|
||||
}
|
||||
|
||||
m_coverLoaded = true;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -317,6 +344,22 @@ Artist::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVari
|
||||
break;
|
||||
}
|
||||
|
||||
case InfoSystem::InfoArtistBiography:
|
||||
{
|
||||
QVariantMap bmap = output.toMap();
|
||||
|
||||
foreach ( const QString& source, bmap.keys() )
|
||||
{
|
||||
if ( source == "last.fm" )
|
||||
m_biography = bmap[ source ].toHash()[ "text" ].toString();
|
||||
}
|
||||
|
||||
m_biographyLoaded = true;
|
||||
emit biographyLoaded();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
Q_ASSERT( false );
|
||||
}
|
||||
@ -328,7 +371,7 @@ Artist::infoSystemFinished( QString target )
|
||||
{
|
||||
Q_UNUSED( target );
|
||||
|
||||
if ( target != m_uuid )
|
||||
if ( target != infoid() )
|
||||
return;
|
||||
|
||||
if ( --m_infoJobs == 0 )
|
||||
@ -340,6 +383,8 @@ Artist::infoSystemFinished( QString target )
|
||||
this, SLOT( infoSystemFinished( QString ) ) );
|
||||
}
|
||||
|
||||
m_coverLoading = false;
|
||||
|
||||
emit updated();
|
||||
}
|
||||
|
||||
@ -348,17 +393,16 @@ Artist::infoSystemFinished( QString target )
|
||||
QPixmap
|
||||
Artist::cover( const QSize& size, bool forceLoad ) const
|
||||
{
|
||||
if ( !m_infoLoaded && !m_infoLoading )
|
||||
if ( !m_coverLoaded && !m_coverLoading )
|
||||
{
|
||||
if ( !forceLoad )
|
||||
return QPixmap();
|
||||
m_uuid = uuid();
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash trackInfo;
|
||||
trackInfo["artist"] = name();
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = m_uuid;
|
||||
requestData.caller = infoid();
|
||||
requestData.type = Tomahawk::InfoSystem::InfoArtistImages;
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( trackInfo );
|
||||
requestData.customData = QVariantMap();
|
||||
@ -374,7 +418,7 @@ Artist::cover( const QSize& size, bool forceLoad ) const
|
||||
m_infoJobs++;
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
||||
|
||||
m_infoLoading = true;
|
||||
m_coverLoading = true;
|
||||
}
|
||||
|
||||
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
||||
@ -428,3 +472,13 @@ Artist::tracks( ModelMode mode, const Tomahawk::collection_ptr& collection )
|
||||
{
|
||||
return playlistInterface( mode, collection )->tracks();
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Artist::infoid() const
|
||||
{
|
||||
if ( m_uuid.isEmpty() )
|
||||
m_uuid = uuid();
|
||||
|
||||
return m_uuid;
|
||||
}
|
||||
|
@ -49,8 +49,6 @@ public:
|
||||
QString name() const { return m_name; }
|
||||
QString sortname() const { return m_sortname; }
|
||||
|
||||
bool infoLoaded() const { return m_infoLoaded; }
|
||||
|
||||
QList<Tomahawk::album_ptr> albums( ModelMode mode = Mixed, const Tomahawk::collection_ptr& collection = Tomahawk::collection_ptr() ) const;
|
||||
QList<Tomahawk::artist_ptr> similarArtists() const;
|
||||
|
||||
@ -61,10 +59,13 @@ public:
|
||||
QList< Tomahawk::PlaybackLog > playbackHistory( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() ) const;
|
||||
void setPlaybackHistory( const QList< Tomahawk::PlaybackLog >& playbackData );
|
||||
unsigned int playbackCount( const Tomahawk::source_ptr& source = Tomahawk::source_ptr() );
|
||||
|
||||
QString biography() const;
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
QPixmap cover( const QSize& size, bool forceLoad = true ) const;
|
||||
#endif
|
||||
bool coverLoaded() const { return m_coverLoaded; }
|
||||
|
||||
Tomahawk::playlistinterface_ptr playlistInterface();
|
||||
|
||||
@ -78,6 +79,7 @@ signals:
|
||||
void updated();
|
||||
void coverChanged();
|
||||
void similarArtistsLoaded();
|
||||
void biographyLoaded();
|
||||
void statsLoaded();
|
||||
|
||||
private slots:
|
||||
@ -89,15 +91,17 @@ private slots:
|
||||
|
||||
private:
|
||||
Artist();
|
||||
QString infoid() const;
|
||||
|
||||
unsigned int m_id;
|
||||
QString m_name;
|
||||
QString m_sortname;
|
||||
|
||||
bool m_infoLoaded;
|
||||
mutable bool m_infoLoading;
|
||||
bool m_coverLoaded;
|
||||
mutable bool m_coverLoading;
|
||||
QHash<Tomahawk::ModelMode, bool> m_albumsLoaded;
|
||||
bool m_simArtistsLoaded;
|
||||
bool m_biographyLoaded;
|
||||
|
||||
mutable QString m_uuid;
|
||||
mutable int m_infoJobs;
|
||||
@ -105,6 +109,7 @@ private:
|
||||
QList<Tomahawk::album_ptr> m_databaseAlbums;
|
||||
QList<Tomahawk::album_ptr> m_officialAlbums;
|
||||
QList<Tomahawk::artist_ptr> m_similarArtists;
|
||||
QString m_biography;
|
||||
|
||||
bool m_playbackHistoryLoaded;
|
||||
QList< PlaybackLog > m_playbackHistory;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "TomahawkSettingsGui.h"
|
||||
#include "Pipeline.h"
|
||||
#include "Source.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <attica/downloaditem.h>
|
||||
|
||||
@ -35,12 +36,24 @@
|
||||
#include "accounts/ResolverAccount.h"
|
||||
#include "accounts/AccountManager.h"
|
||||
#include "utils/BinaryInstallerHelper.h"
|
||||
#include "utils/Closure.h"
|
||||
|
||||
using namespace Attica;
|
||||
|
||||
AtticaManager* AtticaManager::s_instance = 0;
|
||||
|
||||
|
||||
// Sort binary resolvers above script resolvers, and script resolvers by download count
|
||||
bool
|
||||
resolverSort( const Attica::Content& first, const Attica::Content& second )
|
||||
{
|
||||
if ( !first.attribute( "typeid" ).isEmpty() && second.attribute( "typeid" ).isEmpty() )
|
||||
return true;
|
||||
|
||||
return first.downloads() > second.downloads();
|
||||
}
|
||||
|
||||
|
||||
AtticaManager::AtticaManager( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_manager( Attica::ProviderManager::ProviderFlags( Attica::ProviderManager::DisablePlugins ) )
|
||||
@ -49,7 +62,13 @@ AtticaManager::AtticaManager( QObject* parent )
|
||||
connect( &m_manager, SIGNAL( providerAdded( Attica::Provider ) ), this, SLOT( providerAdded( Attica::Provider ) ) );
|
||||
|
||||
// resolvers
|
||||
m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org/resolvers/providers.xml" ) );
|
||||
// m_manager.addProviderFile( QUrl( "http://bakery.tomahawk-player.org/resolvers/providers.xml" ) );
|
||||
|
||||
const QString url = QString( "http://bakery.tomahawk-player.org/resolvers/providers.xml?version=%1" ).arg( TomahawkUtils::appFriendlyVersion() );
|
||||
QNetworkReply* reply = TomahawkUtils::nam()->get( QNetworkRequest( QUrl( url ) ) );
|
||||
NewClosure( reply, SIGNAL( finished() ), this, SLOT( providerFetched( QNetworkReply* ) ), reply );
|
||||
connect( reply, SIGNAL( error( QNetworkReply::NetworkError ) ), this, SLOT( providerError( QNetworkReply::NetworkError ) ) );
|
||||
|
||||
// m_manager.addProviderFile( QUrl( "http://lycophron/resolvers/providers.xml" ) );
|
||||
|
||||
qRegisterMetaType< Attica::Content >( "Attica::Content" );
|
||||
@ -59,6 +78,15 @@ AtticaManager::AtticaManager( QObject* parent )
|
||||
AtticaManager::~AtticaManager()
|
||||
{
|
||||
savePixmapsToCache();
|
||||
|
||||
|
||||
foreach( const QString& id, m_resolverStates.keys() )
|
||||
{
|
||||
if ( !m_resolverStates[ id ].pixmap )
|
||||
continue;
|
||||
|
||||
delete m_resolverStates[ id ].pixmap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -244,6 +272,25 @@ AtticaManager::resolverData(const QString &atticaId) const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AtticaManager::providerError( QNetworkReply::NetworkError err )
|
||||
{
|
||||
// So those who care know
|
||||
emit resolversLoaded( Content::List() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AtticaManager::providerFetched( QNetworkReply* reply )
|
||||
{
|
||||
Q_ASSERT( reply );
|
||||
if ( !reply )
|
||||
return;
|
||||
|
||||
m_manager.addProviderFromXml( reply->readAll() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AtticaManager::providerAdded( const Provider& provider )
|
||||
{
|
||||
@ -329,7 +376,10 @@ AtticaManager::resolversList( BaseJob* j )
|
||||
syncServerData();
|
||||
|
||||
if ( ++m_resolverJobsLoaded == 2 )
|
||||
{
|
||||
qSort( m_resolvers.begin(), m_resolvers.end(), resolverSort );
|
||||
emit resolversLoaded( m_resolvers );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -350,7 +400,12 @@ AtticaManager::binaryResolversList( BaseJob* j )
|
||||
platform = "linux-x64";
|
||||
#elif defined(Q_OS_LINUX) // Horrible assumption here...
|
||||
platform = "linux-x86";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Override if no binary resolvers were requested
|
||||
#ifndef WITH_BINARY_ATTICA
|
||||
platform = QString();
|
||||
#endif
|
||||
|
||||
foreach ( const Content& c, binaryResolvers )
|
||||
{
|
||||
@ -375,7 +430,10 @@ AtticaManager::binaryResolversList( BaseJob* j )
|
||||
}
|
||||
|
||||
if ( ++m_resolverJobsLoaded == 2 )
|
||||
{
|
||||
qSort( m_resolvers.begin(), m_resolvers.end(), resolverSort );
|
||||
emit resolversLoaded( m_resolvers );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
#include <QPixmap>
|
||||
#include <QNetworkReply>
|
||||
|
||||
#include "DllMacro.h"
|
||||
#include "accounts/Account.h"
|
||||
@ -124,7 +125,10 @@ signals:
|
||||
void resolverInstallationFailed( const QString& resolverId );
|
||||
|
||||
void startedInstalling( const QString& resolverId );
|
||||
|
||||
private slots:
|
||||
void providerFetched( QNetworkReply* reply );
|
||||
void providerError( QNetworkReply::NetworkError );
|
||||
void providerAdded( const Attica::Provider& );
|
||||
void categoriesReturned( Attica::BaseJob* );
|
||||
void resolversList( Attica::BaseJob* );
|
||||
@ -139,7 +143,6 @@ private slots:
|
||||
void syncServerData();
|
||||
|
||||
private:
|
||||
QString extractPayload( const QString& filename, const QString& resolverId ) const;
|
||||
void doResolverRemove( const QString& id ) const;
|
||||
void doInstallResolver( const Attica::Content& resolver, bool autoCreate, Tomahawk::Accounts::AtticaResolverAccount* handler );
|
||||
|
||||
@ -171,5 +174,5 @@ protected:
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE( Attica::Content );
|
||||
|
||||
Q_DECLARE_METATYPE( QNetworkReply* );
|
||||
#endif // ATTICAMANAGER_H
|
||||
|
@ -6,6 +6,10 @@ SET( QT_USE_QTNETWORK TRUE )
|
||||
SET( QT_USE_QTXML TRUE )
|
||||
SET( QT_USE_QTUITOOLS TRUE )
|
||||
|
||||
IF( UNIX AND NOT APPLE )
|
||||
SET( QT_USE_QTDBUS TRUE )
|
||||
ENDIF( UNIX AND NOT APPLE )
|
||||
|
||||
include( ${QT_USE_FILE} )
|
||||
|
||||
add_definitions( ${QT_DEFINITIONS} )
|
||||
@ -48,31 +52,20 @@ set( libGuiSources
|
||||
playlist/TreeModel.cpp
|
||||
playlist/TreeProxyModel.cpp
|
||||
playlist/TreeProxyModelPlaylistInterface.cpp
|
||||
playlist/TreeHeader.cpp
|
||||
playlist/TreeItemDelegate.cpp
|
||||
playlist/CollectionProxyModel.cpp
|
||||
playlist/CollectionProxyModelPlaylistInterface.cpp
|
||||
playlist/CollectionFlatModel.cpp
|
||||
playlist/CollectionView.cpp
|
||||
playlist/PlaylistModel.cpp
|
||||
playlist/PlaylistProxyModel.cpp
|
||||
playlist/PlaylistProxyModelPlaylistInterface.cpp
|
||||
playlist/PlaylistView.cpp
|
||||
playlist/PlaylistItemDelegate.cpp
|
||||
playlist/QueueProxyModel.cpp
|
||||
playlist/QueueProxyModelPlaylistInterface.cpp
|
||||
playlist/QueueView.cpp
|
||||
playlist/PlayableModel.cpp
|
||||
playlist/PlayableProxyModel.cpp
|
||||
playlist/PlayableProxyModelPlaylistInterface.cpp
|
||||
playlist/TrackView.cpp
|
||||
playlist/TrackHeader.cpp
|
||||
playlist/AlbumModel.cpp
|
||||
playlist/AlbumProxyModel.cpp
|
||||
playlist/AlbumProxyModelPlaylistInterface.cpp
|
||||
playlist/AlbumItemDelegate.cpp
|
||||
playlist/AlbumView.cpp
|
||||
playlist/ArtistView.cpp
|
||||
playlist/GridItemDelegate.cpp
|
||||
playlist/GridView.cpp
|
||||
playlist/TreeView.cpp
|
||||
playlist/CustomPlaylistView.cpp
|
||||
playlist/ViewHeader.cpp
|
||||
playlist/RecentlyAddedModel.cpp
|
||||
@ -191,6 +184,19 @@ set( libSources
|
||||
accounts/AccountModel.cpp
|
||||
accounts/AccountModelFilterProxy.cpp
|
||||
accounts/ResolverAccount.cpp
|
||||
accounts/AccountDelegate.cpp
|
||||
accounts/DelegateConfigWrapper.cpp
|
||||
accounts/AccountFactoryWrapper.cpp
|
||||
accounts/AccountFactoryWrapperDelegate.cpp
|
||||
|
||||
accounts/spotify/SpotifyAccount.cpp
|
||||
accounts/spotify/SpotifyAccountConfig.cpp
|
||||
accounts/spotify/SpotifyPlaylistUpdater.cpp
|
||||
|
||||
accounts/lastfm/LastFmAccount.cpp
|
||||
accounts/lastfm/LastFmConfig.cpp
|
||||
accounts/lastfm/LastFmInfoPlugin.cpp
|
||||
|
||||
sip/SipPlugin.cpp
|
||||
sip/SipHandler.cpp
|
||||
sip/SipInfo.cpp
|
||||
@ -288,6 +294,7 @@ set( libSources
|
||||
utils/Qnr_IoDeviceStream.cpp
|
||||
utils/XspfLoader.cpp
|
||||
utils/TomahawkCache.cpp
|
||||
utils/GuiHelpers.cpp
|
||||
|
||||
thirdparty/kdsingleapplicationguard/kdsingleapplicationguard.cpp
|
||||
thirdparty/kdsingleapplicationguard/kdsharedmemorylocker.cpp
|
||||
@ -311,6 +318,9 @@ set( libUI ${libUI}
|
||||
playlist/QueueView.ui
|
||||
context/ContextWidget.ui
|
||||
infobar/InfoBar.ui
|
||||
accounts/AccountFactoryWrapper.ui
|
||||
accounts/spotify/SpotifyAccountConfig.ui
|
||||
accounts/lastfm/LastFmConfig.ui
|
||||
)
|
||||
|
||||
include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/.. ..
|
||||
@ -319,9 +329,10 @@ include_directories( . ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/.
|
||||
${QJSON_INCLUDE_DIR}
|
||||
${LIBECHONEST_INCLUDE_DIR}
|
||||
${LIBECHONEST_INCLUDE_DIR}/..
|
||||
${LIBLASTFM_INCLUDE_DIRS}
|
||||
${LIBLASTFM_INCLUDE_DIRS}/..
|
||||
${CLUCENE_INCLUDE_DIRS}
|
||||
${PHONON_INCLUDES}
|
||||
${CMAKE_BINARY_DIR}/thirdparty/liblastfm2/src
|
||||
|
||||
playlist
|
||||
|
||||
@ -392,7 +403,7 @@ ELSE( APPLE )
|
||||
ENDIF( APPLE )
|
||||
|
||||
IF(LIBLASTFM_FOUND)
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} tomahawk_lastfm2 )
|
||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${LIBLASTFM_LIBRARIES} )
|
||||
ENDIF(LIBLASTFM_FOUND)
|
||||
|
||||
IF(BUILD_GUI)
|
||||
@ -414,6 +425,10 @@ IF(LIBATTICA_FOUND)
|
||||
SET( LINK_LIBRARIES ${LINK_LIBRARIES} ${LIBATTICA_LIBRARIES} ${QuaZip_LIBRARIES} )
|
||||
ENDIF(LIBATTICA_FOUND)
|
||||
|
||||
IF( UNIX AND NOT APPLE )
|
||||
SET( LINK_LIBRARIES ${LINK_LIBRARIES} ${QT_QTDBUS_LIBRARY} )
|
||||
ENDIF( UNIX AND NOT APPLE )
|
||||
|
||||
TARGET_LINK_LIBRARIES( tomahawklib
|
||||
# Thirdparty shipped with tomahawk
|
||||
${LIBPORTFWD_LIBRARIES}
|
||||
@ -427,7 +442,11 @@ TARGET_LINK_LIBRARIES( tomahawklib
|
||||
${QT_QTSQL_LIBRARY}
|
||||
${QT_QTUITOOLS_LIBRARY}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${QT_QTWEBKIT_LIBRARY}
|
||||
${QT_QTSCRIPT_LIBRARY}
|
||||
${QT_QTNETWORK_LIBRARY}
|
||||
${QT_QTXML_LIBRARY}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${LINK_LIBRARIES}
|
||||
|
@ -98,7 +98,6 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
|
||||
m_sigmap->setMapping( m_loveAction, ActionLove );
|
||||
|
||||
connect( queries.first().data(), SIGNAL( socialActionsLoaded() ), SLOT( onSocialActionsLoaded() ) );
|
||||
m_queries.first()->loadSocialActions();
|
||||
onSocialActionsLoaded();
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "GlobalActionManager.h"
|
||||
#include "infosystem/InfoSystem.h"
|
||||
#include "utils/XspfLoader.h"
|
||||
#include "jobview/JobStatusView.h"
|
||||
#include "jobview/JobStatusModel.h"
|
||||
@ -57,7 +56,6 @@ DropJob::DropJob( QObject *parent )
|
||||
, m_getWholeAlbums( false )
|
||||
, m_top10( false )
|
||||
, m_dropAction( Default )
|
||||
, m_dropJob( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
@ -294,11 +292,11 @@ DropJob::tracksFromQueryList( const QMimeData* data )
|
||||
query_ptr* query = reinterpret_cast<query_ptr*>(qptr);
|
||||
if ( query && !query->isNull() )
|
||||
{
|
||||
tDebug() << "Dropped query item:" << query->data()->artist() << "-" << query->data()->track();
|
||||
tDebug() << "Dropped query item:" << query->data()->toString();
|
||||
|
||||
if ( m_top10 )
|
||||
{
|
||||
getTopTen( query->data()->artist() );
|
||||
queries << getTopTen( query->data()->artist() );
|
||||
}
|
||||
else if ( m_getWholeArtists )
|
||||
{
|
||||
@ -376,7 +374,7 @@ DropJob::tracksFromAlbumMetaData( const QMimeData *data )
|
||||
stream >> album;
|
||||
|
||||
if ( m_top10 )
|
||||
getTopTen( artist );
|
||||
queries << getTopTen( artist );
|
||||
else if ( m_getWholeArtists )
|
||||
queries << getArtist( artist );
|
||||
else
|
||||
@ -405,7 +403,7 @@ DropJob::tracksFromArtistMetaData( const QMimeData *data )
|
||||
}
|
||||
else
|
||||
{
|
||||
getTopTen( artist );
|
||||
queries << getTopTen( artist );
|
||||
}
|
||||
}
|
||||
return queries;
|
||||
@ -569,6 +567,7 @@ DropJob::handleRdioUrls( const QString& urlsRaw )
|
||||
rdio->parse( urls );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
|
||||
{
|
||||
@ -594,7 +593,6 @@ DropJob::handleGroovesharkUrls ( const QString& urlsRaw )
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
DropJob::handleAllUrls( const QString& urls )
|
||||
{
|
||||
@ -672,22 +670,28 @@ DropJob::expandedUrls( QStringList urls )
|
||||
void
|
||||
DropJob::onTracksAdded( const QList<Tomahawk::query_ptr>& tracksList )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if ( m_dropJob )
|
||||
tDebug() << Q_FUNC_INFO << tracksList.count();
|
||||
|
||||
/* if ( results.isEmpty() )
|
||||
{
|
||||
m_dropJob->setFinished();
|
||||
m_dropJob = 0;
|
||||
const QString which = album.isEmpty() ? "artist" : "album";
|
||||
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( tr( "No tracks found for given %1" ).arg( which ), 5 ) );
|
||||
}*/
|
||||
|
||||
if ( !m_dropJob.isEmpty() )
|
||||
{
|
||||
m_dropJob.takeFirst()->setFinished();
|
||||
}
|
||||
|
||||
m_resultList.append( tracksList );
|
||||
|
||||
if ( --m_queryCount == 0 )
|
||||
{
|
||||
if ( m_onlyLocal )
|
||||
/* if ( m_onlyLocal )
|
||||
removeRemoteSources();
|
||||
|
||||
if ( !m_allowDuplicates )
|
||||
removeDuplicates();
|
||||
removeDuplicates();*/
|
||||
|
||||
emit tracks( m_resultList );
|
||||
deleteLater();
|
||||
@ -695,67 +699,6 @@ DropJob::onTracksAdded( const QList<Tomahawk::query_ptr>& tracksList )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropJob::tracksFromDB( const QList< query_ptr >& tracks )
|
||||
{
|
||||
// Tracks that we get from databasecommand_alltracks are resolved only against the database and explicitly marked
|
||||
// as finished. if the source they resolve to is offline they will not resolve against any resolver.
|
||||
// explicitly resolve them if they fall in that case first
|
||||
foreach( const query_ptr& track, tracks )
|
||||
{
|
||||
if ( !track->playable() && !track->solved() && track->results().size() ) // we have offline results
|
||||
{
|
||||
track->setResolveFinished( false );
|
||||
Pipeline::instance()->resolve( track );
|
||||
}
|
||||
}
|
||||
|
||||
album_ptr albumPtr;
|
||||
artist_ptr artistPtr;
|
||||
if ( Tomahawk::Album* album = qobject_cast< Tomahawk::Album* >( sender() ) )
|
||||
{
|
||||
foreach ( const album_ptr& ptr, m_albumsToKeep )
|
||||
if ( ptr.data() == album )
|
||||
{
|
||||
albumPtr = ptr;
|
||||
m_albumsToKeep.remove( ptr );
|
||||
}
|
||||
}
|
||||
else if ( Tomahawk::Artist* artist = qobject_cast< Tomahawk::Artist* >( sender() ) )
|
||||
{
|
||||
foreach ( const artist_ptr& ptr, m_artistsToKeep )
|
||||
if ( ptr.data() == artist )
|
||||
{
|
||||
artistPtr = ptr;
|
||||
m_artistsToKeep.remove( ptr );
|
||||
}
|
||||
}
|
||||
|
||||
// If we have no tracks, this means no sources in our network have the give request (artist or album)
|
||||
// Since we really do want to try to drop them, we ask the infosystem as well.
|
||||
if ( tracks.isEmpty() )
|
||||
{
|
||||
if ( !albumPtr.isNull() && !albumPtr->artist().isNull() )
|
||||
{
|
||||
Q_ASSERT( artistPtr.isNull() );
|
||||
--m_queryCount; // This query is done. New query is infosystem query
|
||||
getAlbumFromInfoystem( albumPtr->artist()->name(), albumPtr->name() );
|
||||
}
|
||||
else if ( !artistPtr.isNull() )
|
||||
{
|
||||
Q_ASSERT( albumPtr.isNull() );
|
||||
--m_queryCount;
|
||||
getTopTen( artistPtr->name() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
onTracksAdded( tracks );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropJob::removeDuplicates()
|
||||
{
|
||||
@ -803,41 +746,8 @@ DropJob::removeRemoteSources()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropJob::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output )
|
||||
{
|
||||
if ( requestData.caller == s_dropJobInfoId )
|
||||
{
|
||||
const Tomahawk::InfoSystem::InfoStringHash info = requestData.input.value< Tomahawk::InfoSystem::InfoStringHash >();
|
||||
|
||||
const QString artist = info["artist"];
|
||||
const QString album = info["album"];
|
||||
|
||||
qDebug() << "Got requestData response for artist" << artist << "and album:" << album << output;
|
||||
|
||||
QList< query_ptr > results;
|
||||
|
||||
int i = 0;
|
||||
foreach ( const QVariant& title, output.toMap().value( "tracks" ).toList() )
|
||||
{
|
||||
results << Query::get( artist, title.toString(), QString(), uuid() );
|
||||
|
||||
if ( ++i == 10 ) // Only getting top ten for now. Would make sense to make it configurable
|
||||
break;
|
||||
}
|
||||
|
||||
if ( results.isEmpty() )
|
||||
{
|
||||
const QString which = album.isEmpty() ? "artist" : "album";
|
||||
JobStatusView::instance()->model()->addJob( new ErrorStatusMessage( tr( "No tracks found for given %1" ).arg( which ), 5 ) );
|
||||
}
|
||||
onTracksAdded( results );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QList< query_ptr >
|
||||
DropJob::getArtist( const QString &artist )
|
||||
DropJob::getArtist( const QString &artist, Tomahawk::ModelMode mode )
|
||||
{
|
||||
artist_ptr artistPtr = Artist::get( artist );
|
||||
if ( artistPtr->playlistInterface( Mixed )->tracks().isEmpty() )
|
||||
@ -845,13 +755,15 @@ DropJob::getArtist( const QString &artist )
|
||||
m_artistsToKeep.insert( artistPtr );
|
||||
|
||||
connect( artistPtr.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ),
|
||||
SLOT( tracksFromDB( QList<Tomahawk::query_ptr> ) ) );
|
||||
SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
|
||||
|
||||
m_dropJob << new DropJobNotifier( QPixmap( RESPATH "images/album-icon.png" ), Album );
|
||||
JobStatusView::instance()->model()->addJob( m_dropJob.last() );
|
||||
|
||||
m_queryCount++;
|
||||
return QList< query_ptr >();
|
||||
}
|
||||
else
|
||||
return artistPtr->playlistInterface( Mixed )->tracks();
|
||||
|
||||
return artistPtr->playlistInterface( Mixed )->tracks();
|
||||
}
|
||||
|
||||
|
||||
@ -872,62 +784,21 @@ DropJob::getAlbum( const QString& artist, const QString& album )
|
||||
// the artist_ptr which means we never get the signal delivered. so we hold on to the album pointer till we're done
|
||||
m_albumsToKeep.insert( albumPtr );
|
||||
|
||||
m_dropJob = new DropJobNotifier( QPixmap( RESPATH "images/album-icon.png" ), Album );
|
||||
connect( albumPtr.data(), SIGNAL( tracksAdded( QList<Tomahawk::query_ptr>, Tomahawk::ModelMode, Tomahawk::collection_ptr ) ),
|
||||
SLOT( tracksFromDB( QList<Tomahawk::query_ptr> ) ) );
|
||||
JobStatusView::instance()->model()->addJob( m_dropJob );
|
||||
SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
|
||||
|
||||
m_dropJob << new DropJobNotifier( QPixmap( RESPATH "images/album-icon.png" ), Album );
|
||||
JobStatusView::instance()->model()->addJob( m_dropJob.last() );
|
||||
|
||||
m_queryCount++;
|
||||
return QList< query_ptr >();
|
||||
}
|
||||
else
|
||||
return albumPtr->playlistInterface( Mixed )->tracks();
|
||||
|
||||
return albumPtr->playlistInterface( Mixed )->tracks();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropJob::getTopTen( const QString &artist )
|
||||
QList< query_ptr >
|
||||
DropJob::getTopTen( const QString& artist )
|
||||
{
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash artistInfo;
|
||||
artistInfo["artist"] = artist;
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = s_dropJobInfoId;
|
||||
requestData.customData = QVariantMap();
|
||||
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo );
|
||||
|
||||
requestData.type = Tomahawk::InfoSystem::InfoArtistSongs;
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
||||
|
||||
m_queryCount++;
|
||||
return getArtist( artist, Tomahawk::InfoSystemMode );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DropJob::getAlbumFromInfoystem( const QString& artist, const QString& album )
|
||||
{
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(),
|
||||
SIGNAL( info( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ),
|
||||
SLOT( infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData, QVariant ) ) );
|
||||
|
||||
Tomahawk::InfoSystem::InfoStringHash artistInfo;
|
||||
artistInfo["artist"] = artist;
|
||||
artistInfo["album"] = album;
|
||||
|
||||
Tomahawk::InfoSystem::InfoRequestData requestData;
|
||||
requestData.caller = s_dropJobInfoId;
|
||||
requestData.customData = QVariantMap();
|
||||
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoStringHash >( artistInfo );
|
||||
|
||||
requestData.type = Tomahawk::InfoSystem::InfoAlbumSongs;
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
||||
|
||||
m_queryCount++;
|
||||
}
|
||||
|
||||
|
@ -22,9 +22,6 @@
|
||||
|
||||
#include "Query.h"
|
||||
|
||||
#include "infosystem/InfoSystem.h"
|
||||
#include "utils/XspfLoader.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QMimeData>
|
||||
@ -120,9 +117,7 @@ signals:
|
||||
private slots:
|
||||
void expandedUrls( QStringList );
|
||||
void onTracksAdded( const QList<Tomahawk::query_ptr>& );
|
||||
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
||||
|
||||
void tracksFromDB( const QList< Tomahawk::query_ptr >& );
|
||||
private:
|
||||
/// handle parsing mime data
|
||||
void handleAllUrls( const QString& urls );
|
||||
@ -133,11 +128,9 @@ private:
|
||||
QList< Tomahawk::query_ptr > tracksFromAlbumMetaData( const QMimeData* d );
|
||||
QList< Tomahawk::query_ptr > tracksFromMixedData( const QMimeData* d );
|
||||
|
||||
QList< Tomahawk::query_ptr > getArtist( const QString& artist );
|
||||
QList< Tomahawk::query_ptr > getArtist( const QString& artist, Tomahawk::ModelMode mode = Tomahawk::Mixed );
|
||||
QList< Tomahawk::query_ptr > getAlbum( const QString& artist, const QString& album );
|
||||
|
||||
void getTopTen( const QString& artist );
|
||||
void getAlbumFromInfoystem( const QString& artist, const QString& album );
|
||||
QList< Tomahawk::query_ptr > getTopTen( const QString& artist );
|
||||
|
||||
void removeDuplicates();
|
||||
void removeRemoteSources();
|
||||
@ -151,7 +144,7 @@ private:
|
||||
DropTypes m_dropTypes;
|
||||
DropAction m_dropAction;
|
||||
|
||||
Tomahawk::DropJobNotifier* m_dropJob;
|
||||
QList<Tomahawk::DropJobNotifier*> m_dropJob;
|
||||
|
||||
QList< Tomahawk::query_ptr > m_resultList;
|
||||
QSet< Tomahawk::album_ptr > m_albumsToKeep;
|
||||
|
@ -41,13 +41,15 @@
|
||||
#include "utils/ShortenedLinkParser.h"
|
||||
#include "utils/RdioParser.h"
|
||||
|
||||
#include "widgets/SearchWidget.h"
|
||||
#include "ViewManager.h"
|
||||
#include "playlist/topbar/TopBar.h"
|
||||
#include "playlist/PlaylistView.h"
|
||||
#ifndef ENABLE_HEADLESS
|
||||
#include "ViewManager.h"
|
||||
#include "playlist/topbar/TopBar.h"
|
||||
#include "playlist/PlaylistView.h"
|
||||
#include "widgets/SearchWidget.h"
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QClipboard>
|
||||
#endif
|
||||
|
||||
#include <QtNetwork/QNetworkAccessManager>
|
||||
#include <QtNetwork/QNetworkReply>
|
||||
@ -133,6 +135,8 @@ GlobalActionManager::shortenLink( const QUrl& url, const QVariant& callbackObj )
|
||||
}
|
||||
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
||||
void
|
||||
GlobalActionManager::getShortLink( const playlist_ptr& pl )
|
||||
{
|
||||
@ -162,7 +166,7 @@ GlobalActionManager::getShortLink( const playlist_ptr& pl )
|
||||
|
||||
// No built-in Qt facilities for doing a FORM POST. So we build the payload ourselves...
|
||||
const QByteArray boundary = "----------------------------2434992cccab";
|
||||
QByteArray data(QByteArray("--" + boundary + "\r\n"));
|
||||
QByteArray data( QByteArray( "--" + boundary + "\r\n" ) );
|
||||
data += "Content-Disposition: form-data; name=\"data\"; filename=\"playlist.jspf\"\r\n";
|
||||
data += "Content-Type: application/octet-stream\r\n\r\n";
|
||||
data += msg;
|
||||
@ -178,6 +182,7 @@ GlobalActionManager::getShortLink( const playlist_ptr& pl )
|
||||
connect( reply, SIGNAL( error( QNetworkReply::NetworkError ) ), SLOT( shortenLinkRequestError( QNetworkReply::NetworkError ) ) );
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
GlobalActionManager::copyPlaylistToClipboard( const dynplaylist_ptr& playlist )
|
||||
{
|
||||
@ -423,6 +428,7 @@ GlobalActionManager::handlePlaylistCommand( const QUrl& url )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GlobalActionManager::playlistCreatedToShow( const playlist_ptr& pl )
|
||||
{
|
||||
@ -430,7 +436,9 @@ GlobalActionManager::playlistCreatedToShow( const playlist_ptr& pl )
|
||||
pl->setProperty( "sharedptr", QVariant::fromValue<Tomahawk::playlist_ptr>( pl ) );
|
||||
}
|
||||
|
||||
void GlobalActionManager::playlistReadyToShow()
|
||||
|
||||
void
|
||||
GlobalActionManager::playlistReadyToShow()
|
||||
{
|
||||
playlist_ptr pl = sender()->property( "sharedptr" ).value<Tomahawk::playlist_ptr>();
|
||||
if ( !pl.isNull() )
|
||||
@ -460,7 +468,7 @@ GlobalActionManager::handleCollectionCommand( const QUrl& url )
|
||||
|
||||
|
||||
bool
|
||||
GlobalActionManager::handleOpenCommand(const QUrl& url)
|
||||
GlobalActionManager::handleOpenCommand( const QUrl& url )
|
||||
{
|
||||
QStringList parts = url.path().split( "/" ).mid( 1 );
|
||||
if ( parts.isEmpty() )
|
||||
@ -474,7 +482,7 @@ GlobalActionManager::handleOpenCommand(const QUrl& url)
|
||||
|
||||
|
||||
void
|
||||
GlobalActionManager::handleOpenTrack ( const query_ptr& q )
|
||||
GlobalActionManager::handleOpenTrack( const query_ptr& q )
|
||||
{
|
||||
ViewManager::instance()->queue()->model()->append( q );
|
||||
ViewManager::instance()->showQueue();
|
||||
@ -486,6 +494,7 @@ GlobalActionManager::handleOpenTrack ( const query_ptr& q )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
GlobalActionManager::handlePlayTrack( const query_ptr& qry )
|
||||
{
|
||||
@ -493,7 +502,6 @@ GlobalActionManager::handlePlayTrack( const query_ptr& qry )
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool
|
||||
GlobalActionManager::handleQueueCommand( const QUrl& url )
|
||||
{
|
||||
@ -996,6 +1004,8 @@ GlobalActionManager::playRdio( const QUrl& url )
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
bool GlobalActionManager::handleBookmarkCommand(const QUrl& url)
|
||||
{
|
||||
@ -1076,6 +1086,7 @@ GlobalActionManager::shortenLinkRequestFinished()
|
||||
if ( !shortUrl.isValid() )
|
||||
error = true;
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
// Success! Here is the short link
|
||||
if ( m_clipboardLongUrl == reply->request().url() )
|
||||
{
|
||||
@ -1088,6 +1099,7 @@ GlobalActionManager::shortenLinkRequestFinished()
|
||||
m_clipboardLongUrl.clear();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ( !error )
|
||||
emit shortLinkReady( longUrl, shortUrl, callbackObj );
|
||||
@ -1099,6 +1111,8 @@ GlobalActionManager::shortenLinkRequestFinished()
|
||||
}
|
||||
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
||||
void
|
||||
GlobalActionManager::postShortenFinished()
|
||||
{
|
||||
@ -1118,6 +1132,9 @@ GlobalActionManager::postShortenFinished()
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
GlobalActionManager::shortenLinkRequestError( QNetworkReply::NetworkError error )
|
||||
{
|
||||
@ -1172,6 +1189,8 @@ GlobalActionManager::doBookmark( const playlist_ptr& pl, const query_ptr& q )
|
||||
}
|
||||
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
||||
void
|
||||
GlobalActionManager::showPlaylist()
|
||||
{
|
||||
@ -1214,13 +1233,6 @@ GlobalActionManager::waitingForResolved( bool /* success */ )
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
GlobalActionManager::hostname() const
|
||||
{
|
||||
return QString( "http://toma.hk" );
|
||||
}
|
||||
|
||||
|
||||
/// SPOTIFY URL HANDLING
|
||||
|
||||
bool
|
||||
@ -1243,3 +1255,11 @@ GlobalActionManager::openRdioLink( const QString& link )
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
QString
|
||||
GlobalActionManager::hostname() const
|
||||
{
|
||||
return QString( "http://toma.hk" );
|
||||
}
|
||||
|
@ -45,6 +45,11 @@ public:
|
||||
QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const;
|
||||
QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;
|
||||
|
||||
public slots:
|
||||
void shortenLink( const QUrl& url, const QVariant &callbackObj = QVariant() );
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
|
||||
/// Takes a spotify link and performs the default open action on it
|
||||
bool openSpotifyLink( const QString& link );
|
||||
|
||||
@ -55,58 +60,62 @@ public:
|
||||
QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
|
||||
void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );
|
||||
|
||||
public slots:
|
||||
void shortenLink( const QUrl& url, const QVariant &callbackObj = QVariant() );
|
||||
void getShortLink( const Tomahawk::playlist_ptr& playlist );
|
||||
|
||||
bool parseTomahawkLink( const QString& link );
|
||||
void getShortLink( const Tomahawk::playlist_ptr& playlist );
|
||||
void waitingForResolved( bool );
|
||||
|
||||
Tomahawk::dynplaylist_ptr loadDynamicPlaylist( const QUrl& url, bool station );
|
||||
|
||||
void handleOpenTrack( const Tomahawk::query_ptr& qry );
|
||||
void handlePlayTrack( const Tomahawk::query_ptr& qry );
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void shortLinkReady( const QUrl& longUrl, const QUrl& shortUrl, const QVariant& callbackObj );
|
||||
|
||||
private slots:
|
||||
void shortenLinkRequestFinished();
|
||||
void postShortenFinished();
|
||||
void shortenLinkRequestError( QNetworkReply::NetworkError );
|
||||
|
||||
void bookmarkPlaylistCreated( const Tomahawk::playlist_ptr& pl );
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
void postShortenFinished();
|
||||
void showPlaylist();
|
||||
|
||||
void xspfCreated( const QByteArray& xspf );
|
||||
|
||||
void playOrQueueNow( const Tomahawk::query_ptr& );
|
||||
void playNow( const Tomahawk::query_ptr& );
|
||||
|
||||
void playlistCreatedToShow( const Tomahawk::playlist_ptr& pl );
|
||||
void playlistReadyToShow();
|
||||
|
||||
void xspfCreated( const QByteArray& xspf );
|
||||
|
||||
void playOrQueueNow( const Tomahawk::query_ptr& );
|
||||
void playNow( const Tomahawk::query_ptr& );
|
||||
#endif
|
||||
|
||||
private:
|
||||
explicit GlobalActionManager( QObject* parent = 0 );
|
||||
void doBookmark( const Tomahawk::playlist_ptr& pl, const Tomahawk::query_ptr& q );
|
||||
|
||||
/// handle opening of urls
|
||||
#ifndef ENABLE_HEADLESS
|
||||
bool handlePlaylistCommand( const QUrl& url );
|
||||
bool handleCollectionCommand(const QUrl& url );
|
||||
bool handleQueueCommand(const QUrl& url );
|
||||
bool handleStationCommand(const QUrl& url );
|
||||
bool handleAutoPlaylistCommand(const QUrl& url );
|
||||
bool handleSearchCommand(const QUrl& url );
|
||||
bool handlePlayCommand(const QUrl& url );
|
||||
bool handleBookmarkCommand(const QUrl& url );
|
||||
bool handleOpenCommand(const QUrl& url );
|
||||
bool handleViewCommand(const QUrl& url );
|
||||
bool handleViewCommand( const QUrl& url );
|
||||
bool handleStationCommand( const QUrl& url );
|
||||
bool handleSearchCommand( const QUrl& url );
|
||||
bool handleQueueCommand( const QUrl& url );
|
||||
bool handleAutoPlaylistCommand( const QUrl& url );
|
||||
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 );
|
||||
bool playRdio( const QUrl& url );
|
||||
bool queueRdio( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );
|
||||
#endif
|
||||
|
||||
bool handleCollectionCommand( const QUrl& url );
|
||||
bool handlePlayCommand( const QUrl& url );
|
||||
bool handleBookmarkCommand( const QUrl& url );
|
||||
bool handleOpenCommand( const QUrl& url );
|
||||
|
||||
QString hostname() const;
|
||||
|
||||
|
@ -106,6 +106,7 @@ Pipeline::removeResolver( Resolver* r )
|
||||
{
|
||||
QMutexLocker lock( &m_mut );
|
||||
|
||||
tDebug() << "Removed resolver:" << r->name();
|
||||
m_resolvers.removeAll( r );
|
||||
emit resolverRemoved( r );
|
||||
}
|
||||
@ -130,7 +131,7 @@ Pipeline::addExternalResolverFactory( ResolverFactoryFunc resolverFactory )
|
||||
|
||||
|
||||
Tomahawk::ExternalResolver*
|
||||
Pipeline::addScriptResolver( const QString& path, bool start )
|
||||
Pipeline::addScriptResolver( const QString& path )
|
||||
{
|
||||
ExternalResolver* res = 0;
|
||||
|
||||
@ -141,8 +142,6 @@ Pipeline::addScriptResolver( const QString& path, bool start )
|
||||
continue;
|
||||
|
||||
m_scriptResolvers << QWeakPointer< ExternalResolver >( res );
|
||||
if ( start )
|
||||
res->start();
|
||||
|
||||
break;
|
||||
}
|
||||
@ -203,14 +202,20 @@ Pipeline::resolve( const QList<query_ptr>& qlist, bool prioritized, bool tempora
|
||||
QMutexLocker lock( &m_mut );
|
||||
|
||||
int i = 0;
|
||||
foreach( const query_ptr& q, qlist )
|
||||
foreach ( const query_ptr& q, qlist )
|
||||
{
|
||||
if ( q->resolvingFinished() )
|
||||
continue;
|
||||
if ( m_queries_pending.contains( q ) )
|
||||
continue;
|
||||
if ( m_qidsState.contains( q->id() ) )
|
||||
continue;
|
||||
if ( m_queries_pending.contains( q ) )
|
||||
{
|
||||
if ( prioritized )
|
||||
{
|
||||
m_queries_pending.insert( i++, m_queries_pending.takeAt( m_queries_pending.indexOf( q ) ) );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !m_qids.contains( q->id() ) )
|
||||
m_qids.insert( q->id(), q );
|
||||
@ -268,7 +273,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
||||
const query_ptr& q = m_qids.value( qid );
|
||||
|
||||
QList< result_ptr > cleanResults;
|
||||
foreach( const result_ptr& r, results )
|
||||
foreach ( const result_ptr& r, results )
|
||||
{
|
||||
float score = q->howSimilar( r );
|
||||
r->setScore( score );
|
||||
@ -281,7 +286,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
||||
if ( !cleanResults.isEmpty() )
|
||||
{
|
||||
q->addResults( cleanResults );
|
||||
foreach( const result_ptr& r, cleanResults )
|
||||
foreach ( const result_ptr& r, cleanResults )
|
||||
{
|
||||
m_rids.insert( r->id(), r );
|
||||
}
|
||||
@ -312,7 +317,7 @@ Pipeline::reportAlbums( QID qid, const QList< album_ptr >& albums )
|
||||
Q_ASSERT( q->isFullTextQuery() );
|
||||
|
||||
QList< album_ptr > cleanAlbums;
|
||||
foreach( const album_ptr& r, albums )
|
||||
foreach ( const album_ptr& r, albums )
|
||||
{
|
||||
// float score = q->howSimilar( r );
|
||||
|
||||
@ -341,7 +346,7 @@ Pipeline::reportArtists( QID qid, const QList< artist_ptr >& artists )
|
||||
Q_ASSERT( q->isFullTextQuery() );
|
||||
|
||||
QList< artist_ptr > cleanArtists;
|
||||
foreach( const artist_ptr& r, artists )
|
||||
foreach ( const artist_ptr& r, artists )
|
||||
{
|
||||
// float score = q->howSimilar( r );
|
||||
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
void reportArtists( QID qid, const QList< artist_ptr >& artists );
|
||||
|
||||
void addExternalResolverFactory( ResolverFactoryFunc resolverFactory );
|
||||
Tomahawk::ExternalResolver* addScriptResolver( const QString& scriptPath, bool start = true );
|
||||
Tomahawk::ExternalResolver* addScriptResolver( const QString& scriptPath );
|
||||
void stopScriptResolver( const QString& scriptPath );
|
||||
void removeScriptResolver( const QString& scriptPath );
|
||||
QList< QWeakPointer< ExternalResolver > > scriptResolvers() const { return m_scriptResolvers; }
|
||||
@ -90,8 +90,8 @@ signals:
|
||||
void idle();
|
||||
void resolving( const Tomahawk::query_ptr& query );
|
||||
|
||||
void resolverAdded( Resolver* );
|
||||
void resolverRemoved( Resolver* );
|
||||
void resolverAdded( Tomahawk::Resolver* );
|
||||
void resolverRemoved( Tomahawk::Resolver* );
|
||||
|
||||
private slots:
|
||||
void timeoutShunt( const query_ptr& q );
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "utils/Logger.h"
|
||||
#include "Result.h"
|
||||
#include "Pipeline.h"
|
||||
#include "Source.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
@ -68,7 +69,7 @@ PlaylistInterface::filterTracks( const QList<Tomahawk::query_ptr>& queries )
|
||||
break;
|
||||
|
||||
const query_ptr& q2 = result.at( j );
|
||||
|
||||
|
||||
if ( q1->track() == q2->track() )
|
||||
{
|
||||
picked = false;
|
||||
|
@ -125,10 +125,7 @@ Query::Query( const QString& artist, const QString& track, const QString& album,
|
||||
connect( Database::instance(), SIGNAL( indexReady() ), SLOT( refreshResults() ), Qt::QueuedConnection );
|
||||
}
|
||||
|
||||
connect( Pipeline::instance(), SIGNAL( resolverAdded( Resolver* ) ),
|
||||
SLOT( onResolverAdded() ), Qt::QueuedConnection );
|
||||
connect( Pipeline::instance(), SIGNAL( resolverRemoved( Resolver* ) ),
|
||||
SLOT( onResolverRemoved() ), Qt::QueuedConnection );
|
||||
connect( Pipeline::instance(), SIGNAL( resolverAdded( Tomahawk::Resolver* ) ), SLOT( onResolverAdded() ), Qt::QueuedConnection );
|
||||
}
|
||||
|
||||
|
||||
@ -216,7 +213,6 @@ Query::addResults( const QList< Tomahawk::result_ptr >& newresults )
|
||||
|
||||
m_results << newresults;
|
||||
qStableSort( m_results.begin(), m_results.end(), Query::resultSorter );
|
||||
query_ptr q = m_ownRef.toStrongRef();
|
||||
|
||||
// hook up signals, and check solved status
|
||||
foreach( const result_ptr& rp, newresults )
|
||||
@ -318,16 +314,6 @@ Query::onResolverAdded()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Query::onResolverRemoved()
|
||||
{
|
||||
if ( !solved() )
|
||||
{
|
||||
refreshResults();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QList< result_ptr >
|
||||
Query::results() const
|
||||
{
|
||||
@ -447,7 +433,7 @@ Query::checkResults()
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_playable && !playable )
|
||||
if ( m_solved && !solved )
|
||||
{
|
||||
refreshResults();
|
||||
}
|
||||
@ -780,7 +766,7 @@ Query::cover( const QSize& size, bool forceLoad ) const
|
||||
}
|
||||
|
||||
m_albumPtr->cover( size, forceLoad );
|
||||
if ( m_albumPtr->infoLoaded() )
|
||||
if ( m_albumPtr->coverLoaded() )
|
||||
{
|
||||
if ( !m_albumPtr->cover( size ).isNull() )
|
||||
return m_albumPtr->cover( size );
|
||||
@ -790,6 +776,20 @@ Query::cover( const QSize& size, bool forceLoad ) const
|
||||
|
||||
return QPixmap();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Query::coverLoaded() const
|
||||
{
|
||||
if ( m_albumPtr.isNull() )
|
||||
return false;
|
||||
|
||||
if ( m_albumPtr->coverLoaded() && !m_albumPtr->cover( QSize( 0, 0 ) ).isNull() )
|
||||
return true;
|
||||
|
||||
return m_artistPtr->coverLoaded();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -145,6 +145,7 @@ public:
|
||||
#ifndef ENABLE_HEADLESS
|
||||
QPixmap cover( const QSize& size, bool forceLoad = true ) const;
|
||||
#endif
|
||||
bool coverLoaded() const;
|
||||
|
||||
void setResolveFinished( bool resolved ) { m_resolveFinished = resolved; }
|
||||
void setPlayedBy( const Tomahawk::source_ptr& source, unsigned int playtime );
|
||||
@ -198,10 +199,7 @@ public slots:
|
||||
void addArtists( const QList< Tomahawk::artist_ptr >& );
|
||||
|
||||
void onResolvingFinished();
|
||||
|
||||
// resolve if not solved()
|
||||
void onResolverAdded();
|
||||
void onResolverRemoved();
|
||||
|
||||
private slots:
|
||||
void infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QVariant output );
|
||||
|
@ -20,7 +20,9 @@
|
||||
|
||||
#include "Album.h"
|
||||
#include "Collection.h"
|
||||
#include "Resolver.h"
|
||||
#include "Source.h"
|
||||
#include "Pipeline.h"
|
||||
#include "database/Database.h"
|
||||
#include "database/DatabaseCommand_Resolve.h"
|
||||
#include "database/DatabaseCommand_AllTracks.h"
|
||||
@ -72,6 +74,7 @@ Result::Result( const QString& url )
|
||||
, m_trackId( 0 )
|
||||
, m_fileId( 0 )
|
||||
{
|
||||
connect( Pipeline::instance(), SIGNAL( resolverRemoved( Tomahawk::Resolver* ) ), SLOT( onResolverRemoved( Tomahawk::Resolver* ) ), Qt::QueuedConnection );
|
||||
}
|
||||
|
||||
|
||||
@ -94,12 +97,24 @@ Result::deleteLater()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Result::onResolverRemoved( Tomahawk::Resolver* resolver )
|
||||
{
|
||||
if ( m_resolvedBy.data() == resolver )
|
||||
{
|
||||
m_resolvedBy.clear();
|
||||
emit statusChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
artist_ptr
|
||||
Result::artist() const
|
||||
{
|
||||
return m_artist;
|
||||
}
|
||||
|
||||
|
||||
artist_ptr
|
||||
Result::composer() const
|
||||
{
|
||||
@ -124,18 +139,10 @@ Result::collection() const
|
||||
float
|
||||
Result::score() const
|
||||
{
|
||||
if ( !collection().isNull() && collection()->source()->isOnline() )
|
||||
{
|
||||
if ( isOnline() )
|
||||
return m_score;
|
||||
}
|
||||
else
|
||||
{
|
||||
// check if this a valid collection-less result (e.g. from youtube, but ignore offline sources still)
|
||||
if ( collection().isNull() )
|
||||
return m_score;
|
||||
else
|
||||
return 0.0;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
@ -152,7 +159,14 @@ Result::id() const
|
||||
bool
|
||||
Result::isOnline() const
|
||||
{
|
||||
return ( ( !collection().isNull() && collection()->source()->isOnline() ) || collection().isNull() );
|
||||
if ( !collection().isNull() )
|
||||
{
|
||||
return collection()->source()->isOnline();
|
||||
}
|
||||
else
|
||||
{
|
||||
return !m_resolvedBy.isNull();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -274,3 +288,20 @@ Result::friendlySource() const
|
||||
else
|
||||
return collection()->source()->friendlyName();
|
||||
}
|
||||
|
||||
|
||||
Tomahawk::Resolver*
|
||||
Result::resolvedBy() const
|
||||
{
|
||||
if ( m_resolvedBy.isNull() )
|
||||
return 0;
|
||||
|
||||
return m_resolvedBy.data();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Result::setResolvedBy( Tomahawk::Resolver* resolver )
|
||||
{
|
||||
m_resolvedBy = QWeakPointer< Tomahawk::Resolver >( resolver );
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ class DatabaseCommand_LoadFile;
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
||||
class Resolver;
|
||||
|
||||
class DLLEXPORT Result : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -54,6 +56,9 @@ public:
|
||||
QString toString() const;
|
||||
Tomahawk::query_ptr toQuery();
|
||||
|
||||
Tomahawk::Resolver* resolvedBy() const;
|
||||
void setResolvedBy( Tomahawk::Resolver* resolver );
|
||||
|
||||
float score() const;
|
||||
RID id() const;
|
||||
bool isOnline() const;
|
||||
@ -110,6 +115,8 @@ signals:
|
||||
private slots:
|
||||
void onOffline();
|
||||
void onOnline();
|
||||
|
||||
void onResolverRemoved( Tomahawk::Resolver* resolver );
|
||||
|
||||
private:
|
||||
// private constructor
|
||||
@ -121,6 +128,7 @@ private:
|
||||
mutable RID m_rid;
|
||||
collection_ptr m_collection;
|
||||
Tomahawk::query_ptr m_query;
|
||||
QWeakPointer< Tomahawk::Resolver > m_resolvedBy;
|
||||
|
||||
Tomahawk::artist_ptr m_artist;
|
||||
Tomahawk::album_ptr m_album;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "SourceList.h"
|
||||
#include "SourcePlaylistInterface.h"
|
||||
|
||||
#include "accounts/AccountManager.h"
|
||||
#include "network/ControlConnection.h"
|
||||
#include "database/DatabaseCommand_AddSource.h"
|
||||
#include "database/DatabaseCommand_CollectionStats.h"
|
||||
@ -33,11 +34,15 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QBuffer>
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/TomahawkCache.h"
|
||||
#include "database/DatabaseCommand_SocialAction.h"
|
||||
|
||||
#ifndef ENABLE_HEADLESS
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#endif
|
||||
|
||||
#include "utils/Logger.h"
|
||||
|
||||
using namespace Tomahawk;
|
||||
|
||||
|
||||
@ -58,13 +63,16 @@ Source::Source( int id, const QString& username )
|
||||
m_scrubFriendlyName = qApp->arguments().contains( "--demo" );
|
||||
|
||||
if ( id == 0 )
|
||||
{
|
||||
m_isLocal = true;
|
||||
m_online = true;
|
||||
}
|
||||
|
||||
m_currentTrackTimer.setSingleShot( true );
|
||||
connect( &m_currentTrackTimer, SIGNAL( timeout() ), this, SLOT( trackTimerFired() ) );
|
||||
|
||||
if ( m_isLocal )
|
||||
{
|
||||
connect( Accounts::AccountManager::instance(), SIGNAL( connected( Tomahawk::Accounts::Account* ) ), SLOT( setOnline() ) );
|
||||
connect( Accounts::AccountManager::instance(), SIGNAL( disconnected( Tomahawk::Accounts::Account* ) ), SLOT( setOffline() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +143,6 @@ Source::setAvatar( const QPixmap& avatar )
|
||||
buffer.open( QIODevice::WriteOnly );
|
||||
avatar.save( &buffer, "PNG" );
|
||||
|
||||
tDebug() << Q_FUNC_INFO << friendlyName() << m_username << ba.count();
|
||||
TomahawkUtils::Cache::instance()->putData( "Sources", 7776000000 /* 90 days */, m_username, ba );
|
||||
m_avatarUpdated = true;
|
||||
}
|
||||
@ -194,7 +201,10 @@ Source::setFriendlyName( const QString& fname )
|
||||
|
||||
m_friendlyname = fname;
|
||||
if ( m_scrubFriendlyName )
|
||||
m_friendlyname = m_friendlyname.split( "@" ).first();
|
||||
{
|
||||
if ( m_friendlyname.indexOf( "@" ) > 0 )
|
||||
m_friendlyname = m_friendlyname.split( "@" ).first();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -226,12 +236,15 @@ Source::setOffline()
|
||||
m_online = false;
|
||||
emit offline();
|
||||
|
||||
m_currentTrack.clear();
|
||||
emit stateChanged();
|
||||
if ( !isLocal() )
|
||||
{
|
||||
m_currentTrack.clear();
|
||||
emit stateChanged();
|
||||
|
||||
m_cc = 0;
|
||||
DatabaseCommand_SourceOffline* cmd = new DatabaseCommand_SourceOffline( id() );
|
||||
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
|
||||
m_cc = 0;
|
||||
DatabaseCommand_SourceOffline* cmd = new DatabaseCommand_SourceOffline( id() );
|
||||
Database::instance()->enqueue( QSharedPointer< DatabaseCommand >( cmd ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -245,11 +258,14 @@ Source::setOnline()
|
||||
m_online = true;
|
||||
emit online();
|
||||
|
||||
// ensure username is in the database
|
||||
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, friendlyName() );
|
||||
connect( cmd, SIGNAL( done( unsigned int, QString ) ),
|
||||
SLOT( dbLoaded( unsigned int, const QString& ) ) );
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||
if ( !isLocal() )
|
||||
{
|
||||
// ensure username is in the database
|
||||
DatabaseCommand_addSource* cmd = new DatabaseCommand_addSource( m_username, friendlyName() );
|
||||
connect( cmd, SIGNAL( done( unsigned int, QString ) ),
|
||||
SLOT( dbLoaded( unsigned int, const QString& ) ) );
|
||||
Database::instance()->enqueue( QSharedPointer<DatabaseCommand>(cmd) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -360,24 +376,27 @@ Source::playlistInterface()
|
||||
void
|
||||
Source::onPlaybackStarted( const Tomahawk::query_ptr& query, unsigned int duration )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << query->toString();
|
||||
tLog( LOGVERBOSE ) << Q_FUNC_INFO << query->toString();
|
||||
|
||||
m_currentTrack = query;
|
||||
m_currentTrackTimer.start( duration * 1000 + 900000 ); // duration comes in seconds
|
||||
|
||||
if ( m_playlistInterface.isNull() )
|
||||
playlistInterface();
|
||||
|
||||
emit playbackStarted( query );
|
||||
emit stateChanged();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Source::onPlaybackFinished( const Tomahawk::query_ptr& query )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO << query->toString();
|
||||
tDebug() << Q_FUNC_INFO << query->toString();
|
||||
emit playbackFinished( query );
|
||||
|
||||
m_currentTrackTimer.start();
|
||||
m_currentTrack.clear();
|
||||
emit stateChanged();
|
||||
}
|
||||
|
||||
|
||||
@ -385,7 +404,6 @@ void
|
||||
Source::trackTimerFired()
|
||||
{
|
||||
m_currentTrack.clear();
|
||||
|
||||
emit stateChanged();
|
||||
}
|
||||
|
||||
@ -507,3 +525,26 @@ Source::updateIndexWhenSynced()
|
||||
{
|
||||
m_updateIndexWhenSynced = true;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Source::textStatus() const
|
||||
{
|
||||
if ( !m_textStatus.isEmpty() )
|
||||
return m_textStatus;
|
||||
|
||||
if ( !currentTrack().isNull() )
|
||||
{
|
||||
return currentTrack()->artist() + " - " + currentTrack()->track();
|
||||
}
|
||||
|
||||
// do not use isOnline() here - it will always return true for the local source
|
||||
if ( m_online )
|
||||
{
|
||||
return tr( "Online" );
|
||||
}
|
||||
else
|
||||
{
|
||||
return tr( "Offline" );
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
virtual ~Source();
|
||||
|
||||
bool isLocal() const { return m_isLocal; }
|
||||
bool isOnline() const { return m_online; }
|
||||
bool isOnline() const { return m_online || m_isLocal; }
|
||||
|
||||
QString userName() const { return m_username; }
|
||||
QString friendlyName() const;
|
||||
@ -83,7 +83,7 @@ public:
|
||||
unsigned int trackCount() const;
|
||||
|
||||
Tomahawk::query_ptr currentTrack() const { return m_currentTrack; }
|
||||
QString textStatus() const { return m_textStatus; }
|
||||
QString textStatus() const;
|
||||
DBSyncConnection::State state() const { return m_state; }
|
||||
|
||||
Tomahawk::playlistinterface_ptr playlistInterface();
|
||||
|