mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
Add generic page item for new view pages
This commit is contained in:
@@ -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 )
|
||||||
{
|
{
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user