summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/progressloggergui.cpp
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2007-09-15 22:13:41 +0000
committerAntoine Cellerier <dionoea@videolan.org>2007-09-15 22:13:41 +0000
commit78d7ece5e914c3f307c42aea2dbb36cf33e7d81c (patch)
tree160b5d8260461456c9db3ab9ed275096b44d21de /rbutil/rbutilqt/progressloggergui.cpp
parent4bcd0fa2d4a64b6c90c5d07b35001e967bd6ec60 (diff)
downloadrockbox-78d7ece5e914c3f307c42aea2dbb36cf33e7d81c.zip
rockbox-78d7ece5e914c3f307c42aea2dbb36cf33e7d81c.tar.gz
rockbox-78d7ece5e914c3f307c42aea2dbb36cf33e7d81c.tar.bz2
rockbox-78d7ece5e914c3f307c42aea2dbb36cf33e7d81c.tar.xz
Automatically scroll to the last line of the progress logger when adding a new item.
Cosmetics. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14716 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/progressloggergui.cpp')
-rw-r--r--rbutil/rbutilqt/progressloggergui.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp
index 5bf7b92..0d3fcb4 100644
--- a/rbutil/rbutilqt/progressloggergui.cpp
+++ b/rbutil/rbutilqt/progressloggergui.cpp
@@ -16,7 +16,7 @@
* KIND, either express or implied.
*
****************************************************************************/
-
+
#include "progressloggergui.h"
ProgressLoggerGui::ProgressLoggerGui(QObject* parent): ProgressloggerInterface(parent)
@@ -28,18 +28,19 @@ ProgressLoggerGui::ProgressLoggerGui(QObject* parent): ProgressloggerInterface(p
connect(dp.buttonAbort, SIGNAL(clicked()), this, SLOT(abort()));
}
-
-void ProgressLoggerGui::addItem(QString text)
+void ProgressLoggerGui::addItem(const QString &text)
{
- dp.listProgress->addItem(text);
-}
+ addItem(text, LOGNOICON);
+}
-void ProgressLoggerGui::addItem(QString text,int flag)
+void ProgressLoggerGui::addItem(const QString &text, int flag)
{
QListWidgetItem* item = new QListWidgetItem(text);
-
+
switch(flag)
{
+ case LOGNOICON:
+ break;
case LOGOK:
item->setIcon(QIcon(":/icons/icons/go-next.png"));
break;
@@ -53,14 +54,15 @@ void ProgressLoggerGui::addItem(QString text,int flag)
item->setIcon(QIcon(":/icons/icons/dialog-error.png"));
break;
}
-
+
dp.listProgress->addItem(item);
-}
+ dp.listProgress->scrollToItem(item);
+}
void ProgressLoggerGui::setProgressValue(int value)
{
dp.progressBar->setValue(value);
-}
+}
void ProgressLoggerGui::setProgressMax(int max)
{
@@ -70,7 +72,7 @@ void ProgressLoggerGui::setProgressMax(int max)
int ProgressLoggerGui::getProgressMax()
{
return dp.progressBar->maximum();
-}
+}
void ProgressLoggerGui::abort()
{