mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-15 18:44:30 +02:00
* Scanning status should have priority over now-playing information.
This commit is contained in:
@@ -159,7 +159,7 @@ Source::scanningProgress( unsigned int files )
|
||||
void
|
||||
Source::scanningFinished( unsigned int files )
|
||||
{
|
||||
m_textStatus = tr( "Online" );
|
||||
m_textStatus = QString();
|
||||
emit stateChanged();
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@ Source::onStateChanged( DBSyncConnection::State newstate, DBSyncConnection::Stat
|
||||
msg = tr( "Saving" );
|
||||
break;
|
||||
case DBSyncConnection::SYNCED:
|
||||
msg = tr( "Online" );
|
||||
msg = QString();
|
||||
break;
|
||||
case DBSyncConnection::SCANNING:
|
||||
msg = tr( "Scanning (%L1 tracks)" ).arg( info );
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = "???";
|
||||
msg = QString();
|
||||
}
|
||||
|
||||
m_textStatus = msg;
|
||||
|
@@ -124,13 +124,15 @@ SourcesModel::appendItem( const source_ptr& source )
|
||||
|
||||
// qDebug() << "Appending source item:" << item->source()->username();
|
||||
invisibleRootItem()->appendRow( item->columns() );
|
||||
// m_parent->setIndexWidget( m_parent->model()->index( rowCount() - 1, 0 ), item->widget() );
|
||||
|
||||
if ( !source.isNull() )
|
||||
{
|
||||
connect( source.data(), SIGNAL( offline() ), SLOT( onSourceChanged() ) );
|
||||
connect( source.data(), SIGNAL( online() ), SLOT( onSourceChanged() ) );
|
||||
connect( source.data(), SIGNAL( stats( QVariantMap ) ), SLOT( onSourceChanged() ) );
|
||||
connect( source.data(), SIGNAL( playbackStarted( Tomahawk::query_ptr ) ), SLOT( onSourceChanged() ) );
|
||||
connect( source.data(), SIGNAL( stateChanged() ), SLOT( onSourceChanged() ) );
|
||||
}
|
||||
|
||||
return true; // FIXME
|
||||
}
|
||||
|
@@ -469,7 +469,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
QString desc = status ? sti->source()->textStatus() : tr( "Offline" );
|
||||
if ( sti->source().isNull() )
|
||||
desc = tr( "All available tracks" );
|
||||
if ( status && !sti->source()->currentTrack().isNull() )
|
||||
if ( status && desc.isEmpty() && !sti->source()->currentTrack().isNull() )
|
||||
desc = sti->source()->currentTrack()->artist() + " - " + sti->source()->currentTrack()->track();
|
||||
if ( desc.isEmpty() )
|
||||
desc = tr( "Online" );
|
||||
@@ -479,11 +479,8 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
text = painter->fontMetrics().elidedText( desc, Qt::ElideRight, textRect.width() );
|
||||
painter->drawText( textRect, text );
|
||||
|
||||
if ( !status )
|
||||
if ( status )
|
||||
{
|
||||
painter->restore();
|
||||
return;
|
||||
}
|
||||
painter->setRenderHint( QPainter::Antialiasing );
|
||||
|
||||
QRect figRect = o.rect.adjusted( o.rect.width() - figWidth - 18, 0, -10, -o.rect.height() + 16 );
|
||||
@@ -514,6 +511,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
||||
painter->setFont( bold );
|
||||
painter->setPen( Qt::white );
|
||||
painter->drawText( figRect, tracks, to );
|
||||
}
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
|
Reference in New Issue
Block a user