mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
fix a few more things
This commit is contained in:
@@ -99,7 +99,6 @@ PlaylistModel::loadPlaylist( const Tomahawk::playlist_ptr& playlist, bool loadEn
|
|||||||
int c = rowCount( QModelIndex() );
|
int c = rowCount( QModelIndex() );
|
||||||
|
|
||||||
qDebug() << "Starting loading" << playlist->title();
|
qDebug() << "Starting loading" << playlist->title();
|
||||||
emit loadingStarted();
|
|
||||||
emit beginInsertRows( QModelIndex(), c, c + entries.count() - 1 );
|
emit beginInsertRows( QModelIndex(), c, c + entries.count() - 1 );
|
||||||
|
|
||||||
m_waitingForResolved.clear();
|
m_waitingForResolved.clear();
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include "collection.h"
|
#include "collection.h"
|
||||||
#include "playlistinterface.h"
|
#include "playlistinterface.h"
|
||||||
#include "viewpage.h"
|
#include "viewpage.h"
|
||||||
|
#include "widgets/welcomewidget.h"
|
||||||
|
|
||||||
#include "dllmacro.h"
|
#include "dllmacro.h"
|
||||||
|
|
||||||
@@ -85,7 +86,7 @@ public:
|
|||||||
|
|
||||||
Tomahawk::ViewPage* show( Tomahawk::ViewPage* page );
|
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; }
|
ArtistView* superCollectionView() const { return m_superCollectionView; }
|
||||||
|
|
||||||
/// Get the view page for the given item. Not pretty...
|
/// Get the view page for the given item. Not pretty...
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#include "welcomewidget.h"
|
#include "welcomewidget.h"
|
||||||
#include "ui_welcomewidget.h"
|
#include "ui_welcomewidget.h"
|
||||||
|
|
||||||
|
#include "audio/audioengine.h"
|
||||||
#include "utils/tomahawkutils.h"
|
#include "utils/tomahawkutils.h"
|
||||||
|
|
||||||
#include "viewmanager.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( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) );
|
||||||
|
|
||||||
connect( ui->playlistWidget, SIGNAL( itemActivated( QListWidgetItem* ) ), SLOT( onPlaylistActivated( QListWidgetItem* ) ) );
|
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;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
/// Generic page item
|
/// 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 )
|
: SourceTreeItem( model, parent, SourcesModel::GenericPage )
|
||||||
, m_icon( icon )
|
, m_icon( icon )
|
||||||
, m_text( text )
|
, m_text( text )
|
||||||
, m_func( func )
|
, m_show( show )
|
||||||
|
, m_get( get )
|
||||||
{
|
{
|
||||||
|
if( ViewPage* p = m_get() )
|
||||||
|
model->linkSourceItemToPage( this, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericPageItem::~GenericPageItem()
|
GenericPageItem::~GenericPageItem()
|
||||||
@@ -39,7 +41,7 @@ GenericPageItem::~GenericPageItem()
|
|||||||
void
|
void
|
||||||
GenericPageItem::activate()
|
GenericPageItem::activate()
|
||||||
{
|
{
|
||||||
ViewPage* p = m_func();
|
ViewPage* p = m_show();
|
||||||
model()->linkSourceItemToPage( this, p );
|
model()->linkSourceItemToPage( this, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -27,7 +27,8 @@ class GenericPageItem : public SourceTreeItem
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
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 ~GenericPageItem();
|
||||||
|
|
||||||
virtual QString text() const;
|
virtual QString text() const;
|
||||||
@@ -41,7 +42,8 @@ signals:
|
|||||||
private:
|
private:
|
||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
QString m_text;
|
QString m_text;
|
||||||
boost::function< Tomahawk::ViewPage*() > m_func;
|
boost::function< Tomahawk::ViewPage*() > m_show;
|
||||||
|
boost::function< Tomahawk::ViewPage*() > m_get;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -44,7 +44,10 @@ SourcesModel::SourcesModel( QObject* parent )
|
|||||||
appendItem( source_ptr() );
|
appendItem( source_ptr() );
|
||||||
|
|
||||||
// add misc children of root node
|
// 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() );
|
onSourcesAdded( SourceList::instance()->sources() );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user