mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 23:39:42 +01:00
Removed InfoBar entirely. Yes, this currently leaves Station-mode a bit, uhm, headless.
This commit is contained in:
parent
b7d9f2c719
commit
927af167ed
@ -35,8 +35,6 @@ set( libGuiSources
|
||||
jobview/IndexingJobItem.cpp
|
||||
jobview/InboxJobItem.cpp
|
||||
|
||||
infobar/InfoBar.cpp
|
||||
|
||||
playlist/InboxModel.cpp
|
||||
playlist/InboxView.cpp
|
||||
playlist/ContextView.cpp
|
||||
@ -388,7 +386,6 @@ set( libUI ${libUI}
|
||||
widgets/infowidgets/TrackInfoWidget.ui
|
||||
playlist/QueueView.ui
|
||||
filemetadata/MetadataEditor.ui
|
||||
infobar/InfoBar.ui
|
||||
accounts/AccountFactoryWrapper.ui
|
||||
accounts/spotify/SpotifyAccountConfig.ui
|
||||
accounts/lastfm/LastFmConfig.ui
|
||||
@ -559,7 +556,6 @@ file( GLOB contextPagesHeaders "context/pages/*.h" )
|
||||
file( GLOB databaseHeaders "database/*.h" )
|
||||
file( GLOB filemetadataHeaders "filemetadata/*.h" )
|
||||
file( GLOB filemetadataTaghandlersHeaders "filemetadata/taghandlers/*.h" )
|
||||
file( GLOB infobarHeaders "infobar/*.h" )
|
||||
file( GLOB infosystemHeaders "infosystem/*.h" )
|
||||
file( GLOB jobviewHeaders "jobview/*.h" )
|
||||
file( GLOB networkHeaders "network/*.h" )
|
||||
@ -589,7 +585,6 @@ install( FILES ${contextPagesHeaders} DESTINATION include/libtomahawk/context/pa
|
||||
install( FILES ${databaseHeaders} DESTINATION include/libtomahawk/database )
|
||||
install( FILES ${filemetadataHeaders} DESTINATION include/libtomahawk/filemetadata )
|
||||
install( FILES ${filemetadataTaghandlersHeaders} DESTINATION include/libtomahawk/filemetadata/taghandlers )
|
||||
install( FILES ${infobarHeaders} DESTINATION include/libtomahawk/infobar )
|
||||
install( FILES ${infosystemHeaders} DESTINATION include/libtomahawk/infosystem )
|
||||
install( FILES ${jobviewHeaders} DESTINATION include/libtomahawk/jobview )
|
||||
install( FILES ${networkHeaders} DESTINATION include/libtomahawk/network )
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "ViewManager.h"
|
||||
|
||||
#include "audio/AudioEngine.h"
|
||||
#include "infobar/InfoBar.h"
|
||||
|
||||
#include "playlist/PlaylistViewPage.h"
|
||||
#include "playlist/ContextView.h"
|
||||
@ -84,7 +83,6 @@ ViewManager::ViewManager( QObject* parent )
|
||||
s_instance = this;
|
||||
|
||||
m_widget->setLayout( new QVBoxLayout() );
|
||||
m_infobar = new InfoBar();
|
||||
m_stack = new QStackedWidget();
|
||||
|
||||
m_inboxModel = new InboxModel( this );
|
||||
@ -92,7 +90,6 @@ ViewManager::ViewManager( QObject* parent )
|
||||
m_inboxModel->setDescription( tr( "Listening suggestions from your friends" ) );
|
||||
m_inboxModel->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::Inbox ) );
|
||||
|
||||
m_widget->layout()->addWidget( m_infobar );
|
||||
m_widget->layout()->addWidget( m_stack );
|
||||
|
||||
m_superCollectionView = new TreeWidget();
|
||||
@ -108,13 +105,6 @@ ViewManager::ViewManager( QObject* parent )
|
||||
m_widget->layout()->setSpacing( 0 );
|
||||
|
||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistInterfaceChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||
|
||||
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
|
||||
connect( m_infobar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
|
||||
|
||||
/* connect( m_infobar, SIGNAL( flatMode() ), SLOT( setTableMode() ) );
|
||||
connect( m_infobar, SIGNAL( artistMode() ), SLOT( setTreeMode() ) );
|
||||
connect( m_infobar, SIGNAL( albumMode() ), SLOT( setAlbumMode() ) );*/
|
||||
}
|
||||
|
||||
|
||||
@ -552,28 +542,8 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
|
||||
if ( AudioEngine::instance()->state() == AudioEngine::Stopped )
|
||||
AudioEngine::instance()->setPlaylist( page->playlistInterface() );
|
||||
|
||||
// UGH!
|
||||
if ( QObject* obj = dynamic_cast< QObject* >( currentPage() ) )
|
||||
{
|
||||
// if the signal exists (just to hide the qobject runtime warning...)
|
||||
if ( obj->metaObject()->indexOfSignal( "descriptionChanged(QString)" ) > -1 )
|
||||
connect( obj, SIGNAL( descriptionChanged( QString ) ), m_infobar, SLOT( setDescription( QString ) ), Qt::UniqueConnection );
|
||||
|
||||
if ( obj->metaObject()->indexOfSignal( "descriptionChanged(Tomahawk::artist_ptr)" ) > -1 )
|
||||
connect( obj, SIGNAL( descriptionChanged( Tomahawk::artist_ptr ) ), m_infobar, SLOT( setDescription( Tomahawk::artist_ptr ) ), Qt::UniqueConnection );
|
||||
|
||||
if ( obj->metaObject()->indexOfSignal( "descriptionChanged(Tomahawk::album_ptr)" ) > -1 )
|
||||
connect( obj, SIGNAL( descriptionChanged( Tomahawk::album_ptr ) ), m_infobar, SLOT( setDescription( Tomahawk::album_ptr ) ), Qt::UniqueConnection );
|
||||
|
||||
if ( obj->metaObject()->indexOfSignal( "longDescriptionChanged(QString)" ) > -1 )
|
||||
connect( obj, SIGNAL( longDescriptionChanged( QString ) ), m_infobar, SLOT( setLongDescription( QString ) ), Qt::UniqueConnection );
|
||||
|
||||
if ( obj->metaObject()->indexOfSignal( "nameChanged(QString)" ) > -1 )
|
||||
connect( obj, SIGNAL( nameChanged( QString ) ), m_infobar, SLOT( setCaption( QString ) ), Qt::UniqueConnection );
|
||||
|
||||
if ( obj->metaObject()->indexOfSignal( "pixmapChanged(QPixmap)" ) > -1 )
|
||||
connect( obj, SIGNAL( pixmapChanged( QPixmap ) ), m_infobar, SLOT( setPixmap( QPixmap ) ), Qt::UniqueConnection );
|
||||
|
||||
if ( obj->metaObject()->indexOfSignal( "destroyed(QWidget*)" ) > -1 )
|
||||
connect( obj, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
|
||||
}
|
||||
@ -585,8 +555,6 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
|
||||
//This should save the CPU cycles, especially with pages like the visualizer
|
||||
if ( previousPage && previousPage != page->widget() )
|
||||
previousPage->hide();
|
||||
|
||||
updateView();
|
||||
}
|
||||
|
||||
|
||||
@ -597,38 +565,6 @@ ViewManager::isNewPlaylistPageVisible() const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ViewManager::updateView()
|
||||
{
|
||||
if ( currentPlaylistInterface() )
|
||||
{
|
||||
m_infobar->setFilter( currentPage()->filter() );
|
||||
}
|
||||
|
||||
emit filterAvailable( currentPage()->showFilter() );
|
||||
|
||||
m_infobar->setVisible( currentPage()->showInfoBar() );
|
||||
m_infobar->setCaption( currentPage()->title() );
|
||||
m_infobar->setUpdaters( currentPage()->updaters() );
|
||||
|
||||
switch( currentPage()->descriptionType() )
|
||||
{
|
||||
case ViewPage::TextType:
|
||||
m_infobar->setDescription( currentPage()->description() );
|
||||
break;
|
||||
case ViewPage::ArtistType:
|
||||
m_infobar->setDescription( currentPage()->descriptionArtist() );
|
||||
break;
|
||||
case ViewPage::AlbumType:
|
||||
m_infobar->setDescription( currentPage()->descriptionAlbum() );
|
||||
break;
|
||||
|
||||
}
|
||||
m_infobar->setLongDescription( currentPage()->longDescription() );
|
||||
m_infobar->setPixmap( currentPage()->pixmap() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ViewManager::onWidgetDestroyed( QWidget* widget )
|
||||
{
|
||||
|
@ -52,7 +52,6 @@ class TreeProxyModel;
|
||||
class TreeModel;
|
||||
class TrackView;
|
||||
class SourceInfoWidget;
|
||||
class InfoBar;
|
||||
class TrackInfoWidget;
|
||||
class NewReleasesWidget;
|
||||
class QPushButton;
|
||||
@ -74,7 +73,6 @@ public:
|
||||
virtual ~ViewManager();
|
||||
|
||||
QWidget* widget() const { return m_widget; }
|
||||
InfoBar* infobar() const { return m_infobar; }
|
||||
|
||||
QueueView* queue() const { return m_queue; }
|
||||
void setQueue( QueueView* queue ) { m_queue = queue; }
|
||||
@ -157,20 +155,15 @@ public slots:
|
||||
void playlistInterfaceChanged( Tomahawk::playlistinterface_ptr );
|
||||
|
||||
private slots:
|
||||
void setFilter( const QString& filter );
|
||||
void applyFilter();
|
||||
|
||||
void onWidgetDestroyed( QWidget* widget );
|
||||
|
||||
private:
|
||||
void setPage( Tomahawk::ViewPage* page, bool trackHistory = true );
|
||||
void updateView();
|
||||
|
||||
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
|
||||
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
|
||||
|
||||
QWidget* m_widget;
|
||||
InfoBar* m_infobar;
|
||||
QStackedWidget* m_stack;
|
||||
AnimatedSplitter* m_splitter;
|
||||
|
||||
|
@ -59,8 +59,6 @@ public:
|
||||
virtual QString longDescription() const { return QString(); }
|
||||
virtual QPixmap pixmap() const { return QPixmap( RESPATH "icons/tomahawk-icon-128x128.png" ); }
|
||||
|
||||
virtual bool showInfoBar() const { return true; }
|
||||
virtual bool showFilter() const { return false; }
|
||||
virtual bool queueVisible() const { return true; }
|
||||
|
||||
virtual QString filter() const { return m_filter; }
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
virtual QString description() const;
|
||||
virtual QPixmap pixmap() const;
|
||||
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
virtual bool jumpToCurrentTrack();
|
||||
virtual bool isTemporaryPage() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
@ -52,7 +52,6 @@ public:
|
||||
virtual QString description() const;
|
||||
virtual QPixmap pixmap() const;
|
||||
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
virtual bool jumpToCurrentTrack();
|
||||
virtual bool isTemporaryPage() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
@ -43,7 +43,6 @@ public:
|
||||
virtual QString description() const;
|
||||
virtual QPixmap pixmap() const;
|
||||
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
virtual bool jumpToCurrentTrack();
|
||||
virtual bool isTemporaryPage() const;
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
@ -122,10 +122,3 @@ TreeWidget::jumpToCurrentTrack()
|
||||
{
|
||||
return m_view->jumpToCurrentTrack();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
TreeWidget::showInfoBar() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -43,8 +43,6 @@ public:
|
||||
|
||||
virtual bool jumpToCurrentTrack();
|
||||
|
||||
virtual bool showInfoBar() const;
|
||||
|
||||
public slots:
|
||||
virtual bool setFilter( const QString& filter );
|
||||
|
||||
|
@ -71,7 +71,6 @@ public:
|
||||
virtual QString title() const { return tr( "New Releases" ); }
|
||||
virtual QString description() const { return QString(); }
|
||||
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
||||
virtual bool jumpToCurrentTrack();
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
|
||||
virtual QPixmap pixmap() const;
|
||||
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
virtual bool isBeingPlayed() const;
|
||||
virtual bool isTemporaryPage() const { return true; }
|
||||
virtual bool jumpToCurrentTrack();
|
||||
|
@ -68,7 +68,6 @@ public:
|
||||
virtual QPixmap pixmap() const;
|
||||
|
||||
virtual bool isTemporaryPage() const { return true; }
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
|
||||
virtual bool isBeingPlayed() const;
|
||||
virtual bool jumpToCurrentTrack();
|
||||
|
@ -81,7 +81,6 @@ public:
|
||||
virtual QPixmap pixmap() const;
|
||||
|
||||
virtual bool isTemporaryPage() const { return true; }
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
|
||||
virtual bool jumpToCurrentTrack();
|
||||
virtual bool isBeingPlayed() const;
|
||||
|
@ -68,7 +68,6 @@ public:
|
||||
|
||||
virtual bool isBeingPlayed() const;
|
||||
virtual bool isTemporaryPage() const { return true; }
|
||||
virtual bool showInfoBar() const { return false; }
|
||||
|
||||
virtual bool jumpToCurrentTrack();
|
||||
|
||||
|
@ -136,8 +136,6 @@ public:
|
||||
const QString pixmapPath() const Q_DECL_OVERRIDE { return ( RESPATH "images/charts.svg" ); }
|
||||
|
||||
int sortValue() Q_DECL_OVERRIDE { return 5; }
|
||||
|
||||
bool showInfoBar() const Q_DECL_OVERRIDE { return false; }
|
||||
};
|
||||
|
||||
|
||||
|
@ -98,8 +98,6 @@ public:
|
||||
const QString pixmapPath() const Q_DECL_OVERRIDE { return ( RESPATH "images/dashboard.svg" ); }
|
||||
|
||||
int sortValue() Q_DECL_OVERRIDE { return 2; }
|
||||
|
||||
bool showInfoBar() const Q_DECL_OVERRIDE { return false; }
|
||||
};
|
||||
|
||||
|
||||
|
@ -57,8 +57,7 @@ public:
|
||||
virtual QString title() const { return tr( "Trending" ); }
|
||||
virtual QString description() const { return tr( "What's hot amongst your friends" ); }
|
||||
virtual const QString pixmapPath() const { return ( RESPATH "images/trending.svg" ); }
|
||||
virtual bool showInfoBar() const { return true; }
|
||||
|
||||
|
||||
virtual int sortValue() { return 3; }
|
||||
};
|
||||
|
||||
|
@ -95,8 +95,6 @@ public:
|
||||
void onItemDeleted();
|
||||
|
||||
int sortValue() { return 1; }
|
||||
|
||||
bool showInfoBar() const { return false; }
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user