1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 12:31:52 +02:00

* Move topbar into PlaylistManager's widget, making it essentially a playlist's private toolbar.

This commit is contained in:
Christian Muehlhaeuser 2011-01-28 00:36:51 +01:00
parent de530dd775
commit f105b18560
7 changed files with 45 additions and 45 deletions

View File

@ -14,7 +14,7 @@ ELSE()
ENDIF()
FIND_PACKAGE( Taglib 1.6.0 REQUIRED )
FIND_PACKAGE( LibLastFm REQUIRED )
FIND_PACKAGE( LibLastFm 0.3.3 REQUIRED )
FIND_PACKAGE( LibEchonest REQUIRED )
IF( UNIX AND NOT APPLE )

View File

@ -10,8 +10,8 @@ find_path(LIBLASTFM_INCLUDE_DIR NAMES Audioscrobbler
HINTS
~/usr/include
/opt/local/include
/usr/include
/usr/local/include
/usr/include
/opt/kde4/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES lastfm
@ -21,9 +21,9 @@ find_library( LIBLASTFM_LIBRARY NAMES lastfm
PATHS
~/usr/lib
/opt/local/lib
/usr/local/lib
/usr/lib
/usr/lib64
/usr/local/lib
/opt/kde4/lib
${KDE4_LIB_DIR}
)

View File

@ -169,7 +169,7 @@ DatabaseWorker::doWork()
}
if ( m_outstanding > 0 )
doWork();
QTimer::singleShot( 0, this, SLOT( doWork() ) );
}

View File

@ -4,6 +4,8 @@
#include "audio/audioengine.h"
#include "utils/animatedsplitter.h"
#include "topbar/topbar.h"
#include "widgets/infowidgets/sourceinfowidget.h"
#include "collectionmodel.h"
#include "collectionflatmodel.h"
@ -19,8 +21,6 @@
#include "sourcelist.h"
#include "tomahawksettings.h"
#include "widgets/infowidgets/sourceinfowidget.h"
#define FILTER_TIMEOUT 280
PlaylistManager* PlaylistManager::s_instance = 0;
@ -43,10 +43,12 @@ PlaylistManager::PlaylistManager( QObject* parent )
, m_modesAvailable( false )
{
s_instance = this;
m_stack = new QStackedWidget();
m_widget->setLayout( new QVBoxLayout() );
m_topbar = new TopBar();
m_stack = new QStackedWidget();
m_splitter = new AnimatedSplitter();
m_splitter->setOrientation( Qt::Vertical );
m_splitter->setChildrenCollapsible( false );
@ -62,6 +64,7 @@ PlaylistManager::PlaylistManager( QObject* parent )
m_splitter->hide( 1, false );
m_widget->layout()->setMargin( 0 );
m_widget->layout()->addWidget( m_topbar );
m_widget->layout()->addWidget( m_splitter );
m_superCollectionView = new CollectionView();
@ -81,6 +84,36 @@ PlaylistManager::PlaylistManager( QObject* parent )
m_widget->layout()->setMargin( 0 );
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
connect( m_topbar, SIGNAL( filterTextChanged( QString ) ),
this, SLOT( setFilter( QString ) ) );
connect( this, SIGNAL( numSourcesChanged( unsigned int ) ),
m_topbar, SLOT( setNumSources( unsigned int ) ) );
connect( this, SIGNAL( numTracksChanged( unsigned int ) ),
m_topbar, SLOT( setNumTracks( unsigned int ) ) );
connect( this, SIGNAL( numArtistsChanged( unsigned int ) ),
m_topbar, SLOT( setNumArtists( unsigned int ) ) );
connect( this, SIGNAL( numShownChanged( unsigned int ) ),
m_topbar, SLOT( setNumShown( unsigned int ) ) );
connect( m_topbar, SIGNAL( flatMode() ),
this, SLOT( setTableMode() ) );
connect( m_topbar, SIGNAL( artistMode() ),
this, SLOT( setTreeMode() ) );
connect( m_topbar, SIGNAL( albumMode() ),
this, SLOT( setAlbumMode() ) );
connect( this, SIGNAL( statsAvailable( bool ) ),
m_topbar, SLOT( setStatsVisible( bool ) ) );
connect( this, SIGNAL( modesAvailable( bool ) ),
m_topbar, SLOT( setModesVisible( bool ) ) );
}
@ -493,7 +526,7 @@ PlaylistManager::linkPlaylist()
m_interfaceHistory << m_currentInterface;
}
applyFilter();
// applyFilter();
AudioEngine::instance()->setPlaylist( m_currentInterface );
if ( m_currentInterface && m_statsAvailable )

View File

@ -23,6 +23,7 @@ class TrackProxyModel;
class TrackModel;
class TrackView;
class SourceInfoWidget;
class TopBar;
class DLLEXPORT PlaylistManager : public QObject
{
@ -85,6 +86,7 @@ private:
void linkPlaylist();
QWidget* m_widget;
TopBar* m_topbar;
QStackedWidget* m_stack;
AnimatedSplitter* m_splitter;

View File

@ -22,7 +22,6 @@
#include "network/controlconnection.h"
#include "playlist/playlistmanager.h"
#include "sip/SipHandler.h"
#include "topbar/topbar.h"
#include "utils/proxystyle.h"
#include "utils/widgetdragfilter.h"
#include "utils/xspfloader.h"
@ -41,7 +40,6 @@ using namespace Tomahawk;
TomahawkWindow::TomahawkWindow( QWidget* parent )
: QMainWindow( parent )
, ui( new Ui::TomahawkWindow )
, m_topbar( new TopBar( this ) )
, m_audioControls( new AudioControls( this ) )
, m_trayIcon( new TomahawkTrayIcon( this ) )
{
@ -68,12 +66,12 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
ui->sidebarSplitter->setStretchFactor( 1, 1 );
ui->sidebarSplitter->hide( 1, false );
QToolBar* toolbar = addToolBar( "TomahawkToolbar" );
/* QToolBar* toolbar = addToolBar( "TomahawkToolbar" );
toolbar->setObjectName( "TomahawkToolbar" );
toolbar->addWidget( m_topbar );
toolbar->setMovable( false );
toolbar->setFloatable( false );
toolbar->installEventFilter( new WidgetDragFilter( toolbar ) );
toolbar->installEventFilter( new WidgetDragFilter( toolbar ) );*/
statusBar()->addPermanentWidget( m_audioControls, 1 );
@ -115,37 +113,6 @@ TomahawkWindow::saveSettings()
void
TomahawkWindow::setupSignals()
{
// <Playlist>
connect( m_topbar, SIGNAL( filterTextChanged( const QString& ) ),
PlaylistManager::instance(), SLOT( setFilter( const QString& ) ) );
connect( PlaylistManager::instance(), SIGNAL( numSourcesChanged( unsigned int ) ),
m_topbar, SLOT( setNumSources( unsigned int ) ) );
connect( PlaylistManager::instance(), SIGNAL( numTracksChanged( unsigned int ) ),
m_topbar, SLOT( setNumTracks( unsigned int ) ) );
connect( PlaylistManager::instance(), SIGNAL( numArtistsChanged( unsigned int ) ),
m_topbar, SLOT( setNumArtists( unsigned int ) ) );
connect( PlaylistManager::instance(), SIGNAL( numShownChanged( unsigned int ) ),
m_topbar, SLOT( setNumShown( unsigned int ) ) );
connect( m_topbar, SIGNAL( flatMode() ),
PlaylistManager::instance(), SLOT( setTableMode() ) );
connect( m_topbar, SIGNAL( artistMode() ),
PlaylistManager::instance(), SLOT( setTreeMode() ) );
connect( m_topbar, SIGNAL( albumMode() ),
PlaylistManager::instance(), SLOT( setAlbumMode() ) );
connect( PlaylistManager::instance(), SIGNAL( statsAvailable( bool ) ),
m_topbar, SLOT( setStatsVisible( bool ) ) );
connect( PlaylistManager::instance(), SIGNAL( modesAvailable( bool ) ),
m_topbar, SLOT( setModesVisible( bool ) ) );
// <From PlaylistManager>
connect( PlaylistManager::instance(), SIGNAL( repeatModeChanged( PlaylistInterface::RepeatMode ) ),
m_audioControls, SLOT( onRepeatModeChanged( PlaylistInterface::RepeatMode ) ) );

View File

@ -12,7 +12,6 @@
class QAction;
class AudioControls;
class TopBar;
class TomahawkTrayIcon;
namespace Ui
@ -66,7 +65,6 @@ private:
void setupSignals();
Ui::TomahawkWindow* ui;
TopBar* m_topbar;
AudioControls* m_audioControls;
TomahawkTrayIcon* m_trayIcon;
QNetworkAccessManager m_nam;