1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

Add generic page item for new view pages

This commit is contained in:
Dominik Schmidt
2013-06-16 19:35:58 +02:00
parent 9d532d6285
commit 4bd3ff8c18
2 changed files with 12 additions and 3 deletions

View File

@@ -59,9 +59,6 @@ SourcesModel::SourcesModel( QObject* parent )
appendGroups(); appendGroups();
// Add stub page
appendPageItem( ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ), "Stub Page", "stub");
onSourcesAdded( SourceList::instance()->sources() ); onSourcesAdded( SourceList::instance()->sources() );
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ),
@@ -80,6 +77,9 @@ SourcesModel::SourcesModel( QObject* parent )
this, SLOT( onScriptCollectionAdded( Tomahawk::collection_ptr ) ) ); this, SLOT( onScriptCollectionAdded( Tomahawk::collection_ptr ) ) );
connect( SourceList::instance(), SIGNAL( scriptCollectionRemoved( Tomahawk::collection_ptr ) ), connect( SourceList::instance(), SIGNAL( scriptCollectionRemoved( Tomahawk::collection_ptr ) ),
this, SLOT( onScriptCollectionRemoved( Tomahawk::collection_ptr ) ) ); this, SLOT( onScriptCollectionRemoved( Tomahawk::collection_ptr ) ) );
connect( ViewManager::instance(), SIGNAL( viewPageAdded( QString ) ), SLOT( onViewPageAdded( QString ) ) );
} }
@@ -672,6 +672,13 @@ SourcesModel::onWidgetDestroyed( QWidget* w )
} }
void
SourcesModel::onViewPageAdded( const QString& name )
{
appendPageItem( ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ), name, name);
}
void void
SourcesModel::removeSourceItemLink( SourceTreeItem* item ) SourcesModel::removeSourceItemLink( SourceTreeItem* item )
{ {

View File

@@ -151,6 +151,8 @@ private slots:
void onWidgetDestroyed( QWidget* w ); void onWidgetDestroyed( QWidget* w );
void onViewPageAdded( const QString& name );
private: private:
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const; SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
int rowForItem( SourceTreeItem* item ) const; int rowForItem( SourceTreeItem* item ) const;