mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-31 06:02:27 +02:00
fix a few more things
This commit is contained in:
parent
062cf35324
commit
632889b590
@ -99,7 +99,6 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
||||
int c = rowCount( QModelIndex() );
|
||||
|
||||
qDebug() << "Starting loading" << playlist->title();
|
||||
emit loadingStarted();
|
||||
emit beginInsertRows( QModelIndex(), c, c + entries.count() - 1 );
|
||||
|
||||
m_waitingForResolved.clear();
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "collection.h"
|
||||
#include "playlistinterface.h"
|
||||
#include "viewpage.h"
|
||||
#include "widgets/welcomewidget.h"
|
||||
|
||||
#include "dllmacro.h"
|
||||
|
||||
@ -85,7 +86,7 @@ public:
|
||||
|
||||
Tomahawk::ViewPage* show( Tomahawk::ViewPage* page );
|
||||
|
||||
WelcomeWidget* welcomeWidget() const { return m_welcomeWidget; }
|
||||
Tomahawk::ViewPage* welcomeWidget() const { return m_welcomeWidget; }
|
||||
ArtistView* superCollectionView() const { return m_superCollectionView; }
|
||||
|
||||
/// Get the view page for the given item. Not pretty...
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "welcomewidget.h"
|
||||
#include "ui_welcomewidget.h"
|
||||
|
||||
#include "audio/audioengine.h"
|
||||
#include "utils/tomahawkutils.h"
|
||||
|
||||
#include "viewmanager.h"
|
||||
@ -56,6 +57,7 @@ WelcomeWidget::WelcomeWidget( QWidget* parent )
|
||||
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) );
|
||||
|
||||
connect( ui->playlistWidget, SIGNAL( itemActivated( QListWidgetItem* ) ), SLOT( onPlaylistActivated( QListWidgetItem* ) ) );
|
||||
connect( AudioEngine::instance() ,SIGNAL( playlistChanged( PlaylistInterface* ) ), this, SLOT( updatePlaylists() ), Qt::QueuedConnection );
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,13 +22,15 @@
|
||||
using namespace Tomahawk;
|
||||
|
||||
/// Generic page item
|
||||
GenericPageItem::GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, boost::function< ViewPage* () > func )
|
||||
GenericPageItem::GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, boost::function< ViewPage* () > show, boost::function< ViewPage* () > get )
|
||||
: SourceTreeItem( model, parent, SourcesModel::GenericPage )
|
||||
, m_icon( icon )
|
||||
, m_text( text )
|
||||
, m_func( func )
|
||||
, m_show( show )
|
||||
, m_get( get )
|
||||
{
|
||||
|
||||
if( ViewPage* p = m_get() )
|
||||
model->linkSourceItemToPage( this, p );
|
||||
}
|
||||
|
||||
GenericPageItem::~GenericPageItem()
|
||||
@ -39,7 +41,7 @@ GenericPageItem::~GenericPageItem()
|
||||
void
|
||||
GenericPageItem::activate()
|
||||
{
|
||||
ViewPage* p = m_func();
|
||||
ViewPage* p = m_show();
|
||||
model()->linkSourceItemToPage( this, p );
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,8 @@ class GenericPageItem : public SourceTreeItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, boost::function<Tomahawk::ViewPage*()> func );
|
||||
// takes 2 function pointers: show: called when wanting to show the desired view page. get: called to get the view page from ViewManager if it exists
|
||||
GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, boost::function<Tomahawk::ViewPage*()> show, boost::function<Tomahawk::ViewPage*()> get );
|
||||
virtual ~GenericPageItem();
|
||||
|
||||
virtual QString text() const;
|
||||
@ -41,7 +42,8 @@ signals:
|
||||
private:
|
||||
QIcon m_icon;
|
||||
QString m_text;
|
||||
boost::function< Tomahawk::ViewPage*() > m_func;
|
||||
boost::function< Tomahawk::ViewPage*() > m_show;
|
||||
boost::function< Tomahawk::ViewPage*() > m_get;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -44,7 +44,10 @@ SourcesModel::SourcesModel( QObject* parent )
|
||||
appendItem( source_ptr() );
|
||||
|
||||
// add misc children of root node
|
||||
GenericPageItem* recent = new GenericPageItem( this, m_rootItem->children().at( 0 ), tr( "Recently Played" ), QIcon( RESPATH "images/recently-played.png" ), boost::bind( &ViewManager::showWelcomePage, ViewManager::instance() ) );
|
||||
GenericPageItem* recent = new GenericPageItem( this, m_rootItem->children().at( 0 ), tr( "Recently Played" ), QIcon( RESPATH "images/recently-played.png" ),
|
||||
boost::bind( &ViewManager::showWelcomePage, ViewManager::instance() ),
|
||||
boost::bind( &ViewManager::welcomeWidget, ViewManager::instance() )
|
||||
);
|
||||
|
||||
onSourcesAdded( SourceList::instance()->sources() );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user