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

* Renamed AlbumView to GridView.

This commit is contained in:
Christian Muehlhaeuser 2012-06-01 05:19:43 +02:00
parent 6d9b41dc02
commit a61f602855
15 changed files with 71 additions and 71 deletions

View File

@ -62,7 +62,7 @@ set( libGuiSources
playlist/TrackHeader.cpp
playlist/AlbumModel.cpp
playlist/AlbumItemDelegate.cpp
playlist/AlbumView.cpp
playlist/GridView.cpp
playlist/ArtistView.cpp
playlist/CustomPlaylistView.cpp
playlist/ViewHeader.cpp

View File

@ -33,7 +33,7 @@
#include "PlayableProxyModel.h"
#include "PlayableModel.h"
#include "ArtistView.h"
#include "AlbumView.h"
#include "GridView.h"
#include "AlbumModel.h"
#include "SourceList.h"
#include "TomahawkSettings.h"
@ -99,9 +99,9 @@ ViewManager::ViewManager( QObject* parent )
m_superCollectionView->setShowModes( false );
// m_superCollectionView->proxyModel()->setShowOfflineResults( false );
m_superAlbumView = new AlbumView();
m_superAlbumModel = new AlbumModel( m_superAlbumView );
m_superAlbumView->setPlayableModel( m_superAlbumModel );
m_superGridView = new GridView();
m_superAlbumModel = new AlbumModel( m_superGridView );
m_superGridView->setPlayableModel( m_superAlbumModel );
m_stack->setContentsMargins( 0, 0, 0, 0 );
m_widget->setContentsMargins( 0, 0, 0, 0 );
@ -321,19 +321,19 @@ ViewManager::show( const Tomahawk::collection_ptr& collection )
if ( m_currentMode == PlaylistModes::Album )
{
AlbumView* aview;
if ( !m_collectionAlbumViews.contains( collection ) || m_collectionAlbumViews.value( collection ).isNull() )
GridView* aview;
if ( !m_collectionGridViews.contains( collection ) || m_collectionGridViews.value( collection ).isNull() )
{
aview = new AlbumView();
aview = new GridView();
AlbumModel* amodel = new AlbumModel( aview );
aview->setPlayableModel( amodel );
amodel->addCollection( collection );
m_collectionAlbumViews.insert( collection, aview );
m_collectionGridViews.insert( collection, aview );
}
else
{
aview = m_collectionAlbumViews.value( collection ).data();
aview = m_collectionGridViews.value( collection ).data();
}
shown = aview;
@ -406,8 +406,8 @@ ViewManager::showSuperCollection()
}
else if ( m_currentMode == PlaylistModes::Album )
{
shown = m_superAlbumView;
setPage( m_superAlbumView );
shown = m_superGridView;
setPage( m_superGridView );
}
emit numSourcesChanged( m_superCollections.count() );
@ -993,11 +993,11 @@ ViewManager::dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interf
Tomahawk::collection_ptr
ViewManager::collectionForInterface( Tomahawk::playlistinterface_ptr interface ) const
{
foreach ( QWeakPointer<AlbumView> view, m_collectionAlbumViews.values() )
foreach ( QWeakPointer<GridView> view, m_collectionGridViews.values() )
{
if ( view.data()->playlistInterface() == interface )
{
return m_collectionAlbumViews.key( view );
return m_collectionGridViews.key( view );
}
}
@ -1010,7 +1010,7 @@ ViewManager::isSuperCollectionVisible() const
{
return ( currentPage() != 0 &&
( currentPage()->playlistInterface() == m_superCollectionView->playlistInterface() ||
currentPage()->playlistInterface() == m_superAlbumView->playlistInterface() ) );
currentPage()->playlistInterface() == m_superGridView->playlistInterface() ) );
}
@ -1028,7 +1028,7 @@ ViewManager::showCurrentTrack()
if ( dynamic_cast< TrackView* >( page ) )
m_currentMode = PlaylistModes::Flat;
else if ( dynamic_cast< AlbumView* >( page ) )
else if ( dynamic_cast< GridView* >( page ) )
m_currentMode = PlaylistModes::Album;
else if ( dynamic_cast< ArtistView* >( page ) )
m_currentMode = PlaylistModes::Tree;

View File

@ -34,7 +34,7 @@
class AnimatedSplitter;
class AlbumModel;
class AlbumView;
class GridView;
class AlbumInfoWidget;
class ArtistInfoWidget;
class ArtistView;
@ -202,7 +202,7 @@ private:
AnimatedSplitter* m_splitter;
AlbumModel* m_superAlbumModel;
AlbumView* m_superAlbumView;
GridView* m_superGridView;
TreeModel* m_superCollectionModel;
ArtistView* m_superCollectionView;
QueueView* m_queue;
@ -216,7 +216,7 @@ private:
QHash< Tomahawk::dynplaylist_ptr, QWeakPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
QHash< Tomahawk::collection_ptr, QWeakPointer<ArtistView> > m_treeViews;
QHash< Tomahawk::collection_ptr, QWeakPointer<AlbumView> > m_collectionAlbumViews;
QHash< Tomahawk::collection_ptr, QWeakPointer<GridView> > m_collectionGridViews;
QHash< Tomahawk::artist_ptr, QWeakPointer<ArtistInfoWidget> > m_artistViews;
QHash< Tomahawk::album_ptr, QWeakPointer<AlbumInfoWidget> > m_albumViews;
QHash< Tomahawk::query_ptr, QWeakPointer<TrackInfoWidget> > m_trackViews;

View File

@ -37,7 +37,7 @@
#include "playlist/PlayableItem.h"
#include "playlist/PlayableProxyModel.h"
#include "AlbumView.h"
#include "GridView.h"
#include "ViewManager.h"
#include "utils/AnimatedSpinner.h"
#include "widgets/ImageButton.h"
@ -406,7 +406,7 @@ AlbumItemDelegate::modelChanged()
widget->deleteLater();
m_spinner.clear();
if ( AlbumView* view = qobject_cast< AlbumView* >( m_view ) )
if ( GridView* view = qobject_cast< GridView* >( m_view ) )
m_model = view->proxyModel();
}

View File

@ -17,7 +17,7 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AlbumView.h"
#include "GridView.h"
#include <QHeaderView>
#include <QKeyEvent>
@ -45,7 +45,7 @@
using namespace Tomahawk;
AlbumView::AlbumView( QWidget* parent )
GridView::GridView( QWidget* parent )
: QListView( parent )
, m_model( 0 )
, m_proxyModel( 0 )
@ -88,14 +88,14 @@ AlbumView::AlbumView( QWidget* parent )
}
AlbumView::~AlbumView()
GridView::~GridView()
{
qDebug() << Q_FUNC_INFO;
}
void
AlbumView::setProxyModel( PlayableProxyModel* model )
GridView::setProxyModel( PlayableProxyModel* model )
{
m_proxyModel = model;
m_delegate = new AlbumItemDelegate( this, m_proxyModel );
@ -107,7 +107,7 @@ AlbumView::setProxyModel( PlayableProxyModel* model )
void
AlbumView::setModel( QAbstractItemModel* model )
GridView::setModel( QAbstractItemModel* model )
{
Q_UNUSED( model );
qDebug() << "Explicitly use setAlbumModel instead";
@ -116,7 +116,7 @@ AlbumView::setModel( QAbstractItemModel* model )
void
AlbumView::setPlayableModel( PlayableModel* model )
GridView::setPlayableModel( PlayableModel* model )
{
m_inited = false;
m_model = model;
@ -134,7 +134,7 @@ AlbumView::setPlayableModel( PlayableModel* model )
void
AlbumView::currentChanged( const QModelIndex& current, const QModelIndex& previous )
GridView::currentChanged( const QModelIndex& current, const QModelIndex& previous )
{
QListView::currentChanged( current, previous );
@ -148,7 +148,7 @@ AlbumView::currentChanged( const QModelIndex& current, const QModelIndex& previo
void
AlbumView::onItemActivated( const QModelIndex& index )
GridView::onItemActivated( const QModelIndex& index )
{
PlayableItem* item = m_model->itemFromIndex( m_proxyModel->mapToSource( index ) );
if ( item )
@ -167,7 +167,7 @@ AlbumView::onItemActivated( const QModelIndex& index )
void
AlbumView::scrollContentsBy( int dx, int dy )
GridView::scrollContentsBy( int dx, int dy )
{
QListView::scrollContentsBy( dx, dy );
emit scrolledContents( dx, dy );
@ -175,7 +175,7 @@ AlbumView::scrollContentsBy( int dx, int dy )
void
AlbumView::paintEvent( QPaintEvent* event )
GridView::paintEvent( QPaintEvent* event )
{
if ( !autoFitItems() || m_inited || !m_proxyModel->rowCount() )
QListView::paintEvent( event );
@ -183,7 +183,7 @@ AlbumView::paintEvent( QPaintEvent* event )
void
AlbumView::resizeEvent( QResizeEvent* event )
GridView::resizeEvent( QResizeEvent* event )
{
QListView::resizeEvent( event );
layoutItems();
@ -191,7 +191,7 @@ AlbumView::resizeEvent( QResizeEvent* event )
void
AlbumView::layoutItems()
GridView::layoutItems()
{
if ( autoFitItems() && m_model )
{
@ -225,7 +225,7 @@ AlbumView::layoutItems()
void
AlbumView::onFilterChanged( const QString& )
GridView::onFilterChanged( const QString& )
{
if ( selectedIndexes().count() )
scrollTo( selectedIndexes().at( 0 ), QAbstractItemView::PositionAtCenter );
@ -233,7 +233,7 @@ AlbumView::onFilterChanged( const QString& )
void
AlbumView::startDrag( Qt::DropActions supportedActions )
GridView::startDrag( Qt::DropActions supportedActions )
{
QList<QPersistentModelIndex> pindexes;
QModelIndexList indexes;
@ -265,7 +265,7 @@ AlbumView::startDrag( Qt::DropActions supportedActions )
void
AlbumView::onCustomContextMenu( const QPoint& pos )
GridView::onCustomContextMenu( const QPoint& pos )
{
m_contextMenu->clear();

View File

@ -17,8 +17,8 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ALBUMVIEW_H
#define ALBUMVIEW_H
#ifndef GRIDVIEW_H
#define GRIDVIEW_H
#include <QListView>
#include <QSortFilterProxyModel>
@ -38,13 +38,13 @@ class AnimatedSpinner;
class AlbumItemDelegate;
class PlayableModel;
class DLLEXPORT AlbumView : public QListView, public Tomahawk::ViewPage
class DLLEXPORT GridView : public QListView, public Tomahawk::ViewPage
{
Q_OBJECT
public:
explicit AlbumView( QWidget* parent = 0 );
~AlbumView();
explicit GridView( QWidget* parent = 0 );
~GridView();
void setProxyModel( PlayableProxyModel* model );
@ -106,4 +106,4 @@ private:
QRect m_paintRect;
};
#endif // ALBUMVIEW_H
#endif // GRIDVIEW_H

View File

@ -16,7 +16,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="albumsView">
<widget class="GridView" name="albumsView">
<property name="dragEnabled">
<bool>true</bool>
</property>
@ -29,9 +29,9 @@
</widget>
<customwidgets>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header location="global">playlist/AlbumView.h</header>
<header location="global">playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>Tomahawk::Breadcrumb</class>

View File

@ -29,8 +29,8 @@
<property name="handleWidth">
<number>1</number>
</property>
<widget class="AlbumView" name="artistView"/>
<widget class="AlbumView" name="albumView"/>
<widget class="GridView" name="artistView"/>
<widget class="GridView" name="albumView"/>
</widget>
<widget class="PlaylistView" name="resultsView"/>
</widget>
@ -44,9 +44,9 @@
<header>playlist/PlaylistView.h</header>
</customwidget>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header>playlist/AlbumView.h</header>
<header>playlist/GridView.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@ -36,7 +36,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="newAlbumsView"/>
<widget class="GridView" name="newAlbumsView"/>
</item>
</layout>
</widget>
@ -92,9 +92,9 @@
<header location="global">widgets/HeaderLabel.h</header>
</customwidget>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header location="global">playlist/AlbumView.h</header>
<header location="global">playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>PlaylistWidget</class>

View File

@ -36,7 +36,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="additionsView">
<widget class="GridView" name="additionsView">
<property name="dragEnabled">
<bool>true</bool>
</property>
@ -94,9 +94,9 @@
<header location="global">widgets/HeaderLabel.h</header>
</customwidget>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header>playlist/AlbumView.h</header>
<header>playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>PlaylistView</class>

View File

@ -47,7 +47,7 @@
<widget class="QWidget" name="page2">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="AlbumView" name="albumsView">
<widget class="GridView" name="albumsView">
<property name="dragEnabled">
<bool>true</bool>
</property>
@ -64,9 +64,9 @@
</widget>
<customwidgets>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header location="global">playlist/AlbumView.h</header>
<header location="global">playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>ArtistView</class>

View File

@ -33,7 +33,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="albumsView"/>
<widget class="GridView" name="albumsView"/>
</item>
</layout>
</widget>
@ -53,9 +53,9 @@
<header location="global">ArtistView.h</header>
</customwidget>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header>playlist/AlbumView.h</header>
<header>playlist/GridView.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@ -57,7 +57,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="relatedArtists">
<widget class="GridView" name="relatedArtists">
</widget>
</item>
</layout>
@ -79,7 +79,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="albums"/>
<widget class="GridView" name="albums"/>
</item>
</layout>
</widget>
@ -114,9 +114,9 @@
<header location="global">ArtistView.h</header>
</customwidget>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header location="global">AlbumView.h</header>
<header location="global">GridView.h</header>
</customwidget>
</customwidgets>
<resources/>

View File

@ -32,7 +32,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="recentAlbumView">
<widget class="GridView" name="recentAlbumView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -107,9 +107,9 @@
<header location="global">widgets/HeaderLabel.h</header>
</customwidget>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header>playlist/AlbumView.h</header>
<header>playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>PlaylistView</class>

View File

@ -208,7 +208,7 @@
</widget>
</item>
<item>
<widget class="AlbumView" name="similarTracksView">
<widget class="GridView" name="similarTracksView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -224,9 +224,9 @@
</widget>
<customwidgets>
<customwidget>
<class>AlbumView</class>
<class>GridView</class>
<extends>QListView</extends>
<header>playlist/AlbumView.h</header>
<header>playlist/GridView.h</header>
</customwidget>
<customwidget>
<class>HeaderLabel</class>