summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h3
-rw-r--r--microkde/kdialog.cpp48
-rw-r--r--microkde/kdialog.h20
3 files changed, 69 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index e6738b6..d3734da 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -31,4 +31,5 @@
#include <qregexp.h>
#include <qprogressdialog.h>
+#include <kdialog.h>
class QPopupMenu;
@@ -100,5 +101,5 @@ class KCommandSocket : public QObject
int mConnectCount;
int mConnectMax;
- QProgressDialog mConnectProgress;
+ KProgressDialog mConnectProgress;
QWidget* tlw;
QSocket* mSocket;
diff --git a/microkde/kdialog.cpp b/microkde/kdialog.cpp
index 961631e..f9e0126 100644
--- a/microkde/kdialog.cpp
+++ b/microkde/kdialog.cpp
@@ -2,5 +2,9 @@
#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 ) :
@@ -24,2 +28,44 @@ 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();
+}
diff --git a/microkde/kdialog.h b/microkde/kdialog.h
index 703d268..bc80689 100644
--- a/microkde/kdialog.h
+++ b/microkde/kdialog.h
@@ -3,4 +3,7 @@
#include <qdialog.h>
+class QLabel;
+class QProgressBar;
+class QPushButton ;
class KDialog : public QDialog
@@ -15,4 +18,21 @@ class KDialog : public QDialog
static int marginHintSmall();
};
+class KProgressDialog : public QDialog
+{
+ Q_OBJECT
+ public:
+ KProgressDialog( QWidget *parent=0, const char *name=0, bool modal=false );
+ void setLabelText ( const QString & );
+ void setTotalSteps ( int totalSteps );
+ void setProgress ( int progress );
+ void accept();
+ void reject();
+ private:
+ QLabel * mLabel;
+ QProgressBar *mBar;
+ QPushButton *mButton;
+ signals:
+ void cancelled ();
+};
#endif