mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Add breadcrumbs for Top Loved
This commit is contained in:
@@ -81,6 +81,17 @@ NetworkActivityWidget::NetworkActivityWidget( QWidget* parent )
|
||||
weekItem->setData( WeekChart, Breadcrumb::DefaultRole );
|
||||
chartItem->appendRow( weekItem );
|
||||
}
|
||||
// Breadcrumbs for Loved Tracks
|
||||
{
|
||||
QStandardItem* lovedItem = new QStandardItem( tr( "Loved Tracks" ) );
|
||||
rootItem->appendRow( lovedItem );
|
||||
QStandardItem* topItem = new QStandardItem( tr( "Top Loved" ) );
|
||||
topItem->setData( TopLoved, Breadcrumb::DefaultRole );
|
||||
lovedItem->appendRow( topItem );
|
||||
QStandardItem* recentlyItem = new QStandardItem( tr( "Recently Loved" ) );
|
||||
recentlyItem->setData( TopLoved, Breadcrumb::DefaultRole );
|
||||
lovedItem->appendRow( recentlyItem );
|
||||
}
|
||||
d->sortedProxy->setSourceModel( d->crumbModelLeft );
|
||||
d->ui->breadCrumbLeft->setModel( d->sortedProxy );
|
||||
d->ui->breadCrumbLeft->setVisible( true );
|
||||
@@ -415,6 +426,10 @@ NetworkActivityWidget::leftCrumbIndexChanged( const QModelIndex& index )
|
||||
case OverallChart:
|
||||
showOverallCharts();
|
||||
break;
|
||||
case TopLoved:
|
||||
break;
|
||||
case RecentlyLoved:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -534,7 +549,7 @@ NetworkActivityWidget::showOverallCharts()
|
||||
d->activeView = OverallChart;
|
||||
if ( !d->overallChartsModel.isNull() )
|
||||
{
|
||||
d->ui->tracksViewLeft->setPlaylistModel( d_func()->overallChartsModel );
|
||||
d->ui->tracksViewLeft->setPlaylistModel( d->overallChartsModel );
|
||||
d->ui->tracksViewLeft->setAutoResize( true );
|
||||
}
|
||||
else
|
||||
|
@@ -44,7 +44,16 @@ class TOMAHAWK_WIDGETS_EXPORT NetworkActivityWidget : public QWidget, public Tom
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum ViewType { WeekChart = 1, MonthChart = 2, YearChart = 3, OverallChart = 4 };
|
||||
enum ViewType
|
||||
{
|
||||
WeekChart = 1,
|
||||
MonthChart = 2,
|
||||
YearChart = 3,
|
||||
OverallChart = 4,
|
||||
TopLoved = 5,
|
||||
RecentlyLoved = 6
|
||||
};
|
||||
|
||||
NetworkActivityWidget(QWidget* parent = 0);
|
||||
~NetworkActivityWidget();
|
||||
|
||||
@@ -86,11 +95,15 @@ private:
|
||||
void fetchMonthCharts();
|
||||
void fetchYearCharts();
|
||||
void fetchOverallCharts();
|
||||
void fetchTopLoved();
|
||||
void fetchRecentlyLoved();
|
||||
|
||||
void showWeekCharts();
|
||||
void showMonthCharts();
|
||||
void showYearCharts();
|
||||
void showOverallCharts();
|
||||
void showTopLoved();
|
||||
void showRecentlyLoved();
|
||||
|
||||
Q_DECLARE_PRIVATE( NetworkActivityWidget )
|
||||
};
|
||||
|
@@ -55,6 +55,8 @@ private:
|
||||
QPointer<PlaylistModel> monthlyChartsModel;
|
||||
QPointer<PlaylistModel> yearlyChartsModel;
|
||||
QPointer<PlaylistModel> overallChartsModel;
|
||||
QPointer<PlaylistModel> topLovedModel;
|
||||
QPointer<PlaylistModel> recentlyLovedModel;
|
||||
|
||||
QPointer<PlaylistModel> trendingTracksModel;
|
||||
|
||||
|
Reference in New Issue
Block a user