mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
* Properly set empty tooltip for PlaylistModels/Views.
This commit is contained in:
@@ -84,6 +84,7 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
|||||||
.arg( TomahawkUtils::ageToString( QDateTime::fromTime_t( playlist->createdOn() ), true ) ) );
|
.arg( TomahawkUtils::ageToString( QDateTime::fromTime_t( playlist->createdOn() ), true ) ) );
|
||||||
|
|
||||||
m_isTemporary = false;
|
m_isTemporary = false;
|
||||||
|
emit playlistChanged();
|
||||||
|
|
||||||
if ( !loadEntries )
|
if ( !loadEntries )
|
||||||
{
|
{
|
||||||
@@ -92,8 +93,6 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
|||||||
}
|
}
|
||||||
|
|
||||||
QList<plentry_ptr> entries = playlist->entries();
|
QList<plentry_ptr> entries = playlist->entries();
|
||||||
|
|
||||||
qDebug() << "playlist loading entries:";
|
|
||||||
foreach( const plentry_ptr& p, entries )
|
foreach( const plentry_ptr& p, entries )
|
||||||
qDebug() << p->guid() << p->query()->track() << p->query()->artist();
|
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::Age, true ); // Hide age column per default
|
||||||
setColumnHidden( PlayableModel::Composer, true ); // Hide composer column per default
|
setColumnHidden( PlayableModel::Composer, true ); // Hide composer column per default
|
||||||
|
|
||||||
|
onChanged();
|
||||||
|
|
||||||
if ( guid().isEmpty() )
|
if ( guid().isEmpty() )
|
||||||
{
|
{
|
||||||
if ( !m_model->playlist().isNull() )
|
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( playlistDeleted() ), SLOT( onDeleted() ) );
|
||||||
connect( m_model, SIGNAL( playlistChanged() ), SLOT( onChanged() ) );
|
connect( m_model, SIGNAL( playlistChanged() ), SLOT( onChanged() ) );
|
||||||
|
|
||||||
@@ -130,10 +127,18 @@ PlaylistView::onDeleted()
|
|||||||
void
|
void
|
||||||
PlaylistView::onChanged()
|
PlaylistView::onChanged()
|
||||||
{
|
{
|
||||||
if ( m_model && !m_model->playlist().isNull() &&
|
if ( m_model )
|
||||||
ViewManager::instance()->currentPage() == this )
|
{
|
||||||
|
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() );
|
emit nameChanged( m_model->playlist()->title() );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Reference in New Issue
Block a user