mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
start towards info
This commit is contained in:
@@ -134,9 +134,9 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
QFont authorFont = opt.font;
|
QFont authorFont = opt.font;
|
||||||
authorFont.setItalic( true );
|
authorFont.setItalic( true );
|
||||||
authorFont.setPointSize( authorFont.pointSize() - 1 );
|
authorFont.setPointSize( authorFont.pointSize() - 1 );
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
authorFont.setPointSize( authorFont.pointSize() - 1 );
|
authorFont.setPointSize( authorFont.pointSize() - 1 );
|
||||||
#endif
|
#endif
|
||||||
const QFontMetrics authorMetrics( authorFont );
|
const QFontMetrics authorMetrics( authorFont );
|
||||||
|
|
||||||
QFont descFont = authorFont;
|
QFont descFont = authorFont;
|
||||||
@@ -658,4 +658,16 @@ AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QM
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AccountDelegate::startInstalling( const QPersistentModelIndex& idx )
|
||||||
|
{
|
||||||
|
qDebug() << "START INSTALLING:" << idx.data( Qt::DisplayRole ).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AccountDelegate::doneInstalling ( const QPersistentModelIndex& idx )
|
||||||
|
{
|
||||||
|
qDebug() << "STOP INSTALLING:" << idx.data( Qt::DisplayRole ).toString();
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -38,6 +38,10 @@ public:
|
|||||||
virtual void paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
virtual void paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||||
virtual QSize sizeHint ( const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
virtual QSize sizeHint ( const QStyleOptionViewItem& option, const QModelIndex& index ) const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void startInstalling( const QPersistentModelIndex& idx );
|
||||||
|
void doneInstalling ( const QPersistentModelIndex& idx );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index );
|
virtual bool editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index );
|
||||||
|
|
||||||
@@ -64,6 +68,7 @@ private:
|
|||||||
mutable QHash< QPersistentModelIndex, QRect > m_cachedStarRects;
|
mutable QHash< QPersistentModelIndex, QRect > m_cachedStarRects;
|
||||||
mutable QHash< QPersistentModelIndex, QRect > m_cachedConfigRects;
|
mutable QHash< QPersistentModelIndex, QRect > m_cachedConfigRects;
|
||||||
mutable QHash< QPersistentModelIndex, QSize > m_sizeHints;
|
mutable QHash< QPersistentModelIndex, QSize > m_sizeHints;
|
||||||
|
mutable QHash< QPersistentModelIndex, QMovie* > m_loadingSpinners;
|
||||||
mutable int m_accountRowHeight;
|
mutable int m_accountRowHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -451,6 +451,7 @@ AccountModel::setData( const QModelIndex& index, const QVariant& value, int role
|
|||||||
qDebug() << "Kicked off fetch+install, now waiting";
|
qDebug() << "Kicked off fetch+install, now waiting";
|
||||||
m_waitingForAtticaInstall.insert( resolver.id() );
|
m_waitingForAtticaInstall.insert( resolver.id() );
|
||||||
|
|
||||||
|
emit startInstalling( index );
|
||||||
AtticaManager::instance()->installResolver( resolver );
|
AtticaManager::instance()->installResolver( resolver );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -571,6 +572,10 @@ AccountModel::accountAdded( Account* account )
|
|||||||
AccountManager::instance()->enableAccount( account );
|
AccountManager::instance()->enableAccount( account );
|
||||||
|
|
||||||
m_waitingForAtticaInstall.remove( attica->atticaId() );
|
m_waitingForAtticaInstall.remove( attica->atticaId() );
|
||||||
|
|
||||||
|
// find index to emit doneInstalling for
|
||||||
|
const QModelIndex idx = index( i, 0, QModelIndex() );
|
||||||
|
emit doneInstalling( idx );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( thisIsTheOne )
|
if ( thisIsTheOne )
|
||||||
|
@@ -94,6 +94,8 @@ signals:
|
|||||||
void createAccount( Tomahawk::Accounts::AccountFactory* factory );
|
void createAccount( Tomahawk::Accounts::AccountFactory* factory );
|
||||||
void scrollTo( const QModelIndex& idx );
|
void scrollTo( const QModelIndex& idx );
|
||||||
|
|
||||||
|
void startInstalling( const QPersistentModelIndex& idx );
|
||||||
|
void doneInstalling( const QPersistentModelIndex& idx );
|
||||||
private slots:
|
private slots:
|
||||||
void loadData();
|
void loadData();
|
||||||
|
|
||||||
|
@@ -36,6 +36,8 @@ void
|
|||||||
AccountModelFilterProxy::setSourceModel( QAbstractItemModel* sourceModel )
|
AccountModelFilterProxy::setSourceModel( QAbstractItemModel* sourceModel )
|
||||||
{
|
{
|
||||||
connect( sourceModel, SIGNAL( scrollTo( QModelIndex ) ), this, SLOT( onScrollTo( QModelIndex ) ) );
|
connect( sourceModel, SIGNAL( scrollTo( QModelIndex ) ), this, SLOT( onScrollTo( QModelIndex ) ) );
|
||||||
|
connect( sourceModel, SIGNAL( startInstalling( QPersistentModelIndex ) ), this, SIGNAL( startInstalling( QPersistentModelIndex ) ) );
|
||||||
|
connect( sourceModel, SIGNAL( doneInstalling( QPersistentModelIndex ) ), this, SIGNAL( doneInstalling( QPersistentModelIndex ) ) );
|
||||||
QSortFilterProxyModel::setSourceModel( sourceModel );
|
QSortFilterProxyModel::setSourceModel( sourceModel );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,6 +40,9 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void scrollTo( const QModelIndex& idx );
|
void scrollTo( const QModelIndex& idx );
|
||||||
|
|
||||||
|
void startInstalling( const QPersistentModelIndex& idx );
|
||||||
|
void doneInstalling( const QPersistentModelIndex& idx );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex& sourceParent ) const;
|
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex& sourceParent ) const;
|
||||||
|
|
||||||
|
6
src/libtomahawk/utils/LoadingSpinnerPixmap.cpp
Normal file
6
src/libtomahawk/utils/LoadingSpinnerPixmap.cpp
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include "LoadingSpinnerPixmap.h"
|
||||||
|
|
||||||
|
LoadingSpinnerPixmap::LoadingSpinnerPixmap(QObject *parent) :
|
||||||
|
QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
@@ -114,6 +114,8 @@ SettingsDialog::SettingsDialog( QWidget *parent )
|
|||||||
m_accountProxy = new AccountModelFilterProxy( m_accountModel );
|
m_accountProxy = new AccountModelFilterProxy( m_accountModel );
|
||||||
m_accountProxy->setSourceModel( m_accountModel );
|
m_accountProxy->setSourceModel( m_accountModel );
|
||||||
|
|
||||||
|
connect( m_accountProxy, SIGNAL( startInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( startInstalling(QPersistentModelIndex) ) );
|
||||||
|
connect( m_accountProxy, SIGNAL( doneInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( doneInstalling(QPersistentModelIndex) ) );
|
||||||
connect( m_accountProxy, SIGNAL( scrollTo( QModelIndex ) ), this, SLOT( scrollTo( QModelIndex ) ) );
|
connect( m_accountProxy, SIGNAL( scrollTo( QModelIndex ) ), this, SLOT( scrollTo( QModelIndex ) ) );
|
||||||
|
|
||||||
ui->accountsView->setModel( m_accountProxy );
|
ui->accountsView->setModel( m_accountProxy );
|
||||||
|
Reference in New Issue
Block a user