From 64e7705e68cc5d67c0af1a7a375fa03a65c30ad0 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Fri, 23 May 2008 21:07:58 +0000 Subject: [PATCH] Add a slot to set the progress bar value and a member to hide it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17615 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/progressloggergui.cpp | 13 +++++++++++++ rbutil/rbutilqt/progressloggergui.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp index 15ddc18663..a96778bc11 100644 --- a/rbutil/rbutilqt/progressloggergui.cpp +++ b/rbutil/rbutilqt/progressloggergui.cpp @@ -59,6 +59,13 @@ void ProgressLoggerGui::addItem(const QString &text, int flag) dp.listProgress->scrollToItem(item); } +void ProgressLoggerGui::setProgress(int value, int max) +{ + setProgressValue(value); + setProgressMax(max); +} + + void ProgressLoggerGui::setProgressValue(int value) { dp.progressBar->setValue(value); @@ -74,6 +81,12 @@ int ProgressLoggerGui::getProgressMax() return dp.progressBar->maximum(); } +void ProgressLoggerGui::setProgressVisible(bool b) +{ + dp.progressBar->setVisible(b); +} + + void ProgressLoggerGui::abort() { dp.buttonAbort->setText(tr("&Ok")); diff --git a/rbutil/rbutilqt/progressloggergui.h b/rbutil/rbutilqt/progressloggergui.h index 41e7012df0..231e6d82c9 100644 --- a/rbutil/rbutilqt/progressloggergui.h +++ b/rbutil/rbutilqt/progressloggergui.h @@ -33,6 +33,7 @@ public: virtual void setProgressValue(int value); virtual void setProgressMax(int max); virtual int getProgressMax(); + virtual void setProgressVisible(bool); signals: virtual void aborted(); @@ -41,6 +42,7 @@ signals: public slots: virtual void addItem(const QString &text); //! add a string to the progress list virtual void addItem(const QString &text, int flag); //! add a string to the list + virtual void setProgress(int, int); //! set progress bar virtual void abort(); virtual void undoAbort();