From cc66ebf70c5da487f2249622c001c853a99cb8b7 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Wed, 16 Feb 2011 11:28:02 +0100 Subject: [PATCH] * Set sensible captions / descriptions for our various view modi. --- src/libtomahawk/playlist/infobar/infobar.cpp | 5 +++- src/libtomahawk/playlist/playlistmanager.cpp | 24 +++++++++++++++++++ .../widgets/infowidgets/sourceinfowidget.cpp | 1 - .../widgets/infowidgets/sourceinfowidget.ui | 17 ------------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/libtomahawk/playlist/infobar/infobar.cpp b/src/libtomahawk/playlist/infobar/infobar.cpp index e1322c8a6..bb2121e09 100644 --- a/src/libtomahawk/playlist/infobar/infobar.cpp +++ b/src/libtomahawk/playlist/infobar/infobar.cpp @@ -19,9 +19,12 @@ InfoBar::InfoBar( QWidget* parent ) QFont boldFont = ui->captionLabel->font(); boldFont.setPixelSize( 18 ); boldFont.setBold( true ); - ui->captionLabel->setFont( boldFont ); + boldFont.setPixelSize( 12 ); + ui->descriptionLabel->setFont( boldFont ); + ui->descriptionLabel->setMargin( 2 ); + QPalette whitePal = ui->captionLabel->palette(); whitePal.setColor( QPalette::Foreground, Qt::white ); diff --git a/src/libtomahawk/playlist/playlistmanager.cpp b/src/libtomahawk/playlist/playlistmanager.cpp index 36c8c2877..fc743fc12 100644 --- a/src/libtomahawk/playlist/playlistmanager.cpp +++ b/src/libtomahawk/playlist/playlistmanager.cpp @@ -176,6 +176,9 @@ PlaylistManager::show( const Tomahawk::playlist_ptr& playlist ) m_currentInterface = view->proxyModel(); } + m_infobar->setCaption( playlist->title() ); + m_infobar->setDescription( tr( "A playlist by %1" ).arg( playlist->author()->isLocal() ? tr( "you" ) : playlist->author()->friendlyName() ) ); + m_superCollectionVisible = false; m_statsAvailable = true; m_modesAvailable = false; @@ -202,6 +205,9 @@ PlaylistManager::show( const Tomahawk::dynplaylist_ptr& playlist ) m_stack->setCurrentWidget( m_dynamicWidgets.value( playlist ) ); m_currentInterface = m_dynamicWidgets.value( playlist )->playlistInterface(); + + m_infobar->setCaption( playlist->title() ); + m_infobar->setDescription( tr( "A playlist by %1" ).arg( playlist->author()->isLocal() ? tr( "you" ) : playlist->author()->friendlyName() ) ); m_superCollectionVisible = false; m_statsAvailable = true; @@ -244,6 +250,9 @@ PlaylistManager::show( const Tomahawk::artist_ptr& artist ) m_currentInterface = view->proxyModel(); } + m_infobar->setCaption( tr( "All tracks by %1" ).arg( artist->name() ) ); + m_infobar->setDescription( "" ); + m_superCollectionVisible = false; m_statsAvailable = false; m_modesAvailable = false; @@ -282,6 +291,9 @@ PlaylistManager::show( const Tomahawk::album_ptr& album ) m_currentInterface = view->proxyModel(); } + m_infobar->setCaption( tr( "All tracks on %1 by %2" ).arg( album->artist()->name() ).arg( album->name() ) ); + m_infobar->setDescription( "" ); + m_superCollectionVisible = false; m_statsAvailable = false; m_modesAvailable = false; @@ -348,6 +360,12 @@ PlaylistManager::show( const Tomahawk::collection_ptr& collection ) } } + m_infobar->setDescription( "" ); + if ( collection->source()->isLocal() ) + m_infobar->setCaption( tr( "Your Collection" ) ); + else + m_infobar->setCaption( tr( "Collection of %1" ).arg( collection->source()->friendlyName() ) ); + m_superCollectionVisible = false; m_statsAvailable = ( m_currentMode == 0 ); m_modesAvailable = true; @@ -377,6 +395,9 @@ PlaylistManager::show( const Tomahawk::source_ptr& source ) m_currentInfoWidget = m_sourceViews.value( source ); } + m_infobar->setCaption( tr( "Info about %1" ).arg( source->isLocal() ? tr( "Your Collection" ) : source->friendlyName() ) ); + m_infobar->setDescription( "" ); + m_stack->setCurrentWidget( m_currentInfoWidget ); m_superCollectionVisible = false; m_statsAvailable = false; @@ -438,6 +459,9 @@ PlaylistManager::showSuperCollection() m_currentInterface = m_superAlbumView->proxyModel(); } + m_infobar->setCaption( tr( "Super Collection" ) ); + m_infobar->setDescription( tr( "All available tracks" ) ); + m_superCollectionVisible = true; m_statsAvailable = ( m_currentMode == 0 ); m_modesAvailable = true; diff --git a/src/libtomahawk/widgets/infowidgets/sourceinfowidget.cpp b/src/libtomahawk/widgets/infowidgets/sourceinfowidget.cpp index 0c66db0eb..ad57103d2 100644 --- a/src/libtomahawk/widgets/infowidgets/sourceinfowidget.cpp +++ b/src/libtomahawk/widgets/infowidgets/sourceinfowidget.cpp @@ -20,7 +20,6 @@ SourceInfoWidget::SourceInfoWidget( const Tomahawk::source_ptr& source, QWidget* { ui->setupUi( this ); - ui->sourceLabel->setText( source->friendlyName() ); ui->historyView->overlay()->setEnabled( false ); m_recentCollectionModel = new CollectionFlatModel( ui->recentCollectionView ); diff --git a/src/libtomahawk/widgets/infowidgets/sourceinfowidget.ui b/src/libtomahawk/widgets/infowidgets/sourceinfowidget.ui index 871331a85..cfb416fcb 100644 --- a/src/libtomahawk/widgets/infowidgets/sourceinfowidget.ui +++ b/src/libtomahawk/widgets/infowidgets/sourceinfowidget.ui @@ -11,23 +11,6 @@ - - - - - 20 - 75 - true - - - - Source Name - - - false - - -