1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Let GridView manage empty-tooltips, too.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 08:43:27 +02:00
parent 2aa71d130f
commit 11e1a410e8
2 changed files with 11 additions and 1 deletions

View File

@ -78,7 +78,6 @@ GridView::GridView( QWidget* parent )
/* m_overlay->setText( tr( "After you have scanned your music collection you will find your latest album additions right here." ) );
m_overlay->setText( tr( "This collection doesn't have any recent albums." ) );*/
m_overlay->setText( tr( "Nothing found." ) );
connect( this, SIGNAL( doubleClicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) );
connect( this, SIGNAL( customContextMenuRequested( QPoint ) ), SLOT( onCustomContextMenu( QPoint ) ) );
@ -133,6 +132,14 @@ GridView::setPlayableModel( PlayableModel* model )
}
void
GridView::setEmptyTip( const QString& tip )
{
m_emptyTip = tip;
m_overlay->setText( tip );
}
void
GridView::currentChanged( const QModelIndex& current, const QModelIndex& previous )
{

View File

@ -57,6 +57,8 @@ public:
void setPlayableModel( PlayableModel* model );
void setModel( QAbstractItemModel* model );
void setEmptyTip( const QString& tip );
virtual QWidget* widget() { return this; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->playlistInterface(); }
@ -100,6 +102,7 @@ private:
QModelIndex m_contextMenuIndex;
Tomahawk::ContextMenu* m_contextMenu;
QString m_emptyTip;
bool m_inited;
bool m_autoFitItems;