summaryrefslogtreecommitdiffstats
path: root/khelpcenter/htmlsearch/progressdialog.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /khelpcenter/htmlsearch/progressdialog.cpp
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khelpcenter/htmlsearch/progressdialog.cpp')
-rw-r--r--khelpcenter/htmlsearch/progressdialog.cpp76
1 files changed, 76 insertions, 0 deletions
diff --git a/khelpcenter/htmlsearch/progressdialog.cpp b/khelpcenter/htmlsearch/progressdialog.cpp
new file mode 100644
index 000000000..497c90324
--- /dev/null
+++ b/khelpcenter/htmlsearch/progressdialog.cpp
@@ -0,0 +1,76 @@
+#include <qlayout.h>
+#include <qlabel.h>
+
+
+#include <klocale.h>
+#include <kprogress.h>
+#include <kstandarddirs.h>
+
+
+#include "progressdialog.moc"
+
+
+ProgressDialog::ProgressDialog(QWidget *parent, const char *name)
+ : KDialogBase(KDialogBase::Plain, i18n("Generating Index"), Cancel, Cancel,
+ parent, name, false)
+{
+ QGridLayout *grid = new QGridLayout(plainPage(), 5,3, spacingHint());
+
+ QLabel *l = new QLabel(i18n("Scanning for files"), plainPage());
+ grid->addMultiCellWidget(l, 0,0, 1,2);
+
+ filesScanned = new QLabel(plainPage());
+ grid->addWidget(filesScanned, 1,2);
+ setFilesScanned(0);
+
+ check1 = new QLabel(plainPage());
+ grid->addWidget(check1, 0,0);
+
+ l = new QLabel(i18n("Extracting search terms"), plainPage());
+ grid->addMultiCellWidget(l, 2,2, 1,2);
+
+ bar = new KProgress(plainPage());
+ grid->addWidget(bar, 3,2);
+
+ check2 = new QLabel(plainPage());
+ grid->addWidget(check2, 2,0);
+
+ l = new QLabel(i18n("Generating index..."), plainPage());
+ grid->addMultiCellWidget(l, 4,4, 1,2);
+
+ check3 = new QLabel(plainPage());
+ grid->addWidget(check3, 4,0);
+
+ setState(0);
+
+ setMinimumWidth(300);
+}
+
+
+void ProgressDialog::setFilesScanned(int n)
+{
+ filesScanned->setText(i18n("Files processed: %1").arg(n));
+}
+
+
+void ProgressDialog::setFilesToDig(int n)
+{
+ bar->setTotalSteps(n);
+}
+
+
+void ProgressDialog::setFilesDigged(int n)
+{
+ bar->setProgress(n);
+}
+
+
+void ProgressDialog::setState(int n)
+{
+ QPixmap unchecked = QPixmap(locate("data", "khelpcenter/pics/unchecked.xpm"));
+ QPixmap checked = QPixmap(locate("data", "khelpcenter/pics/checked.xpm"));
+
+ check1->setPixmap( n > 0 ? checked : unchecked);
+ check2->setPixmap( n > 1 ? checked : unchecked);
+ check3->setPixmap( n > 2 ? checked : unchecked);
+}