mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
* Properly set empty tooltip for PlaylistModels/Views.
This commit is contained in:
parent
43c1c498d6
commit
2aa71d130f
@ -84,6 +84,7 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
||||
.arg( TomahawkUtils::ageToString( QDateTime::fromTime_t( playlist->createdOn() ), true ) ) );
|
||||
|
||||
m_isTemporary = false;
|
||||
emit playlistChanged();
|
||||
|
||||
if ( !loadEntries )
|
||||
{
|
||||
@ -92,8 +93,6 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
||||
}
|
||||
|
||||
QList<plentry_ptr> entries = playlist->entries();
|
||||
|
||||
qDebug() << "playlist loading entries:";
|
||||
foreach( const plentry_ptr& p, entries )
|
||||
qDebug() << p->guid() << p->query()->track() << p->query()->artist();
|
||||
|
||||
|
@ -62,6 +62,8 @@ PlaylistView::setPlaylistModel( PlaylistModel* model )
|
||||
setColumnHidden( PlayableModel::Age, true ); // Hide age column per default
|
||||
setColumnHidden( PlayableModel::Composer, true ); // Hide composer column per default
|
||||
|
||||
onChanged();
|
||||
|
||||
if ( guid().isEmpty() )
|
||||
{
|
||||
if ( !m_model->playlist().isNull() )
|
||||
@ -74,11 +76,6 @@ PlaylistView::setPlaylistModel( PlaylistModel* model )
|
||||
}
|
||||
}
|
||||
|
||||
if ( model->isReadOnly() )
|
||||
setEmptyTip( tr( "This playlist is currently empty." ) );
|
||||
else
|
||||
setEmptyTip( tr( "This playlist is currently empty. Add some tracks to it and enjoy the music!" ) );
|
||||
|
||||
connect( m_model, SIGNAL( playlistDeleted() ), SLOT( onDeleted() ) );
|
||||
connect( m_model, SIGNAL( playlistChanged() ), SLOT( onChanged() ) );
|
||||
|
||||
@ -130,9 +127,17 @@ PlaylistView::onDeleted()
|
||||
void
|
||||
PlaylistView::onChanged()
|
||||
{
|
||||
if ( m_model && !m_model->playlist().isNull() &&
|
||||
ViewManager::instance()->currentPage() == this )
|
||||
emit nameChanged( m_model->playlist()->title() );
|
||||
if ( m_model )
|
||||
{
|
||||
if ( m_model->isReadOnly() )
|
||||
setEmptyTip( tr( "This playlist is currently empty." ) );
|
||||
else
|
||||
setEmptyTip( tr( "This playlist is currently empty. Add some tracks to it and enjoy the music!" ) );
|
||||
m_model->finishLoading();
|
||||
|
||||
if ( !m_model->playlist().isNull() && ViewManager::instance()->currentPage() == this )
|
||||
emit nameChanged( m_model->playlist()->title() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user