mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +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 );
|
weekItem->setData( WeekChart, Breadcrumb::DefaultRole );
|
||||||
chartItem->appendRow( weekItem );
|
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->sortedProxy->setSourceModel( d->crumbModelLeft );
|
||||||
d->ui->breadCrumbLeft->setModel( d->sortedProxy );
|
d->ui->breadCrumbLeft->setModel( d->sortedProxy );
|
||||||
d->ui->breadCrumbLeft->setVisible( true );
|
d->ui->breadCrumbLeft->setVisible( true );
|
||||||
@@ -415,6 +426,10 @@ NetworkActivityWidget::leftCrumbIndexChanged( const QModelIndex& index )
|
|||||||
case OverallChart:
|
case OverallChart:
|
||||||
showOverallCharts();
|
showOverallCharts();
|
||||||
break;
|
break;
|
||||||
|
case TopLoved:
|
||||||
|
break;
|
||||||
|
case RecentlyLoved:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -534,7 +549,7 @@ NetworkActivityWidget::showOverallCharts()
|
|||||||
d->activeView = OverallChart;
|
d->activeView = OverallChart;
|
||||||
if ( !d->overallChartsModel.isNull() )
|
if ( !d->overallChartsModel.isNull() )
|
||||||
{
|
{
|
||||||
d->ui->tracksViewLeft->setPlaylistModel( d_func()->overallChartsModel );
|
d->ui->tracksViewLeft->setPlaylistModel( d->overallChartsModel );
|
||||||
d->ui->tracksViewLeft->setAutoResize( true );
|
d->ui->tracksViewLeft->setAutoResize( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -44,7 +44,16 @@ class TOMAHAWK_WIDGETS_EXPORT NetworkActivityWidget : public QWidget, public Tom
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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(QWidget* parent = 0);
|
||||||
~NetworkActivityWidget();
|
~NetworkActivityWidget();
|
||||||
|
|
||||||
@@ -86,11 +95,15 @@ private:
|
|||||||
void fetchMonthCharts();
|
void fetchMonthCharts();
|
||||||
void fetchYearCharts();
|
void fetchYearCharts();
|
||||||
void fetchOverallCharts();
|
void fetchOverallCharts();
|
||||||
|
void fetchTopLoved();
|
||||||
|
void fetchRecentlyLoved();
|
||||||
|
|
||||||
void showWeekCharts();
|
void showWeekCharts();
|
||||||
void showMonthCharts();
|
void showMonthCharts();
|
||||||
void showYearCharts();
|
void showYearCharts();
|
||||||
void showOverallCharts();
|
void showOverallCharts();
|
||||||
|
void showTopLoved();
|
||||||
|
void showRecentlyLoved();
|
||||||
|
|
||||||
Q_DECLARE_PRIVATE( NetworkActivityWidget )
|
Q_DECLARE_PRIVATE( NetworkActivityWidget )
|
||||||
};
|
};
|
||||||
|
@@ -55,6 +55,8 @@ private:
|
|||||||
QPointer<PlaylistModel> monthlyChartsModel;
|
QPointer<PlaylistModel> monthlyChartsModel;
|
||||||
QPointer<PlaylistModel> yearlyChartsModel;
|
QPointer<PlaylistModel> yearlyChartsModel;
|
||||||
QPointer<PlaylistModel> overallChartsModel;
|
QPointer<PlaylistModel> overallChartsModel;
|
||||||
|
QPointer<PlaylistModel> topLovedModel;
|
||||||
|
QPointer<PlaylistModel> recentlyLovedModel;
|
||||||
|
|
||||||
QPointer<PlaylistModel> trendingTracksModel;
|
QPointer<PlaylistModel> trendingTracksModel;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user