aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/mainwindow.cpp2
-rw-r--r--src/ui/textscroller.cpp14
-rw-r--r--src/ui/textscroller.h4
3 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp
index 5ae50bd5e..4de1dfd4f 100644
--- a/src/ui/mainwindow.cpp
+++ b/src/ui/mainwindow.cpp
@@ -132,6 +132,8 @@ MainWindow::MainWindow(const QStringList& args,CommandLineOptionManager* option_
SLOT(showDecoderState(const DecoderState&)));
connect(m_core, SIGNAL(titleChanged(const QString&)),
SLOT(changeTitle(const QString&)));
+ connect(m_core, SIGNAL(bufferingProgress(int)), TextScroller::getPointer(),
+ SLOT(setProgress(int)));
connect ( m_skin, SIGNAL ( skinChanged() ), this, SLOT ( updateSkin() ) );
updateEQ();
diff --git a/src/ui/textscroller.cpp b/src/ui/textscroller.cpp
index 4f3e3be80..fc12ebf12 100644
--- a/src/ui/textscroller.cpp
+++ b/src/ui/textscroller.cpp
@@ -73,6 +73,8 @@ void TextScroller::addOffset()
void TextScroller::setText(const QString& text)
{
+ if(isVisible())
+ m_timer->start();
if (m_text != text)
{
m_text = text;
@@ -103,6 +105,18 @@ void TextScroller::readSettings()
}
}
+void TextScroller::setProgress(int progress)
+{
+ m_timer->stop();
+ x = 0;
+ m_pixmap.fill ( Qt::transparent );
+ QPainter paint ( &m_pixmap );
+ paint.setPen(m_color);
+ paint.setFont(m_font);
+ paint.drawText (4,12, tr("Buffering:") + QString(" %1\%").arg(progress));
+ setPixmap(m_pixmap);
+}
+
void TextScroller::hideEvent ( QHideEvent *)
{
m_timer->stop();
diff --git a/src/ui/textscroller.h b/src/ui/textscroller.h
index 7346ce29a..67a4079db 100644
--- a/src/ui/textscroller.h
+++ b/src/ui/textscroller.h
@@ -42,6 +42,10 @@ public:
void setText(const QString&);
void readSettings();
+
+public slots:
+ void setProgress(int);
+
private slots:
void addOffset();
void updateSkin();