1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-07 17:42:35 +02:00

fix some station workflow issues

This commit is contained in:
Leo Franchi 2011-03-03 17:40:00 -05:00
parent c915d76255
commit dfc57b156f
2 changed files with 10 additions and 4 deletions

View File

@ -92,6 +92,7 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
connect( PlaylistManager::instance(), SIGNAL( playClicked() ), this, SLOT( playPressed() ) );
connect( PlaylistManager::instance(), SIGNAL( pauseClicked() ), this, SLOT( pausePressed() ) );
connect( AudioEngine::instance(), SIGNAL( playlistChanged( PlaylistInterface* ) ), this, SLOT( playlistStopped( PlaylistInterface* ) ) );
}
DynamicWidget::~DynamicWidget()
@ -207,18 +208,22 @@ DynamicWidget::layoutFloatingWidgets()
}
void
DynamicWidget::hideEvent( QHideEvent* ev )
DynamicWidget::playlistStopped( PlaylistInterface* pl )
{
if( pl == static_cast< PlaylistInterface* >( m_view->proxyModel() ) ) // same playlist, so don't stop
return;
// user started playing something somewhere else, so give it a rest
if( m_runningOnDemand ) {
stopStation( false );
m_model->clear();
}
QWidget::hideEvent( ev );
}
void
DynamicWidget::showEvent(QShowEvent* )
{
if( !m_playlist.isNull() ) {
if( !m_playlist.isNull() && !m_runningOnDemand ) {
m_setup->fadeIn();
}
}

View File

@ -67,7 +67,6 @@ public:
virtual QSize sizeHint() const;
virtual void resizeEvent( QResizeEvent* );
virtual void hideEvent(QHideEvent* );
virtual void showEvent(QShowEvent* );
static void paintRoundedFilledRect( QPainter& p, QPalette& pal, QRect& r, qreal opacity = .95 );
@ -90,6 +89,8 @@ public slots:
void pausePressed();
void stationFailed( const QString& );
void playlistStopped( PlaylistInterface* );
private slots:
void generate( int = -1 );
void tracksGenerated( const QList< Tomahawk::query_ptr>& queries );