mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-14 04:51:53 +02:00
Show an error message when the station couldn't resolve enough tracks
This commit is contained in:
parent
31691e8461
commit
819810e2ab
@ -112,7 +112,7 @@ DynamicModel::trackResolveFinished( bool success )
|
||||
if( m_currentAttempts < 30 ) {
|
||||
m_playlist->generator()->fetchNext();
|
||||
} else {
|
||||
// TODO handle failure
|
||||
emit trackGenerationFailure( tr( "Could not find a playable track.\n\nPlease change the filters and try again." ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class StationModelItem;
|
||||
|
||||
|
||||
/**
|
||||
* Extends PlaylistModel with support for handling StationModelItems
|
||||
* Extends PlaylistModel with support for handling stations
|
||||
*/
|
||||
class DynamicModel : public PlaylistModel
|
||||
{
|
||||
@ -45,6 +45,8 @@ public:
|
||||
signals:
|
||||
void collapseFromTo( int startRow, int num );
|
||||
|
||||
void trackGenerationFailure( const QString& msg );
|
||||
|
||||
private slots:
|
||||
void newTrackGenerated( const Tomahawk::query_ptr& query );
|
||||
|
||||
|
@ -78,6 +78,14 @@ DynamicView::showMessageTimeout( const QString& title, const QString& body )
|
||||
overlay()->show( 5 );
|
||||
}
|
||||
|
||||
void
|
||||
DynamicView::showMessage(const QString& message)
|
||||
{
|
||||
overlay()->setText( message );
|
||||
overlay()->show();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DynamicView::onTrackCountChanged( unsigned int tracks )
|
||||
{
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
|
||||
public slots:
|
||||
void showMessageTimeout( const QString& title, const QString& body );
|
||||
void showMessage( const QString& message );
|
||||
|
||||
// collapse and animate the transition
|
||||
// there MUST be a row *after* startRow + num. that is, you can't collapse
|
||||
|
@ -112,7 +112,8 @@ DynamicControlWrapper::removeFromLayout()
|
||||
}
|
||||
|
||||
|
||||
QToolButton* DynamicControlWrapper::initButton( QWidget* parent )
|
||||
QToolButton*
|
||||
DynamicControlWrapper::initButton( QWidget* parent )
|
||||
{
|
||||
QToolButton* btn = new QToolButton( parent );
|
||||
btn->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
|
||||
@ -123,7 +124,8 @@ QToolButton* DynamicControlWrapper::initButton( QWidget* parent )
|
||||
return btn;
|
||||
}
|
||||
|
||||
QWidget* DynamicControlWrapper::createDummy( QWidget* fromW, QWidget* parent )
|
||||
QWidget*
|
||||
DynamicControlWrapper::createDummy( QWidget* fromW, QWidget* parent )
|
||||
{
|
||||
QWidget* dummy = new QWidget( parent );
|
||||
dummy->setContentsMargins( 0, 0, 0, 0 );
|
||||
|
@ -90,8 +90,9 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
|
||||
m_view->setModel( m_model );
|
||||
m_view->setContentsMargins( 0, 0, 0, 0 );
|
||||
m_layout->addWidget( m_view, 1 );
|
||||
|
||||
connect( m_model, SIGNAL( collapseFromTo( int, int ) ), m_view, SLOT( collapseEntries( int, int ) ), Qt::QueuedConnection );
|
||||
|
||||
connect( m_model, SIGNAL( trackGenerationFailure( QString ) ), m_view, SLOT( showMessage( QString ) ) );
|
||||
loadDynamicPlaylist( playlist );
|
||||
|
||||
m_layout->setContentsMargins( 0, 0, 0, 0 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user