1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 05:07:27 +02:00

Open playlist on click

This commit is contained in:
Uwe L. Korn
2013-07-30 13:21:28 +02:00
parent 6080e75f51
commit 76dc215036
2 changed files with 12 additions and 7 deletions

View File

@@ -32,9 +32,11 @@
#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 "widgets/RecentlyPlayedPlaylistsModel.h"
#include "MetaPlaylistInterface.h" #include "MetaPlaylistInterface.h"
#include "Pipeline.h" #include "Pipeline.h"
#include "PlaylistDelegate.h" #include "PlaylistDelegate.h"
#include "ViewManager.h"
#include <QDateTime> #include <QDateTime>
#include <QStandardItemModel> #include <QStandardItemModel>
@@ -177,9 +179,7 @@ NetworkActivityWidget::NetworkActivityWidget( QWidget* parent )
TomahawkStyle::styleScrollBar( d->ui->playlistView->verticalScrollBar() ); TomahawkStyle::styleScrollBar( d->ui->playlistView->verticalScrollBar() );
TomahawkStyle::stylePageFrame( d->ui->playlistsFrame ); TomahawkStyle::stylePageFrame( d->ui->playlistsFrame );
// updatePlaylists(); connect( d->ui->playlistView, SIGNAL( activated( QModelIndex ) ), SLOT( onPlaylistActivated( QModelIndex ) ) );
// connect( ui->playlistWidget, SIGNAL( activated( QModelIndex ) ), SLOT( onPlaylistActivated( QModelIndex ) ) );
// connect( model, SIGNAL( emptinessChanged( bool ) ), this, SLOT( updatePlaylists() ) );
} }
// Trending artists // Trending artists
@@ -248,10 +248,6 @@ NetworkActivityWidget::NetworkActivityWidget( QWidget* parent )
// connect( d->workerThread, SIGNAL( finished() ), d->workerThread, SLOT( deleteLater() ), Qt::QueuedConnection ); // connect( d->workerThread, SIGNAL( finished() ), d->workerThread, SLOT( deleteLater() ), Qt::QueuedConnection );
// connect( d->workerThread, SIGNAL( destroyed() ), d->worker, SLOT( deleteLater() ), Qt::QueuedConnection ); // connect( d->workerThread, SIGNAL( destroyed() ), d->worker, SLOT( deleteLater() ), Qt::QueuedConnection );
QMetaObject::invokeMethod( d->worker, "run", Qt::QueuedConnection ); QMetaObject::invokeMethod( d->worker, "run", Qt::QueuedConnection );
// FIXME: Activate hot playlists again
// d->ui->playlistsFrame->hide();
} }
@@ -422,6 +418,14 @@ NetworkActivityWidget::leftCrumbIndexChanged( const QModelIndex& index )
} }
void
NetworkActivityWidget::onPlaylistActivated( const QModelIndex& item )
{
Tomahawk::playlist_ptr pl = item.data( RecentlyPlayedPlaylistsModel::PlaylistRole ).value< Tomahawk::playlist_ptr >();
ViewManager::instance()->show( pl );
}
void void
NetworkActivityWidget::fetchYearCharts() NetworkActivityWidget::fetchYearCharts()
{ {

View File

@@ -79,6 +79,7 @@ private slots:
void trendingTracks( const QList< Tomahawk::track_ptr >& tracks ); void trendingTracks( const QList< Tomahawk::track_ptr >& tracks );
void leftCrumbIndexChanged( const QModelIndex& ); void leftCrumbIndexChanged( const QModelIndex& );
void onPlaylistActivated( const QModelIndex& );
private: private:
void fetchWeekCharts(); void fetchWeekCharts();