summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Cerneels <bart.cerneels@kde.org>2011-06-03 14:36:44 (GMT)
committerBart Cerneels <bart.cerneels@kde.org>2011-06-09 19:33:51 (GMT)
commit1fd6084404ad84851f8b33d4a0b9a125ad53bbe5 (patch)
tree1eaf20d52a746332b0c8c46c28682b9be5c9721a
parentd8e57aed35d1b77813fcbc8c65be7f340146a60b (diff)
Disable statusbar, progess and messages in browser
The multi-progress popup needs to improve.
-rw-r--r--src/MainWindow.cpp7
-rw-r--r--src/browsers/BrowserDock.cpp25
-rw-r--r--src/browsers/BrowserDock.h3
-rw-r--r--src/statusbar/CompoundProgressBar.cpp50
-rw-r--r--src/statusbar/ProgressBar.cpp50
-rw-r--r--src/statusbar/StatusBar.cpp145
-rw-r--r--src/statusbar/StatusBar.h29
7 files changed, 106 insertions, 203 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index cb5058e..6b7549c 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -135,11 +135,10 @@ MainWindow::MainWindow()
PERF_LOG( "Set Status Bar" )
StatusBar* statusBar = new StatusBar( this );
- setStatusBar( statusBar );
PERF_LOG( "Created Status Bar" )
/* The PluginManager needs to be loaded before the playlist model
- * (which gets started by "statusBar::conectPlaylist" below so that it can handle any
+ * (which gets started by "statusBar::connectPlaylist" below so that it can handle any
* tracks in the saved playlist that are associated with services. Eg, if
* the playlist has a Magnatune track in it when Amarok is closed, then the
* Magnatune service needs to be initialized before the playlist is loaded
@@ -148,10 +147,6 @@ MainWindow::MainWindow()
The::pluginManager();
PERF_LOG( "Started Plugin Manager instance" )
- PERF_LOG( "Connect Status Bar" )
- statusBar->connectPlaylist();
- PERF_LOG( "Connected Status Bar" )
-
// Sets caption and icon correctly (needed e.g. for GNOME)
// kapp->setTopWidget( this );
PERF_LOG( "Set Top Widget" )
diff --git a/src/browsers/BrowserDock.cpp b/src/browsers/BrowserDock.cpp
index 25ac98c..b512e10 100644
--- a/src/browsers/BrowserDock.cpp
+++ b/src/browsers/BrowserDock.cpp
@@ -22,6 +22,7 @@
#include "core/support/Debug.h"
#include "widgets/HorizontalDivider.h"
#include "PaletteHandler.h"
+#include "statusbar/StatusBar.h"
#include <KAction>
#include <KIcon>
@@ -44,8 +45,17 @@ BrowserDock::BrowserDock( QWidget * parent )
new HorizontalDivider( m_mainWidget );
m_categoryList = new BrowserCategoryList( m_mainWidget, "root list" );
m_breadcrumbWidget->setRootList( m_categoryList.data() );
- m_progressWidget = new QWidget( m_mainWidget );
- m_progressWidget->setFixedHeight( 30 );
+ m_progressFrame = new QFrame( m_mainWidget );
+ m_progressFrame->setAutoFillBackground( true );
+ m_progressFrame->setFixedHeight( 30 );
+ QHBoxLayout *layout = new QHBoxLayout( m_progressFrame );
+ layout->setMargin( 0 );
+ layout->setSpacing( 0 );
+ CompoundProgressBar *progressBar = The::statusBar()->compoundProgressBar();
+ progressBar->setParent( m_progressFrame );
+ layout->addWidget( progressBar );
+ m_progressFrame->setLayout( layout );
+
ensurePolish();
}
@@ -76,7 +86,7 @@ void BrowserDock::polish()
SLOT( paletteChanged( const QPalette & ) ) );
}
-BrowserCategoryList * BrowserDock::list() const
+BrowserCategoryList *BrowserDock::list() const
{
return m_categoryList.data();
}
@@ -97,10 +107,11 @@ BrowserDock::home()
void
BrowserDock::paletteChanged( const QPalette& palette )
{
- m_progressWidget->setStyleSheet(
- QString( "QWidget { background-color: %1; color: %2; border-radius: 3px; }" )
- .arg( PaletteHandler::highlightColor().name() )
- .arg( palette.highlightedText().color().name() ) );
+ m_progressFrame->setStyleSheet(
+ QString( "background-color: %1; color: %2; border-radius: 3px;" )
+ .arg( PaletteHandler::alternateBackgroundColor().name() )
+ .arg( palette.highlightedText().color().name() )
+ );
}
#include "BrowserDock.moc"
diff --git a/src/browsers/BrowserDock.h b/src/browsers/BrowserDock.h
index 6824eca..70604dd 100644
--- a/src/browsers/BrowserDock.h
+++ b/src/browsers/BrowserDock.h
@@ -20,6 +20,7 @@
#include "BrowserBreadcrumbWidget.h"
#include "BrowserCategoryList.h"
+#include "statusbar/CompoundProgressBar.h"
#include "widgets/AmarokDockWidget.h"
#include <KVBox>
@@ -50,7 +51,7 @@ private:
BrowserBreadcrumbWidget *m_breadcrumbWidget;
QWeakPointer<BrowserCategoryList> m_categoryList;
KVBox *m_mainWidget;
- QWidget *m_progressWidget;
+ QFrame *m_progressFrame;
};
#endif
diff --git a/src/statusbar/CompoundProgressBar.cpp b/src/statusbar/CompoundProgressBar.cpp
index 17bf93c..19d244c 100644
--- a/src/statusbar/CompoundProgressBar.cpp
+++ b/src/statusbar/CompoundProgressBar.cpp
@@ -23,7 +23,7 @@
#include <QLayout>
-CompoundProgressBar::CompoundProgressBar( QWidget * parent )
+CompoundProgressBar::CompoundProgressBar( QWidget *parent )
: ProgressBar( parent )
{
m_showDetailsButton = new QToolButton( extrabuttonSpace() );
@@ -42,23 +42,26 @@ CompoundProgressBar::~CompoundProgressBar()
m_progressDetailsWidget = 0;
}
-void CompoundProgressBar::addProgressBar( ProgressBar * childBar, QObject *owner )
+void CompoundProgressBar::addProgressBar( ProgressBar *childBar, QObject *owner )
{
m_progressMap.insert( owner, childBar );
m_progressDetailsWidget->layout()->addWidget( childBar );
- if ( m_progressDetailsWidget->width() < childBar->width() )
+ if( m_progressDetailsWidget->width() < childBar->width() )
m_progressDetailsWidget->setMinimumWidth( childBar->width() );
m_progressDetailsWidget->setMinimumHeight( childBar->height() * m_progressMap.count() + 8 );
m_progressDetailsWidget->reposition();
- connect( childBar, SIGNAL( percentageChanged( int ) ), this, SLOT( childPercentageChanged() ) );
- connect( childBar, SIGNAL( cancelled( ProgressBar * ) ), this, SLOT( childBarCancelled( ProgressBar * ) ) );
- connect( childBar, SIGNAL( complete( ProgressBar * ) ), this, SLOT( childBarComplete( ProgressBar * ) ) );
- connect( owner, SIGNAL( destroyed( QObject* ) ), this, SLOT( slotObjectDestroyed( QObject* ) ) );
+ connect( childBar, SIGNAL( percentageChanged( int ) ),
+ SLOT( childPercentageChanged() ) );
+ connect( childBar, SIGNAL( cancelled( ProgressBar * ) ),
+ SLOT( childBarCancelled( ProgressBar * ) ) );
+ connect( childBar, SIGNAL( complete( ProgressBar * ) ),
+ SLOT( childBarComplete( ProgressBar * ) ) );
+ connect( owner, SIGNAL( destroyed( QObject * ) ), SLOT( slotObjectDestroyed( QObject * ) ) );
- if ( m_progressMap.count() == 1 )
+ if( m_progressMap.count() == 1 )
{
setDescription( childBar->descriptionLabel()->text() );
cancelButton()->setToolTip( i18n( "Abort" ) );
@@ -76,39 +79,39 @@ void CompoundProgressBar::addProgressBar( ProgressBar * childBar, QObject *owner
void CompoundProgressBar::endProgressOperation( QObject *owner )
{
- if ( !m_progressMap.contains( owner ) )
+ if( !m_progressMap.contains( owner ) )
return ;
childBarComplete( m_progressMap.value( owner ) );
}
-void CompoundProgressBar::incrementProgress( const QObject * owner )
+void CompoundProgressBar::incrementProgress( const QObject *owner )
{
- if ( !m_progressMap.contains( owner ) )
+ if( !m_progressMap.contains( owner ) )
return ;
m_progressMap.value( owner )->setValue( m_progressMap.value( owner )->value() + 1 );
}
-void CompoundProgressBar::setProgress( const QObject * owner, int steps )
+void CompoundProgressBar::setProgress( const QObject *owner, int steps )
{
- if ( !m_progressMap.contains( owner ) )
+ if( !m_progressMap.contains( owner ) )
return ;
m_progressMap.value( owner )->setValue( steps );
}
-void CompoundProgressBar::setProgressTotalSteps( const QObject * owner, int value )
+void CompoundProgressBar::setProgressTotalSteps( const QObject *owner, int value )
{
- if ( !m_progressMap.contains( owner ) )
+ if( !m_progressMap.contains( owner ) )
return ;
m_progressMap.value( owner )->setMaximum( value );
}
-void CompoundProgressBar::setProgressStatus( const QObject * owner, const QString & text )
+void CompoundProgressBar::setProgressStatus( const QObject *owner, const QString &text )
{
- if ( !m_progressMap.contains( owner ) )
+ if( !m_progressMap.contains( owner ) )
return ;
m_progressMap.value( owner )->setDescription( text );
@@ -119,13 +122,13 @@ void CompoundProgressBar::childPercentageChanged()
progressBar()->setValue( calcCompoundPercentage() );
}
-void CompoundProgressBar::childBarCancelled( ProgressBar * childBar )
+void CompoundProgressBar::childBarCancelled( ProgressBar *childBar )
{
DEBUG_BLOCK
childBarFinished( childBar );
}
-void CompoundProgressBar::childBarComplete( ProgressBar * childBar )
+void CompoundProgressBar::childBarComplete( ProgressBar *childBar )
{
childBarFinished( childBar );
}
@@ -140,18 +143,19 @@ void CompoundProgressBar::slotObjectDestroyed( QObject *object )
void CompoundProgressBar::childBarFinished( ProgressBar *bar )
{
- QObject *owner = const_cast<QObject*>( m_progressMap.key( bar ) );
+ QObject *owner = const_cast<QObject *>( m_progressMap.key( bar ) );
owner->disconnect( this );
owner->disconnect( bar );
m_progressMap.remove( owner );
m_progressDetailsWidget->layout()->removeWidget( bar );
- m_progressDetailsWidget->setFixedHeight( bar->height() * m_progressMap.count() + 8 );
+ m_progressDetailsWidget->setFixedHeight( bar->height() * m_progressMap.count() + 8 );
m_progressDetailsWidget->reposition();
delete bar;
if( m_progressMap.count() == 1 )
{
- //only one job still running, so no need to use the details widget any more. Also set the text to the description of
+ //only one job still running, so no need to use the details widget any more.
+ //Also set the text to the description of
//the job instead of the "Multiple background tasks running" text.
setDescription( m_progressMap.values().at( 0 )->descriptionLabel()->text() );
cancelButton()->setToolTip( i18n( "Abort" ) );
@@ -214,7 +218,7 @@ void CompoundProgressBar::hideDetails()
void CompoundProgressBar::toggleDetails()
{
- if ( m_progressDetailsWidget->isVisible() )
+ if( m_progressDetailsWidget->isVisible() )
hideDetails();
else
showDetails();
diff --git a/src/statusbar/ProgressBar.cpp b/src/statusbar/ProgressBar.cpp
index b1a9bcd..eabbd56 100644
--- a/src/statusbar/ProgressBar.cpp
+++ b/src/statusbar/ProgressBar.cpp
@@ -24,44 +24,48 @@
#include <KIcon>
#include <KLocale>
-ProgressBar::ProgressBar( QWidget * parent )
+ProgressBar::ProgressBar( QWidget *parent )
: QFrame( parent )
{
- QHBoxLayout *box = new QHBoxLayout( this );
- box->setMargin( 0 );
- box->setSpacing( 0 );
- m_descriptionLabel = new QLabel( this );
- m_descriptionLabel->setMinimumWidth( 50 );
- //m_descriptionLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
- box->addWidget( m_descriptionLabel );
+ QVBoxLayout *box = new QVBoxLayout( this );
+ box->setMargin( 0 );
+ box->setSpacing( 5 );
- KHBox *progressBox = new KHBox( this );
+ QFrame *descriptionFrame = new QFrame( this );
+ QHBoxLayout *descriptionLayout = new QHBoxLayout( this );
+ descriptionLayout->setMargin( 0 );
+ descriptionLayout->setSpacing( 2 );
- m_extraButtonSpace = new KHBox( progressBox );
+ m_extraButtonSpace = new KHBox( descriptionFrame );
m_extraButtonSpace->setSpacing( 0 );
m_extraButtonSpace->setMargin( 0 );
+ descriptionLayout->addWidget( m_extraButtonSpace );
+ descriptionLayout->setAlignment( m_extraButtonSpace, Qt::AlignLeft );
+
+ m_descriptionLabel = new QLabel( this );
+ m_descriptionLabel->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
+ descriptionLayout->addWidget( m_descriptionLabel );
- m_cancelButton = new QToolButton( progressBox );
+ m_cancelButton = new QToolButton( descriptionFrame );
m_cancelButton->setIcon( KIcon( "dialog-cancel-amarok" ) );
m_cancelButton->setToolTip( i18n( "Abort" ) );
m_cancelButton->setEnabled( false );
+ descriptionLayout->addWidget( m_cancelButton );
+ descriptionLayout->setAlignment( m_cancelButton, Qt::AlignRight );
- m_progressBar = new QProgressBar( progressBox );
+ descriptionFrame->setLayout( descriptionLayout );
+
+ box->addWidget( descriptionFrame );
+ box->setAlignment( descriptionFrame, Qt::AlignTop );
+
+ m_progressBar = new QProgressBar( this );
m_progressBar->setMinimum( 0 );
m_progressBar->setMaximum( 100 );
- m_progressBar->setMinimumWidth( 200 );
- m_progressBar->setMaximumWidth( 300 );
+ m_progressBar->setFixedHeight( 5 );
m_progressBar->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
-
- box->addWidget( progressBox );
- box->setAlignment( progressBox, Qt::AlignRight );
-
- // Fix multiple progressbars using all available vertical space
- const int contentHeight = QFontMetrics( m_descriptionLabel->font() ).height();
- const int barHeight = contentHeight + 6;
- setFixedHeight( barHeight );
- m_progressBar->setFixedHeight( barHeight - 4 );
+ m_progressBar->setTextVisible( false );
+ box->addWidget( m_progressBar, 0, Qt::AlignBottom );
setLayout( box );
}
diff --git a/src/statusbar/StatusBar.cpp b/src/statusbar/StatusBar.cpp
index 40889c5..6d634f7 100644
--- a/src/statusbar/StatusBar.cpp
+++ b/src/statusbar/StatusBar.cpp
@@ -39,7 +39,6 @@
#include <cmath>
-
class LoggerAdaptor : public Amarok::Logger
{
public:
@@ -72,7 +71,8 @@ public:
m_statusBar->longMessage( text, otherType );
}
- virtual void newProgressOperation( KJob *job, const QString &text, QObject *obj, const char *slot, Qt::ConnectionType type )
+ virtual void newProgressOperation( KJob *job, const QString &text, QObject *obj,
+ const char *slot, Qt::ConnectionType type )
{
ProgressBar *bar = m_statusBar->newProgressOperation( job, text );
if( obj )
@@ -81,7 +81,8 @@ public:
}
}
- virtual void newProgressOperation( QNetworkReply *reply, const QString &text, QObject *obj, const char *slot, Qt::ConnectionType type )
+ virtual void newProgressOperation( QNetworkReply *reply, const QString &text, QObject *obj,
+ const char *slot, Qt::ConnectionType type )
{
ProgressBar *bar = m_statusBar->newProgressOperation( reply, text );
if( obj )
@@ -94,17 +95,17 @@ private:
StatusBar *m_statusBar;
};
-StatusBar* StatusBar::s_instance = 0;
+StatusBar *StatusBar::s_instance = 0;
namespace The
{
- StatusBar* statusBar()
+ StatusBar *statusBar()
{
return StatusBar::instance();
}
}
-StatusBar::StatusBar( QWidget * parent )
+StatusBar::StatusBar( QWidget *parent )
: KStatusBar( parent )
, m_progressBar( new CompoundProgressBar( this ) )
, m_busy( false )
@@ -125,40 +126,16 @@ StatusBar::StatusBar( QWidget * parent )
m_shortMessageTimer->setSingleShot( true );
connect( m_shortMessageTimer, SIGNAL( timeout() ), this, SLOT( nextShortMessage() ) );
- m_nowPlayingWidget = new KHBox( 0 );
- m_nowPlayingWidget->setSpacing( 4 );
-
- m_nowPlayingLabel = new KSqueezedTextLabel( m_nowPlayingWidget );
- m_nowPlayingLabel->setTextElideMode( Qt::ElideRight );
- m_nowPlayingLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
-
- m_nowPlayingEmblem = new QLabel( m_nowPlayingWidget );
- m_nowPlayingEmblem->setFixedSize( 16, 16 );
-
- QWidget * spacer = new QWidget( m_nowPlayingWidget );
- spacer->setFixedWidth( 3 );
-
- addPermanentWidget( m_nowPlayingWidget );
-
qRegisterMetaType<MessageType>( "MessageType" );
- connect( this, SIGNAL( signalLongMessage( const QString &, MessageType ) ), SLOT( slotLongMessage( const QString &, MessageType ) ), Qt::QueuedConnection );
+ connect( this, SIGNAL( signalLongMessage( const QString &, MessageType ) ),
+ SLOT( slotLongMessage( const QString &, MessageType ) ), Qt::QueuedConnection );
Amarok::Logger *logger = Amarok::Components::logger();
ProxyLogger *proxy = qobject_cast<ProxyLogger*>( logger );
if( proxy )
- {
proxy->setLogger( new LoggerAdaptor( this ) );
- }
else
- {
warning() << "Was not able to register statusbar as logger";
- }
-
- // init
- if( AmarokConfig::resumePlayback() )
- trackPlaying( The::engineController()->currentTrack() );
- else
- stopped();
}
@@ -172,31 +149,15 @@ StatusBar::~StatusBar()
s_instance = 0;
}
-void StatusBar::connectPlaylist()
-{
- EngineController *engine = The::engineController();
-
- connect( engine, SIGNAL( trackMetadataChanged( Meta::TrackPtr ) ),
- this, SLOT( trackMetadataChanged( Meta::TrackPtr ) ) );
- connect( engine, SIGNAL( stopped( qint64, qint64 ) ),
- this, SLOT( stopped() ) );
- connect( engine, SIGNAL( paused() ),
- this, SLOT( paused() ) );
- connect( engine, SIGNAL( trackPlaying( Meta::TrackPtr ) ),
- this, SLOT( trackPlaying( Meta::TrackPtr ) ) );
-}
-
-ProgressBar * StatusBar::newProgressOperation( QObject * owner, const QString & description )
+ProgressBar *StatusBar::newProgressOperation( QObject *owner, const QString & description )
{
//clear any short message currently being displayed and stop timer if running...
clearMessage();
m_shortMessageTimer->stop();
- //also hide the now playing stuff:
- m_nowPlayingWidget->hide();
- ProgressBar * newBar = new ProgressBar( 0 );
+ ProgressBar *newBar = new ProgressBar( 0 );
newBar->setDescription( description );
- connect( owner, SIGNAL(destroyed(QObject*)), this, SLOT(endProgressOperation(QObject*)) );
+ connect( owner, SIGNAL(destroyed( QObject * )), SLOT(endProgressOperation( QObject * )) );
m_progressBar->addProgressBar( newBar, owner );
m_progressBar->show();
m_busy = true;
@@ -204,17 +165,15 @@ ProgressBar * StatusBar::newProgressOperation( QObject * owner, const QString &
return newBar;
}
-ProgressBar * StatusBar::newProgressOperation( KJob * job, const QString & description )
+ProgressBar *StatusBar::newProgressOperation( KJob *job, const QString &description )
{
//clear any short message currently being displayed and stop timer if running...
clearMessage();
m_shortMessageTimer->stop();
- //also hide the now playing stuff:
- m_nowPlayingWidget->hide();
- KJobProgressBar * newBar = new KJobProgressBar( 0, job );
+ KJobProgressBar *newBar = new KJobProgressBar( 0, job );
newBar->setDescription( description );
- connect( job, SIGNAL(destroyed(QObject*)), this, SLOT(endProgressOperation(QObject*)) );
+ connect( job, SIGNAL(destroyed( QObject * )), this, SLOT(endProgressOperation( QObject * )) );
m_progressBar->addProgressBar( newBar, job );
m_progressBar->show();
m_busy = true;
@@ -222,18 +181,16 @@ ProgressBar * StatusBar::newProgressOperation( KJob * job, const QString & descr
return newBar;
}
-ProgressBar *StatusBar::newProgressOperation( QNetworkReply* reply, const QString & description )
+ProgressBar *StatusBar::newProgressOperation( QNetworkReply *reply, const QString &description )
{
//clear any short message currently being displayed and stop timer if running...
clearMessage();
m_shortMessageTimer->stop();
- //also hide the now playing stuff:
- m_nowPlayingWidget->hide();
- NetworkProgressBar * newBar = new NetworkProgressBar( 0, reply );
+ NetworkProgressBar *newBar = new NetworkProgressBar( 0, reply );
newBar->setDescription( description );
newBar->setAbortSlot( reply, SLOT(deleteLater()) );
- connect( reply, SIGNAL(destroyed(QObject*)), this, SLOT(endProgressOperation(QObject*)) );
+ connect( reply, SIGNAL(destroyed( QObject * )), SLOT(endProgressOperation( QObject * )) );
m_progressBar->addProgressBar( newBar, reply );
m_progressBar->show();
m_busy = true;
@@ -241,9 +198,9 @@ ProgressBar *StatusBar::newProgressOperation( QNetworkReply* reply, const QStrin
return newBar;
}
-void StatusBar::shortMessage( const QString & text )
+void StatusBar::shortMessage( const QString &text )
{
- if ( !m_busy )
+ if( !m_busy )
{
//not busy, so show right away
showMessage( text );
@@ -267,7 +224,7 @@ void StatusBar::hideProgress()
void StatusBar::nextShortMessage()
{
- if ( m_shortMessageQue.count() > 0 )
+ if( m_shortMessageQue.count() > 0 )
{
m_busy = true;
showMessage( m_shortMessageQue.takeFirst() );
@@ -277,77 +234,24 @@ void StatusBar::nextShortMessage()
{
clearMessage();
m_busy = false;
- m_nowPlayingWidget->show();
}
}
-void StatusBar::trackMetadataChanged( Meta::TrackPtr track )
-{
- if( track )
- updateInfo( track );
-}
-
-void
-StatusBar::stopped()
-{
- m_nowPlayingLabel->setText( i18n( "No track playing" ) );
- m_nowPlayingEmblem->hide();
-}
-
-void
-StatusBar::paused()
-{
- m_nowPlayingLabel->setText( i18n( "Amarok is paused" ) );
- m_nowPlayingEmblem->hide();
-}
-
-void
-StatusBar::trackPlaying( Meta::TrackPtr track )
-{
- m_currentTrack = track;
-
- if( m_currentTrack )
- updateInfo( m_currentTrack );
-}
-
-void
-StatusBar::updateInfo( Meta::TrackPtr track )
-{
- // Check if we have any source info:
- Capabilities::SourceInfoCapability *sic = track->create<Capabilities::SourceInfoCapability>();
- if ( sic )
- {
- if ( !sic->sourceName().isEmpty() )
- {
- m_nowPlayingEmblem->setPixmap( sic->emblem() );
- m_nowPlayingEmblem->show();
- }
- else
- m_nowPlayingEmblem->hide();
- delete sic;
- }
- else
- m_nowPlayingEmblem->hide();
-
- m_nowPlayingLabel->setText( i18n( "Playing: %1", The::engineController()->prettyNowPlaying() ) );
-}
-
-void StatusBar::longMessage( const QString & text, MessageType type )
+void StatusBar::longMessage( const QString &text, MessageType type )
{
DEBUG_BLOCK
// The purpose of this emit is to make the operation thread safe. If this
// method is called from a non-GUI thread, the "emit" relays it over the
// event loop to the GUI thread, so that we can safely create widgets.
-
emit signalLongMessage( text, type );
}
-void StatusBar::slotLongMessage( const QString & text, MessageType type ) //SLOT
+void StatusBar::slotLongMessage( const QString &text, MessageType type ) //SLOT
{
DEBUG_BLOCK
- LongMessageWidget * message = new LongMessageWidget( this, text, type );
+ LongMessageWidget *message = new LongMessageWidget( this, text, type );
connect( message, SIGNAL( closed() ), this, SLOT( hideLongMessage() ) );
}
@@ -357,4 +261,3 @@ void StatusBar::hideLongMessage()
}
#include "StatusBar.moc"
-
diff --git a/src/statusbar/StatusBar.h b/src/statusbar/StatusBar.h
index 57301a9..7127a42 100644
--- a/src/statusbar/StatusBar.h
+++ b/src/statusbar/StatusBar.h
@@ -127,53 +127,38 @@ public slots:
* Uses the return value from sender() to determine the owner of
* the progress bar in question
*/
-
void endProgressOperation( QObject *owner )
{
m_progressBar->endProgressOperation( owner );
}
+ /** Required to put the progressbar inline (BrowserDock)
+ * @returns the compound progressbar instance
+ */
+ CompoundProgressBar *compoundProgressBar() { return m_progressBar; }
+
protected:
protected slots:
- void stopped();
- void paused();
- void trackPlaying( Meta::TrackPtr track );
- void trackMetadataChanged( Meta::TrackPtr track );
-
void hideProgress();
void nextShortMessage();
void hideLongMessage();
private:
/** StatusBar is a singleton and there should be only one */
- StatusBar( QWidget * parent );
+ StatusBar( QWidget *parent );
~StatusBar();
- /** Connects the status bar to the playlist and the engine controller.
- By implication the playlist and the engine controller will be created if not
- already existing.
- */
- void connectPlaylist();
-
friend class MainWindow;
- void updateInfo( Meta::TrackPtr track );
-
- CompoundProgressBar * m_progressBar;
-
- KHBox * m_nowPlayingWidget;
- KSqueezedTextLabel * m_nowPlayingLabel;
- QLabel * m_nowPlayingEmblem;
+ CompoundProgressBar *m_progressBar;
QList<QString> m_shortMessageQue;
bool m_busy;
QTimer * m_shortMessageTimer;
- Meta::TrackPtr m_currentTrack;
-
private slots:
void slotLongMessage( const QString &text, MessageType type = Information );
};