1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Merge branch 'master' of github.com:tomahawk-player/tomahawk

This commit is contained in:
Jason Herskowitz 2013-01-03 08:58:15 -05:00
commit 4d319d4802
11 changed files with 4380 additions and 65 deletions

View File

@ -14,10 +14,9 @@ SET( TOMAHAWK_DESCRIPTION_SUMMARY "The social media player" )
SET( TOMAHAWK_VERSION_MAJOR 0 )
SET( TOMAHAWK_VERSION_MINOR 5 )
SET( TOMAHAWK_VERSION_PATCH 99 )
#SET( TOMAHAWK_VERSION_RC 0 )
SET( TOMAHAWK_TRANSLATION_LANGUAGES ar bg ca de en es fi fr ja pl pt_BR ru sv tr zh_CN zh_TW )
SET( TOMAHAWK_TRANSLATION_LANGUAGES ar bg bn_IN ca cs de en el es fi fr hi_IN hu gl it ja lt pl pt_BR ru sv tr zh_CN zh_TW )
# enforce proper symbol exporting on all platforms
add_definitions( "-fvisibility=hidden" )

View File

@ -217,7 +217,7 @@ TOMAHAWK_PLUGINS = [
]
QT_PLUGINS_SEARCH_PATH=[
'/usr/local/Cellar/qt/4.8.2/plugins',
'/usr/local/Cellar/qt/4.8.4/plugins',
]

4242
lang/tomahawk_cs.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -547,7 +547,7 @@ de se connecter et streamer de vous?</translation>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp" line="59"/>
<source>Steer this station:</source>
<translation type="unfinished"/>
<translation>Modifier cette station :</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp" line="82"/>
@ -632,12 +632,12 @@ de se connecter et streamer de vous?</translation>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp" line="113"/>
<source>Apply steering command</source>
<translation type="unfinished"/>
<translation>Appliquer la modification</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.cpp" line="119"/>
<source>Reset all steering commands</source>
<translation type="unfinished"/>
<translation>Annuler toutes les modifications</translation>
</message>
</context>
<context>
@ -1017,42 +1017,42 @@ de se connecter et streamer de vous?</translation>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="50"/>
<source>Accuracy</source>
<translation type="unfinished"/>
<translation>Précision</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="241"/>
<source>Perfect match</source>
<translation type="unfinished"/>
<translation>Correspondance parfaite</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="243"/>
<source>Very good match</source>
<translation type="unfinished"/>
<translation>Très bonne correspondance</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="245"/>
<source>Good match</source>
<translation type="unfinished"/>
<translation>Bonne correspondance</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="247"/>
<source>Vague match</source>
<translation type="unfinished"/>
<translation>Vague correspondance</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="249"/>
<source>Bad match</source>
<translation type="unfinished"/>
<translation>Mauvaise correspondance</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="251"/>
<source>Very bad match</source>
<translation type="unfinished"/>
<translation>Très mauvaise correspondance</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="253"/>
<source>Not available</source>
<translation type="unfinished"/>
<translation>Indisponible</translation>
</message>
<message>
<location filename="../src/libtomahawk/playlist/PlayableModel.cpp" line="50"/>
@ -1328,13 +1328,13 @@ de se connecter et streamer de vous?</translation>
<location filename="../src/libtomahawk/utils/GuiHelpers.cpp" line="102"/>
<location filename="../src/libtomahawk/utils/GuiHelpers.cpp" line="113"/>
<source>%1 Config</source>
<translation type="unfinished"/>
<translation>%1 Configuration</translation>
</message>
<message>
<location filename="../src/libtomahawk/utils/GuiHelpers.cpp" line="142"/>
<location filename="../src/libtomahawk/utils/GuiHelpers.cpp" line="157"/>
<source>%1 Configuration</source>
<translation type="unfinished"/>
<translation>%1 Configuration</translation>
</message>
</context>
<context>
@ -2418,7 +2418,7 @@ Essayez de vous authentifier de nouveau.</translation>
<location filename="../src/accounts/zeroconf/ZeroconfAccount.cpp" line="67"/>
<location filename="../src/accounts/zeroconf/ZeroconfAccount.cpp" line="68"/>
<source>Local Network</source>
<translation type="unfinished"/>
<translation>Réseau local</translation>
</message>
</context>
<context>
@ -2426,7 +2426,7 @@ Essayez de vous authentifier de nouveau.</translation>
<message>
<location filename="../src/accounts/zeroconf/ZeroconfAccount.h" line="42"/>
<source>Local Network</source>
<translation type="unfinished"/>
<translation>Réseau local</translation>
</message>
<message>
<location filename="../src/accounts/zeroconf/ZeroconfAccount.h" line="43"/>
@ -3146,7 +3146,7 @@ Essayez de changer les filtres pour avoir de nouveaux morceaux à jouer.</transl
<message numerus="yes">
<location filename="../src/libtomahawk/Query.cpp" line="776"/>
<source>%n people</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation>
<translation><numerusform>%n personne</numerusform><numerusform>%n personnes</numerusform></translation>
</message>
<message>
<location filename="../src/libtomahawk/Query.cpp" line="778"/>
@ -3175,7 +3175,7 @@ Essayez de changer les filtres pour avoir de nouveaux morceaux à jouer.</transl
<message>
<location filename="../src/libtomahawk/utils/SoundcloudParser.cpp" line="112"/>
<source>Track &apos;%1&apos; by %2 is not streamable.</source>
<translation type="unfinished"/>
<translation>La piste &apos;%1&apos; par %2 n&apos;est pas écoutable.</translation>
</message>
</context>
<context>
@ -3266,7 +3266,7 @@ saisissez le numéro PIN ici :</translation>
<message>
<location filename="../src/libtomahawk/TomahawkSettings.cpp" line="375"/>
<source>Local Network</source>
<translation type="unfinished"/>
<translation>Réseau local</translation>
</message>
</context>
<context>
@ -3547,7 +3547,7 @@ saisissez le numéro PIN ici :</translation>
<message>
<location filename="../src/TomahawkWindow.cpp" line="985"/>
<source>Sorry, there is a problem accessing your audio device or the desired track, current track will be skipped.</source>
<translation>Désolé, il y a un problème d&apos;accès à votre matériel audio ou la piste en cours va être sauter.</translation>
<translation>Désolé, il y a un problème d&apos;accès à votre matériel audio ou la piste en cours , celle-ci va être sautée.</translation>
</message>
<message>
<location filename="../src/TomahawkWindow.cpp" line="1017"/>

View File

@ -1,33 +1,33 @@
macro(add_tomahawk_translations language)
list(APPEND TOMAHAWK_LANGUAGES ${ARGV})
list( APPEND TOMAHAWK_LANGUAGES ${ARGV} )
set(tomahawk_i18n_qrc_content "<!DOCTYPE RCC><RCC version=\"1.0\">\n")
set( tomahawk_i18n_qrc_content "<!DOCTYPE RCC><RCC version=\"1.0\">\n" )
# 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")
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()
# build explicitly enabled languages
list(APPEND TS_FILES "${CMAKE_SOURCE_DIR}/lang/tomahawk_${lang}.ts")
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")
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}" )
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc "${tomahawk_i18n_qrc_content}" )
QT4_ADD_TRANSLATION(QM_FILES ${TS_FILES})
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)
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(

View File

@ -171,7 +171,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
QPixmap p = index.data( Qt::DecorationRole ).value< QPixmap >();
QRect pixmapRect( leftEdge + PADDING, center - ICONSIZE/2, ICONSIZE, ICONSIZE );
if ( p.isNull() ) // default image... TODO
p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOnline, TomahawkUtils::Original, pixmapRect.size() );
p = TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, pixmapRect.size() );
else
p = p.scaled( pixmapRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation );

View File

@ -232,6 +232,11 @@ ResolverAccount::resolverChanged()
emit connectionStateChanged( connectionState() );
}
QPixmap
ResolverAccount::icon() const
{
return m_resolver.data()->icon();
}
/// AtticaResolverAccount

View File

@ -77,8 +77,9 @@ public:
QString path() const;
virtual QPixmap icon() const;
// Not relevant
virtual QPixmap icon() const { return QPixmap(); }
virtual SipPlugin* sipPlugin() { return 0; }
virtual Tomahawk::InfoSystem::InfoPluginPtr infoPlugin() { return Tomahawk::InfoSystem::InfoPluginPtr(); }
virtual QWidget* aclWidget() { return 0; }

View File

@ -18,7 +18,9 @@
#include "PlayableCover.h"
#include "Artist.h"
#include "Album.h"
#include "ViewManager.h"
#include "audio/AudioEngine.h"
#include "widgets/ImageButton.h"
#include "utils/TomahawkUtilsGui.h"
@ -77,6 +79,56 @@ PlayableCover::resizeEvent( QResizeEvent* event )
}
void
PlayableCover::mouseMoveEvent( QMouseEvent* event )
{
QLabel::mouseMoveEvent( event );
foreach ( const QRect& rect, m_itemRects )
{
if ( rect.contains( event->pos() ) )
{
if ( m_hoveredRect != rect )
{
setCursor( Qt::PointingHandCursor );
m_hoveredRect = rect;
repaint();
}
return;
}
}
if ( !m_hoveredRect.isNull() )
{
setCursor( Qt::ArrowCursor );
m_hoveredRect = QRect();
repaint();
}
}
void
PlayableCover::mouseReleaseEvent( QMouseEvent* event )
{
QLabel::mouseReleaseEvent( event );
foreach ( const QRect& rect, m_itemRects )
{
if ( rect.contains( event->pos() ) )
{
if ( m_artist )
ViewManager::instance()->show( m_artist );
else if ( m_album )
ViewManager::instance()->show( m_album->artist() );
else if ( m_query )
ViewManager::instance()->show( Tomahawk::Artist::get( m_query->artist() ) );
return;
}
}
}
void
PlayableCover::setPixmap( const QPixmap& pixmap )
{
@ -87,6 +139,8 @@ PlayableCover::setPixmap( const QPixmap& pixmap )
void
PlayableCover::paintEvent( QPaintEvent* event )
{
Q_UNUSED( event );
QPainter painter( this );
painter.setRenderHint( QPainter::Antialiasing );
painter.drawPixmap( 0, 0, pixmap() );
@ -98,6 +152,7 @@ PlayableCover::paintEvent( QPaintEvent* event )
QPixmap buffer( r.size() );
buffer.fill( Qt::transparent );
QPainter bufpainter( &buffer );
bufpainter.setRenderHint( QPainter::Antialiasing );
QTextOption to;
to.setWrapMode( QTextOption::NoWrap );
@ -181,18 +236,25 @@ PlayableCover::paintEvent( QPaintEvent* event )
bufpainter.drawText( textRect, text, to );
bufpainter.setFont( font );
// If the user is hovering over an artist rect, draw a background so she knows it's clickable
QRect r = textRect;
r.setTop( r.bottom() - bufpainter.fontMetrics().height() );
r.adjust( 4, 0, -4, -1 );
/* if ( m_hoveringOver == index )
text = bufpainter.fontMetrics().elidedText( bottom, Qt::ElideRight, textRect.width() - 16 );
int textWidth = bufpainter.fontMetrics().width( text );
r.adjust( ( r.width() - textWidth ) / 2 - 6, 0, - ( ( r.width() - textWidth ) / 2 - 6 ), 0 );
m_itemRects.clear();
m_itemRects << r;
if ( m_hoveredRect == r )
{
TomahawkUtils::drawQueryBackground( bufpainter, opt.palette, r, 1.1 );
bufpainter.setPen( opt.palette.color( QPalette::HighlightedText ) );
}*/
TomahawkUtils::drawQueryBackground( &bufpainter, palette(), r, 1.1 );
bufpainter.setPen( Qt::white );
}
to.setAlignment( Qt::AlignHCenter | Qt::AlignBottom );
text = bufpainter.fontMetrics().elidedText( bottom, Qt::ElideRight, textRect.width() - 16 );
bufpainter.drawText( textRect.adjusted( 5, -1, -5, -1 ), text, to );
}

View File

@ -56,6 +56,9 @@ protected:
virtual void resizeEvent( QResizeEvent* event );
virtual void paintEvent( QPaintEvent* event );
virtual void mouseMoveEvent( QMouseEvent* event );
virtual void mouseReleaseEvent( QMouseEvent* event );
void leaveEvent( QEvent* event );
void enterEvent( QEvent* event );
@ -70,6 +73,9 @@ private:
Tomahawk::album_ptr m_album;
Tomahawk::query_ptr m_query;
QList< QRect > m_itemRects;
QRect m_hoveredRect;
bool m_showText;
};

View File

@ -43,11 +43,11 @@ Api_v1::Api_v1(QxtAbstractWebSessionManager* sm, QObject* parent)
void
Api_v1::auth_1( QxtWebRequestEvent* event, QString arg )
{
qDebug() << "AUTH_1 HTTP" << event->url.toString() << arg;
tDebug( LOGVERBOSE ) << "AUTH_1 HTTP" << event->url.toString() << arg;
if ( !event->url.hasQueryItem( "website" ) || !event->url.hasQueryItem( "name" ) )
{
qDebug() << "Malformed HTTP resolve request";
tDebug( LOGVERBOSE ) << "Malformed HTTP resolve request";
send404( event );
return;
}
@ -80,10 +80,10 @@ Api_v1::auth_1( QxtWebRequestEvent* event, QString arg )
void
Api_v1::auth_2( QxtWebRequestEvent* event, QString arg )
{
qDebug() << "AUTH_2 HTTP" << event->url.toString() << arg;
tDebug( LOGVERBOSE ) << "AUTH_2 HTTP" << event->url.toString() << arg;
if ( event->content.isNull() )
{
qDebug() << "Null content";
tDebug( LOGVERBOSE ) << "Null content";
send404( event );
return;
}
@ -99,13 +99,13 @@ Api_v1::auth_2( QxtWebRequestEvent* event, QString arg )
if ( keyval.size() == 2 )
queryItems.insert( keyval.first(), keyval.last() );
else
qDebug() << "Failed parsing url parameters:" << part;
tDebug( LOGVERBOSE ) << "Failed parsing url parameters:" << part;
}
qDebug() << "has query items:" << pieces;
tDebug( LOGVERBOSE ) << "has query items:" << pieces;
if ( !params.contains( "website" ) || !params.contains( "name" ) || !params.contains( "formtoken" ) )
{
qDebug() << "Malformed HTTP resolve request";
tDebug( LOGVERBOSE ) << "Malformed HTTP resolve request";
send404( event );
return;
}
@ -113,7 +113,7 @@ Api_v1::auth_2( QxtWebRequestEvent* event, QString arg )
QString website = queryItems[ "website" ];
QString name = queryItems[ "name" ];
QByteArray authtoken = uuid().toLatin1();
qDebug() << "HEADERS:" << event->headers;
tDebug( LOGVERBOSE ) << "HEADERS:" << event->headers;
if ( !queryItems.contains( "receiverurl" ) || queryItems.value( "receiverurl" ).isEmpty() )
{
//no receiver url, so do it ourselves
@ -139,7 +139,7 @@ Api_v1::auth_2( QxtWebRequestEvent* event, QString arg )
// do what the client wants
QUrl receiverurl = QUrl( queryItems.value( "receiverurl" ), QUrl::TolerantMode );
receiverurl.addEncodedQueryItem( "authtoken", "#" + authtoken );
qDebug() << "Got receiver url:" << receiverurl.toString();
tDebug( LOGVERBOSE ) << "Got receiver url:" << receiverurl.toString();
QxtWebRedirectEvent* e = new QxtWebRedirectEvent( event->sessionID, event->requestID, receiverurl.toString() );
postEvent( e );
@ -155,7 +155,7 @@ Api_v1::auth_2( QxtWebRequestEvent* event, QString arg )
void
Api_v1::api( QxtWebRequestEvent* event )
{
qDebug() << "HTTP" << event->url.toString();
tDebug( LOGVERBOSE ) << "HTTP" << event->url.toString();
const QUrl& url = event->url;
if ( url.hasQueryItem( "method" ) )
@ -178,7 +178,7 @@ Api_v1::sid( QxtWebRequestEvent* event, QString unused )
Q_UNUSED( unused );
RID rid = event->url.path().mid( 5 );
qDebug() << "Request for sid" << rid;
tDebug( LOGVERBOSE ) << "Request for sid" << rid;
result_ptr rp = Pipeline::instance()->result( rid );
if ( rp.isNull() )
@ -204,7 +204,7 @@ Api_v1::sid( QxtWebRequestEvent* event, QString unused )
void
Api_v1::send404( QxtWebRequestEvent* event )
{
qDebug() << "404" << event->url.toString();
tDebug() << "404" << event->url.toString();
QxtWebPageEvent* wpe = new QxtWebPageEvent( event->sessionID, event->requestID, "<h1>Not Found</h1>" );
wpe->status = 404;
wpe->statusMessage = "no event found";
@ -215,11 +215,11 @@ Api_v1::send404( QxtWebRequestEvent* event )
void
Api_v1::stat( QxtWebRequestEvent* event )
{
qDebug() << "Got Stat request:" << event->url.toString();
tDebug( LOGVERBOSE ) << "Got Stat request:" << event->url.toString();
m_storedEvent = event;
if ( !event->content.isNull() )
qDebug() << "BODY:" << event->content->readAll();
tDebug( LOGVERBOSE ) << "BODY:" << event->content->readAll();
if ( event->url.hasQueryItem( "auth" ) )
{
@ -262,7 +262,7 @@ Api_v1::resolve( QxtWebRequestEvent* event )
if ( !event->url.hasQueryItem( "artist" ) ||
!event->url.hasQueryItem( "track" ) )
{
qDebug() << "Malformed HTTP resolve request";
tDebug( LOGVERBOSE ) << "Malformed HTTP resolve request";
return send404( event );
}
@ -273,7 +273,7 @@ Api_v1::resolve( QxtWebRequestEvent* event )
if ( artist.trimmed().isEmpty() ||
track.trimmed().isEmpty() )
{
qDebug() << "Malformed HTTP resolve request";
tDebug( LOGVERBOSE ) << "Malformed HTTP resolve request";
return send404( event );
}
@ -300,7 +300,7 @@ Api_v1::resolve( QxtWebRequestEvent* event )
void
Api_v1::staticdata( QxtWebRequestEvent* event, const QString& str )
{
qDebug() << "STATIC request:" << event << str;
tDebug( LOGVERBOSE ) << "STATIC request:" << event << str;
if ( str.contains( "tomahawk_auth_logo.png" ) )
{
QFile f( RESPATH "www/tomahawk_banner_small.png" );
@ -318,7 +318,7 @@ Api_v1::get_results( QxtWebRequestEvent* event )
{
if ( !event->url.hasQueryItem( "qid" ) )
{
tDebug() << "Malformed HTTP get_results request";
tDebug( LOGVERBOSE ) << "Malformed HTTP get_results request";
send404( event );
return;
}
@ -372,7 +372,7 @@ Api_v1::sendJSON( const QVariantMap& m, QxtWebRequestEvent* event )
e->contentType = ctype;
e->headers.insert( "Content-Length", QString::number( body.length() ) );
postEvent( e );
qDebug() << "JSON response" << event->url.toString() << body;
tDebug( LOGVERBOSE ) << "JSON response" << event->url.toString() << body;
}