summaryrefslogtreecommitdiffabout
path: root/microkde/kdialog.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdialog.cpp48
1 files changed, 47 insertions, 1 deletions
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp
index 961631e..f9e0126 100644
--- a/microkde/kdialog.cpp
+++ b/microkde/kdialog.cpp
@@ -1,7 +1,11 @@
#include <kdialog.h>
#include <qapp.h>
-
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qprogressbar.h>
+#include <klocale.h>
KDialog::KDialog( QWidget *parent, const char *name, bool modal ) :
QDialog( parent, name, modal )
@@ -23,3 +27,45 @@ int KDialog::marginHint() { return 3; }
int KDialog::spacingHintSmall() { return 1; }
int KDialog::marginHintSmall() { return 1; }
#endif
+KProgressDialog::KProgressDialog( QWidget *parent, const char *name, bool modal ) :
+ QDialog( parent, name, modal )
+{
+ QVBoxLayout* lay= new QVBoxLayout ( this );
+ mLabel = new QLabel ( "abc",this );
+ mBar = new QProgressBar ( this );
+ mButton = new QPushButton ( i18n("Cancel"),this );
+ lay->addWidget ( mLabel );
+ lay->addWidget ( mBar );
+ lay->addWidget ( mButton );
+ connect ( mButton , SIGNAL ( clicked () ), this, SIGNAL ( cancelled () ));
+ resize ( 220, sizeHint().height() +mLabel->sizeHint().height());
+
+}
+
+void KProgressDialog::setLabelText ( const QString & t)
+{
+ mLabel->setText( t );
+}
+
+void KProgressDialog::setTotalSteps ( int totalSteps )
+{
+ setActiveWindow();
+ setFocus();
+ mBar->setTotalSteps ( totalSteps );
+}
+void KProgressDialog::setProgress ( int progress )
+{
+ setActiveWindow();
+ setFocus();
+ mBar->setProgress ( progress );
+}
+void KProgressDialog::accept()
+{
+
+ // QDialog::accept();
+}
+void KProgressDialog::reject()
+{
+ emit cancelled ();
+ //QDialog::reject();
+}