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

* Renamed ArtistView to TreeView.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 05:58:42 +02:00
parent d97b83557b
commit 0abc1a4be9
14 changed files with 53 additions and 60 deletions

View File

@ -61,7 +61,7 @@ set( libGuiSources
playlist/AlbumModel.cpp
playlist/GridItemDelegate.cpp
playlist/GridView.cpp
playlist/ArtistView.cpp
playlist/TreeView.cpp
playlist/CustomPlaylistView.cpp
playlist/ViewHeader.cpp
playlist/RecentlyAddedModel.cpp

View File

@ -32,7 +32,7 @@
#include "PlaylistView.h"
#include "PlayableProxyModel.h"
#include "PlayableModel.h"
#include "ArtistView.h"
#include "TreeView.h"
#include "GridView.h"
#include "AlbumModel.h"
#include "SourceList.h"
@ -93,7 +93,7 @@ ViewManager::ViewManager( QObject* parent )
m_widget->layout()->addWidget( m_stack );
m_widget->layout()->addWidget( m_contextWidget );
m_superCollectionView = new ArtistView();
m_superCollectionView = new TreeView();
m_superCollectionModel = new TreeModel( m_superCollectionView );
m_superCollectionView->setTreeModel( m_superCollectionModel );
m_superCollectionView->setShowModes( false );
@ -299,10 +299,10 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
if ( m_currentMode == PlaylistModes::Tree )
{
ArtistView* view;
TreeView* view;
if ( !m_treeViews.contains( collection ) || m_treeViews.value( collection ).isNull() )
{
view = new ArtistView();
view = new TreeView();
TreeModel* model = new TreeModel();
view->setTreeModel( model );
@ -1030,7 +1030,7 @@ ViewManager::showCurrentTrack()
m_currentMode = PlaylistModes::Flat;
else if ( dynamic_cast< GridView* >( page ) )
m_currentMode = PlaylistModes::Album;
else if ( dynamic_cast< ArtistView* >( page ) )
else if ( dynamic_cast< TreeView* >( page ) )
m_currentMode = PlaylistModes::Tree;
else
return;
@ -1075,7 +1075,7 @@ ViewManager::recentPlaysWidget() const
}
ArtistView*
TreeView*
ViewManager::superCollectionView() const
{
return m_superCollectionView;

View File

@ -37,7 +37,7 @@ class AlbumModel;
class GridView;
class AlbumInfoWidget;
class ArtistInfoWidget;
class ArtistView;
class TreeView;
class CollectionModel;
class ContextWidget;
class PlaylistModel;
@ -92,7 +92,7 @@ public:
Tomahawk::ViewPage* newReleasesWidget() const;
Tomahawk::ViewPage* topLovedWidget() const;
Tomahawk::ViewPage* recentPlaysWidget() const;
ArtistView* superCollectionView() const;
TreeView* superCollectionView() const;
/// Get the view page for the given item. Not pretty...
Tomahawk::ViewPage* pageForPlaylist( const Tomahawk::playlist_ptr& pl ) const;
@ -204,7 +204,7 @@ private:
AlbumModel* m_superAlbumModel;
GridView* m_superGridView;
TreeModel* m_superCollectionModel;
ArtistView* m_superCollectionView;
TreeView* m_superCollectionView;
QueueView* m_queue;
WelcomeWidget* m_welcomeWidget;
WhatsHotWidget* m_whatsHotWidget;
@ -215,7 +215,7 @@ private:
QList< Tomahawk::collection_ptr > m_superCollections;
QHash< Tomahawk::dynplaylist_ptr, QWeakPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
QHash< Tomahawk::collection_ptr, QWeakPointer<ArtistView> > m_treeViews;
QHash< Tomahawk::collection_ptr, QWeakPointer<TreeView> > m_treeViews;
QHash< Tomahawk::collection_ptr, QWeakPointer<GridView> > m_collectionGridViews;
QHash< Tomahawk::artist_ptr, QWeakPointer<ArtistInfoWidget> > m_artistViews;
QHash< Tomahawk::album_ptr, QWeakPointer<AlbumInfoWidget> > m_albumViews;

View File

@ -29,8 +29,6 @@
#include "context/pages/TopTracksContext.h"
#include "context/pages/WikipediaContext.h"
#include "playlist/ArtistView.h"
#include "playlist/TreeModel.h"
#include "Source.h"
#include "utils/StyleHelper.h"

View File

@ -21,7 +21,7 @@
#include <QHeaderView>
#include "playlist/ArtistView.h"
#include "playlist/TreeView.h"
#include "playlist/TreeModel.h"
#include "Source.h"
@ -31,7 +31,7 @@ using namespace Tomahawk;
RelatedArtistsContext::RelatedArtistsContext()
: ContextPage()
{
m_relatedView = new ArtistView();
m_relatedView = new TreeView();
m_relatedView->setGuid( "RelatedArtistsContext" );
m_relatedView->setUpdatesContextView( false );
m_relatedModel = new TreeModel( m_relatedView );

View File

@ -30,7 +30,7 @@
#include "context/ContextPage.h"
class TreeModel;
class ArtistView;
class TreeView;
class DLLEXPORT RelatedArtistsContext : public Tomahawk::ContextPage
{
@ -58,7 +58,7 @@ private slots:
void onSimilarArtistsLoaded();
private:
ArtistView* m_relatedView;
TreeView* m_relatedView;
TreeModel* m_relatedModel;
QGraphicsProxyWidget* m_proxy;

View File

@ -35,10 +35,10 @@
#include "PlayableItem.h"
#include "TreeProxyModel.h"
#include "Source.h"
#include "ArtistView.h"
#include "TreeView.h"
TreeItemDelegate::TreeItemDelegate( ArtistView* parent, TreeProxyModel* proxy )
TreeItemDelegate::TreeItemDelegate( TreeView* parent, TreeProxyModel* proxy )
: QStyledItemDelegate( (QObject*)parent )
, m_view( parent )
, m_model( proxy )

View File

@ -28,7 +28,7 @@ namespace Tomahawk {
class PixmapDelegateFader;
}
class ArtistView;
class TreeView;
class TreeProxyModel;
class DLLEXPORT TreeItemDelegate : public QStyledItemDelegate
@ -36,7 +36,7 @@ class DLLEXPORT TreeItemDelegate : public QStyledItemDelegate
Q_OBJECT
public:
TreeItemDelegate( ArtistView* parent = 0, TreeProxyModel* proxy = 0 );
TreeItemDelegate( TreeView* parent = 0, TreeProxyModel* proxy = 0 );
protected:
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
@ -51,7 +51,7 @@ private slots:
void doUpdateIndex( const QPersistentModelIndex& index );
private:
ArtistView* m_view;
TreeView* m_view;
TreeProxyModel* m_model;
mutable QHash< QPersistentModelIndex, QSharedPointer< Tomahawk::PixmapDelegateFader > > m_pixmaps;

View File

@ -17,7 +17,7 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ArtistView.h"
#include "TreeView.h"
#include <QHeaderView>
#include <QKeyEvent>
@ -45,7 +45,7 @@
using namespace Tomahawk;
ArtistView::ArtistView( QWidget* parent )
TreeView::TreeView( QWidget* parent )
: QTreeView( parent )
, m_header( new ViewHeader( this ) )
, m_overlay( new OverlayWidget( this ) )
@ -98,14 +98,14 @@ ArtistView::ArtistView( QWidget* parent )
}
ArtistView::~ArtistView()
TreeView::~TreeView()
{
tDebug() << Q_FUNC_INFO;
}
void
ArtistView::setProxyModel( TreeProxyModel* model )
TreeView::setProxyModel( TreeProxyModel* model )
{
m_proxyModel = model;
TreeItemDelegate* del = new TreeItemDelegate( this, m_proxyModel );
@ -117,7 +117,7 @@ ArtistView::setProxyModel( TreeProxyModel* model )
void
ArtistView::setModel( QAbstractItemModel* model )
TreeView::setModel( QAbstractItemModel* model )
{
Q_UNUSED( model );
qDebug() << "Explicitly use setPlaylistModel instead";
@ -126,7 +126,7 @@ ArtistView::setModel( QAbstractItemModel* model )
void
ArtistView::setTreeModel( TreeModel* model )
TreeView::setTreeModel( TreeModel* model )
{
m_model = model;
@ -169,7 +169,7 @@ ArtistView::setTreeModel( TreeModel* model )
void
ArtistView::onViewChanged()
TreeView::onViewChanged()
{
if ( m_timer.isActive() )
m_timer.stop();
@ -179,7 +179,7 @@ ArtistView::onViewChanged()
void
ArtistView::onScrollTimeout()
TreeView::onScrollTimeout()
{
if ( m_timer.isActive() )
m_timer.stop();
@ -207,7 +207,7 @@ ArtistView::onScrollTimeout()
void
ArtistView::currentChanged( const QModelIndex& current, const QModelIndex& previous )
TreeView::currentChanged( const QModelIndex& current, const QModelIndex& previous )
{
QTreeView::currentChanged( current, previous );
@ -230,7 +230,7 @@ ArtistView::currentChanged( const QModelIndex& current, const QModelIndex& previ
void
ArtistView::onItemActivated( const QModelIndex& index )
TreeView::onItemActivated( const QModelIndex& index )
{
PlayableItem* item = m_model->itemFromIndex( m_proxyModel->mapToSource( index ) );
if ( item )
@ -249,7 +249,7 @@ ArtistView::onItemActivated( const QModelIndex& index )
void
ArtistView::keyPressEvent( QKeyEvent* event )
TreeView::keyPressEvent( QKeyEvent* event )
{
QTreeView::keyPressEvent( event );
@ -264,7 +264,7 @@ ArtistView::keyPressEvent( QKeyEvent* event )
void
ArtistView::resizeEvent( QResizeEvent* event )
TreeView::resizeEvent( QResizeEvent* event )
{
QTreeView::resizeEvent( event );
m_header->checkState();
@ -280,7 +280,7 @@ ArtistView::resizeEvent( QResizeEvent* event )
void
ArtistView::onItemCountChanged( unsigned int items )
TreeView::onItemCountChanged( unsigned int items )
{
if ( items == 0 )
{
@ -297,7 +297,7 @@ ArtistView::onItemCountChanged( unsigned int items )
void
ArtistView::onFilterChangeFinished()
TreeView::onFilterChangeFinished()
{
if ( selectedIndexes().count() )
scrollTo( selectedIndexes().at( 0 ), QAbstractItemView::PositionAtCenter );
@ -314,7 +314,7 @@ ArtistView::onFilterChangeFinished()
void
ArtistView::onFilteringStarted()
TreeView::onFilteringStarted()
{
m_overlay->hide();
m_loadingSpinner->fadeIn();
@ -322,7 +322,7 @@ ArtistView::onFilteringStarted()
void
ArtistView::startDrag( Qt::DropActions supportedActions )
TreeView::startDrag( Qt::DropActions supportedActions )
{
QList<QPersistentModelIndex> pindexes;
QModelIndexList indexes;
@ -362,7 +362,7 @@ ArtistView::startDrag( Qt::DropActions supportedActions )
void
ArtistView::onCustomContextMenu( const QPoint& pos )
TreeView::onCustomContextMenu( const QPoint& pos )
{
m_contextMenu->clear();
@ -403,7 +403,7 @@ ArtistView::onCustomContextMenu( const QPoint& pos )
void
ArtistView::onMenuTriggered( int action )
TreeView::onMenuTriggered( int action )
{
switch ( action )
{
@ -418,7 +418,7 @@ ArtistView::onMenuTriggered( int action )
bool
ArtistView::jumpToCurrentTrack()
TreeView::jumpToCurrentTrack()
{
if ( !m_proxyModel )
return false;
@ -429,7 +429,7 @@ ArtistView::jumpToCurrentTrack()
QString
ArtistView::guid() const
TreeView::guid() const
{
if ( m_guid.isEmpty() )
{

View File

@ -17,8 +17,8 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ARTISTVIEW_H
#define ARTISTVIEW_H
#ifndef TREEVIEW_H
#define TREEVIEW_H
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QTreeView>
@ -41,13 +41,13 @@ class AnimatedSpinner;
class OverlayWidget;
class TreeModel;
class DLLEXPORT ArtistView : public QTreeView, public Tomahawk::ViewPage
class DLLEXPORT TreeView : public QTreeView, public Tomahawk::ViewPage
{
Q_OBJECT
public:
explicit ArtistView( QWidget* parent = 0 );
~ArtistView();
explicit TreeView( QWidget* parent = 0 );
~TreeView();
virtual QString guid() const;
virtual void setGuid( const QString& guid ) { m_guid = guid; }
@ -122,4 +122,4 @@ private:
mutable QString m_guid;
};
#endif // ARTISTVIEW_H
#endif // TREEVIEW_H

View File

@ -33,7 +33,7 @@
<widget class="QWidget" name="page1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="ArtistView" name="artistsViewLeft">
<widget class="TreeView" name="artistsViewLeft">
<property name="minimumSize">
<size>
<width>320</width>
@ -69,9 +69,9 @@
<header location="global">playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>ArtistView</class>
<class>TreeView</class>
<extends>QTreeView</extends>
<header>ArtistView.h</header>
<header>TreeView.h</header>
</customwidget>
<customwidget>
<class>PlaylistView</class>

View File

@ -22,7 +22,7 @@
<property name="handleWidth">
<number>1</number>
</property>
<widget class="ArtistView" name="tracksView"/>
<widget class="TreeView" name="tracksView"/>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@ -48,9 +48,9 @@
<header location="global">widgets/HeaderLabel.h</header>
</customwidget>
<customwidget>
<class>ArtistView</class>
<class>TreeView</class>
<extends>QTreeView</extends>
<header location="global">ArtistView.h</header>
<header location="global">TreeView.h</header>
</customwidget>
<customwidget>
<class>GridView</class>

View File

@ -108,11 +108,6 @@
<extends>QPushButton</extends>
<header location="global">widgets/ToggleButton.h</header>
</customwidget>
<customwidget>
<class>ArtistView</class>
<extends>QTreeView</extends>
<header location="global">ArtistView.h</header>
</customwidget>
<customwidget>
<class>GridView</class>
<extends>QListView</extends>

View File

@ -40,7 +40,7 @@
#include "GlobalActionManager.h"
#include "DropJob.h"
#include "items/PlaylistItems.h"
#include "playlist/ArtistView.h"
#include "playlist/TreeView.h"
#include "playlist/PlaylistView.h"
#include "playlist/dynamic/widgets/DynamicWidget.h"