mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* Set proper defautl empty-tooltips for PlaylistViews.
This commit is contained in:
@@ -22,7 +22,6 @@
|
|||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
#include "widgets/OverlayWidget.h"
|
|
||||||
#include "ViewManager.h"
|
#include "ViewManager.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "PlaylistUpdaterInterface.h"
|
#include "PlaylistUpdaterInterface.h"
|
||||||
@@ -75,7 +74,11 @@ PlaylistView::setPlaylistModel( PlaylistModel* model )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connect( m_model, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) );
|
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() ) );
|
||||||
|
|
||||||
@@ -117,19 +120,6 @@ PlaylistView::updaters() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
PlaylistView::onTrackCountChanged( unsigned int tracks )
|
|
||||||
{
|
|
||||||
if ( tracks == 0 )
|
|
||||||
{
|
|
||||||
overlay()->setText( tr( "This playlist is currently empty. Add some tracks to it and enjoy the music!" ) );
|
|
||||||
overlay()->show();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
overlay()->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PlaylistView::onDeleted()
|
PlaylistView::onDeleted()
|
||||||
{
|
{
|
||||||
|
@@ -52,7 +52,6 @@ protected:
|
|||||||
void keyPressEvent( QKeyEvent* event );
|
void keyPressEvent( QKeyEvent* event );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onTrackCountChanged( unsigned int tracks );
|
|
||||||
void onMenuTriggered( int action );
|
void onMenuTriggered( int action );
|
||||||
void deleteItems();
|
void deleteItems();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user