mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-21 05:11:44 +02:00
Fix current track related things in NetworkActivity
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include "utils/TomahawkUtilsGui.h"
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "widgets/OverlayWidget.h"
|
#include "widgets/OverlayWidget.h"
|
||||||
#include "widgets/PlaylistsModel.h"
|
#include "widgets/PlaylistsModel.h"
|
||||||
|
#include "MetaPlaylistInterface.h"
|
||||||
#include "Pipeline.h"
|
#include "Pipeline.h"
|
||||||
#include "PlaylistDelegate.h"
|
#include "PlaylistDelegate.h"
|
||||||
|
|
||||||
@@ -92,8 +93,6 @@ NetworkActivityWidget::NetworkActivityWidget( QWidget* parent )
|
|||||||
d->ui->tracksViewLeft->setSortingEnabled( false );
|
d->ui->tracksViewLeft->setSortingEnabled( false );
|
||||||
d->ui->tracksViewLeft->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
|
d->ui->tracksViewLeft->setEmptyTip( tr( "Sorry, we could not find any top hits for this artist!" ) );
|
||||||
|
|
||||||
d->playlistInterface = d->ui->tracksViewLeft->playlistInterface();
|
|
||||||
|
|
||||||
QPalette p = d->ui->tracksViewLeft->palette();
|
QPalette p = d->ui->tracksViewLeft->palette();
|
||||||
p.setColor( QPalette::Text, TomahawkStyle::PAGE_TRACKLIST_TRACK_SOLVED );
|
p.setColor( QPalette::Text, TomahawkStyle::PAGE_TRACKLIST_TRACK_SOLVED );
|
||||||
p.setColor( QPalette::BrightText, TomahawkStyle::PAGE_TRACKLIST_TRACK_UNRESOLVED );
|
p.setColor( QPalette::BrightText, TomahawkStyle::PAGE_TRACKLIST_TRACK_UNRESOLVED );
|
||||||
@@ -198,6 +197,12 @@ NetworkActivityWidget::NetworkActivityWidget( QWidget* parent )
|
|||||||
TomahawkUtils::unmarginLayout( layout );
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MetaPlaylistInterface* mpl = new MetaPlaylistInterface();
|
||||||
|
mpl->addChildInterface( d->ui->trendingTracksView->playlistInterface() );
|
||||||
|
mpl->addChildInterface( d->ui->tracksViewLeft->playlistInterface() );
|
||||||
|
d->playlistInterface = playlistinterface_ptr( mpl );
|
||||||
|
|
||||||
|
|
||||||
// Load data in separate thread
|
// Load data in separate thread
|
||||||
d->workerThread = new QThread();
|
d->workerThread = new QThread();
|
||||||
d->workerThread->start();
|
d->workerThread->start();
|
||||||
@@ -244,7 +249,12 @@ NetworkActivityWidget::pixmap() const
|
|||||||
bool
|
bool
|
||||||
NetworkActivityWidget::isBeingPlayed() const
|
NetworkActivityWidget::isBeingPlayed() const
|
||||||
{
|
{
|
||||||
if ( AudioEngine::instance()->currentTrackPlaylist() == d_func()->ui->tracksViewLeft->playlistInterface() )
|
Q_D( const NetworkActivityWidget );
|
||||||
|
|
||||||
|
if ( AudioEngine::instance()->currentTrackPlaylist() == d->ui->tracksViewLeft->playlistInterface() )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if ( AudioEngine::instance()->currentTrackPlaylist() == d->ui->trendingTracksView->playlistInterface() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -254,7 +264,12 @@ NetworkActivityWidget::isBeingPlayed() const
|
|||||||
bool
|
bool
|
||||||
NetworkActivityWidget::jumpToCurrentTrack()
|
NetworkActivityWidget::jumpToCurrentTrack()
|
||||||
{
|
{
|
||||||
if ( d_func()->ui->tracksViewLeft->model() && d_func()->ui->tracksViewLeft->jumpToCurrentTrack() )
|
Q_D( NetworkActivityWidget );
|
||||||
|
|
||||||
|
if ( d->ui->tracksViewLeft->model() && d_func()->ui->tracksViewLeft->jumpToCurrentTrack() )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if ( d->ui->trendingTracksView->model() && d_func()->ui->trendingTracksView->jumpToCurrentTrack() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user