1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 13:17:34 +02:00

* Fixed selecting Super Collection when it becomes active.

This commit is contained in:
Christian Muehlhaeuser
2011-02-27 05:03:18 +01:00
parent 5ac6a0309c
commit 8945577fcd
2 changed files with 22 additions and 25 deletions

View File

@@ -47,7 +47,6 @@ PlaylistManager::PlaylistManager( QObject* parent )
, m_widget( new QWidget() )
, m_welcomeWidget( new WelcomeWidget() )
, m_currentMode( 0 )
, m_superCollectionVisible( true )
{
s_instance = this;
@@ -151,11 +150,9 @@ PlaylistManager::show( const Tomahawk::playlist_ptr& playlist )
}
setPage( view );
m_superCollectionVisible = false;
TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( playlist );
emit numSourcesChanged( SourceList::instance()->count() );
return true;
}
@@ -177,11 +174,9 @@ PlaylistManager::show( const Tomahawk::dynplaylist_ptr& playlist )
else
m_queueView->show();
m_superCollectionVisible = false;
TomahawkSettings::instance()->appendRecentlyPlayedPlaylist( playlist );
emit numSourcesChanged( SourceList::instance()->count() );
return true;
}
@@ -208,9 +203,8 @@ PlaylistManager::show( const Tomahawk::artist_ptr& artist )
}
setPage( view );
m_superCollectionVisible = false;
emit numSourcesChanged( 1 );
return true;
}
@@ -236,9 +230,8 @@ PlaylistManager::show( const Tomahawk::album_ptr& album )
}
setPage( view );
m_superCollectionVisible = false;
emit numSourcesChanged( 1 );
return true;
}
@@ -291,9 +284,8 @@ PlaylistManager::show( const Tomahawk::collection_ptr& collection )
setPage( aview );
}
m_superCollectionVisible = false;
emit numSourcesChanged( 1 );
return true;
}
@@ -313,9 +305,8 @@ PlaylistManager::show( const Tomahawk::source_ptr& source )
}
setPage( swidget );
m_superCollectionVisible = false;
emit numSourcesChanged( 1 );
return true;
}
@@ -329,7 +320,6 @@ PlaylistManager::show( ViewPage* page )
}
setPage( page );
m_superCollectionVisible = false;
return true;
}
@@ -360,9 +350,8 @@ PlaylistManager::showSuperCollection()
setPage( m_superAlbumView );
}
m_superCollectionVisible = true;
emit numSourcesChanged( m_superCollections.count() );
return true;
}
@@ -381,7 +370,7 @@ PlaylistManager::setTableMode()
m_currentMode = 0;
if ( m_superCollectionVisible )
if ( isSuperCollectionVisible() )
showSuperCollection();
else
show( m_currentCollection );
@@ -397,7 +386,7 @@ PlaylistManager::setTreeMode()
m_currentMode = 1;
if ( m_superCollectionVisible )
if ( isSuperCollectionVisible() )
showSuperCollection();
else
show( m_currentCollection );
@@ -411,7 +400,7 @@ PlaylistManager::setAlbumMode()
m_currentMode = 2;
if ( m_superCollectionVisible )
if ( isSuperCollectionVisible() )
showSuperCollection();
else
show( m_currentCollection );
@@ -531,6 +520,8 @@ PlaylistManager::setPage( ViewPage* page, bool trackHistory )
emit dynamicPlaylistActivated( dynamicPlaylistForInterface( currentPlaylistInterface() ) );
if ( collectionForInterface( currentPlaylistInterface() ) )
emit collectionActivated( collectionForInterface( currentPlaylistInterface() ) );
if ( isSuperCollectionVisible() )
emit superCollectionActivated();
if ( !currentPlaylistInterface() )
emit tempPageActivated();
@@ -781,6 +772,15 @@ PlaylistManager::collectionForInterface( PlaylistInterface* interface ) const
}
bool
PlaylistManager::isSuperCollectionVisible() const
{
return ( m_pageHistory.count() &&
( currentPage()->playlistInterface() == m_superCollectionView->playlistInterface() ||
currentPage()->playlistInterface() == m_superAlbumView->playlistInterface() ) );
}
void
PlaylistManager::showCurrentTrack()
{

View File

@@ -46,7 +46,7 @@ public:
QWidget* widget() const { return m_widget; }
PlaylistView* queue() const;
bool isSuperCollectionVisible() const { return true; }
bool isSuperCollectionVisible() const;
PlaylistInterface* currentPlaylistInterface() const;
Tomahawk::ViewPage* currentPage() const;
@@ -118,7 +118,6 @@ public slots:
private slots:
void applyFilter();
void onWidgetDestroyed( QWidget* widget );
private:
@@ -160,9 +159,7 @@ private:
int m_historyPosition;
Tomahawk::collection_ptr m_currentCollection;
int m_currentMode;
bool m_superCollectionVisible;
QTimer m_filterTimer;
QString m_filter;